{
  "openapi": "3.1.0",
  "info": {
    "title": "BIN & Card Validator API",
    "version": "1.0.0",
    "description": "Card scheme from a BIN and full-number validation with Luhn and length rules, nothing stored.\n\nDetect a card's scheme (Visa, Mastercard, Amex, Discover, Diners, JCB, UnionPay, Maestro) from its BIN/IIN, and validate a full card number with the Luhn checksum and per-scheme length rules. Computed entirely from the number — no card data is stored.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/bin-card-validator.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/bin-card-validator"
  },
  "servers": [
    {
      "url": "https://api-bin-lookup.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Finance",
      "description": "BIN & Card Validator API belongs to the Finance category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/bin/{bin}": {
      "get": {
        "operationId": "lookupBin",
        "summary": "Lookup BIN",
        "description": "Lookup BIN endpoint of the BIN & Card Validator API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/bin-card-validator/lookup-bin"
        },
        "parameters": [
          {
            "name": "bin",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "453201"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "bin": "453201",
                  "scheme": "visa",
                  "expected_lengths": [
                    13,
                    16,
                    19
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/validate": {
      "get": {
        "operationId": "validateCard",
        "summary": "Validate Card",
        "description": "Validate Card endpoint of the BIN & Card Validator API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/bin-card-validator/validate-card"
        },
        "parameters": [
          {
            "name": "number",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "4532015112830366"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "card": "453201******0366",
                  "last4": "0366",
                  "bin": "453201",
                  "scheme": "visa",
                  "length": 16,
                  "expected_lengths": [
                    13,
                    16,
                    19
                  ],
                  "luhn_valid": true,
                  "length_valid": true,
                  "valid": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}