> ## Documentation Index
> Fetch the complete documentation index at: https://docs.localpayment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ottenere le informazioni sul BIN

Convalida un numero di identificazione bancaria (BIN) per verificare la validità di una carta e recuperare dettagli chiave come emittente, circuito, tipo e paese. Usa questa verifica per evitare pagamenti non riusciti a causa di dati della carta non validi.

> **Tieni presente**
>
> Il `countryCode `nella risposta è in formato ISO-3166-1 Alpha-2. Assicurati di convertire questo valore nello standard ISO-3166-1 Alpha-3 prima di inviarlo ad altri endpoint del nostro sistema.


## OpenAPI

````yaml openapi/it/localpayment.json GET /api/resources/bin-validation
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/resources/bin-validation:
    get:
      summary: Ottenere le informazioni sul BIN
      operationId: get-bin-info
      parameters:
        - name: Authorization
          in: header
          description: >-
            Token di accesso Bearer per l'autenticazione. Questo token si
            ottiene dagli endpoint [Ottenere il token di
            accesso](/it/reference/get-token) o [Rinnovare il token di
            accesso](/it/reference/refresh-token).
          required: true
          schema:
            type: string
        - name: bin
          in: query
          description: Numero di identificazione bancaria.
          required: true
          schema:
            type: string
            examples:
              - '400000'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  bin:
                    type: string
                    description: Numero di identificazione bancaria.
                  bank:
                    type: string
                    description: Banca emittente della carta.
                  card:
                    type: string
                    description: Circuito di pagamento della carta.
                  type:
                    type: string
                    enum:
                      - CREDIT
                      - DEBIT
                    description: Tipo di carta.
                  level:
                    type: string
                    description: Livello della carta.
                  country:
                    type: string
                    description: Nome del paese.
                  CountryCode:
                    type: string
                    title: CountryCode
                    description: Codice paese. ISO 3166-1 alpha-2.
                  website:
                    type: string
                    description: Sito web dell'emittente.
                  phone:
                    type: string
                    description: Numero di telefono dell'emittente.
                  valid:
                    type: boolean
                    description: Indica se il BIN fornito è valido.
                required:
                  - bin
                  - bank
                  - card
                  - type
                  - level
                  - country
                  - CountryCode
                  - website
                  - phone
                  - valid
                x-examples:
                  Example 1:
                    bin: '424242'
                    bank: ''
                    card: VISA
                    type: CREDIT
                    level: ''
                    country: United Kingdom of Great Britain and Northern Ireland
                    countryCode: GB
                    website: ''
                    phone: ''
                    valid: true
              examples:
                200 - BIN info.:
                  value:
                    bin: '40000000'
                    bank: INTL HDQTRS-CENTER OWNED
                    card: VISA
                    type: CREDIT
                    level: TRADITIONAL
                    country: United States of America
                    countryCode: US
                    website: ''
                    phone: ''
                    valid: true
        '400':
          description: Richiesta non valida.
          content:
            application/json:
              schema:
                type: object
                properties:
                  bin:
                    type: string
                    description: Numero di identificazione bancaria.
                  valid:
                    type: boolean
                    description: Indica se il BIN fornito è valido.
                  error:
                    type: string
                    description: Messaggio di errore.
                  message:
                    type: string
                    description: Informazioni aggiuntive sull'errore.
                required:
                  - bin
                  - valid
                  - error
                  - message
                x-examples:
                  Example 1:
                    bin: '40000'
                    valid: false
                    error: bincheck.io error
                    message: The BIN number is less than 6 digits.
              examples:
                400 - BIN length error.:
                  value:
                    bin: '40000'
                    valid: false
                    error: bincheck.io error
                    message: The BIN number is less than 6 digits.
                1011 - Invalid BIN:
                  value:
                    bin: 40000-3
                    valid: false
                    error: '1011'
                    message: Invalid BIN
        '401':
          description: Non autorizzato.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Informazioni aggiuntive della risposta.
                  code:
                    type: string
                    description: Codice di stato.
                  messages:
                    type: array
                    description: Elenco dei messaggi.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Classe del token.
                        token_type:
                          type: string
                          description: Tipo di token.
                        message:
                          type: string
                          description: Messaggio con informazioni aggiuntive.
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.