{
  "openapi": "3.1.0",
  "info": {
    "title": "PAYATE BIN Lookup API",
    "version": "1.0.0",
    "description": "Free, read-only lookup of a card BIN/IIN (first 6–8 digits). Returns the card scheme, type, level, issuing bank and country from an offline dataset of ~374,000 published BIN ranges. No authentication. Rate-limited to about 45 requests per minute per IP. Only the leading digits are needed — never send a full card number.",
    "contact": { "name": "PAYATE", "url": "https://www.payate.com/?do=Contact" }
  },
  "servers": [ { "url": "https://www.payate.com" } ],
  "paths": {
    "/bin-lookup/lookup.php": {
      "get": {
        "operationId": "binLookup",
        "summary": "Look up a card BIN/IIN",
        "parameters": [
          {
            "name": "bin",
            "in": "query",
            "required": true,
            "description": "First 6 to 8 digits of a card number.",
            "schema": { "type": "string", "pattern": "^[0-9]{6,8}$", "examples": ["414720"] }
          }
        ],
        "responses": {
          "200": {
            "description": "Lookup result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "bin": { "type": "string" },
                    "source": { "type": "string", "enum": ["local", "binlist"] },
                    "data": {
                      "type": "object",
                      "properties": {
                        "scheme": { "type": "string" },
                        "type": { "type": "string" },
                        "brand": { "type": "string" },
                        "prepaid": { "type": "boolean" },
                        "country": {
                          "type": "object",
                          "properties": { "alpha2": { "type": "string" }, "name": { "type": "string" }, "emoji": { "type": "string" } }
                        },
                        "bank": {
                          "type": "object",
                          "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "phone": { "type": "string" } }
                        }
                      }
                    },
                    "error": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": { "description": "Fewer than 6 digits supplied" },
          "429": { "description": "Too many requests" }
        }
      }
    },
    "/api/v1": {
      "get": {
        "operationId": "donate",
        "summary": "Optional $1 USDC donation to PAYATE via x402",
        "description": "x402 (v2) payable resource. Without payment it returns 402 with a base64 PAYMENT-REQUIRED header (exact scheme, USDC on Base eip155:8453). Retry with a PAYMENT-SIGNATURE header to donate. Donations unlock nothing; every tool stays free. Other amounts: /donate/x402/5 and /donate/x402/10. Human page: https://www.payate.com/donate/",
        "responses": {
          "200": { "description": "Donation settled; PAYMENT-RESPONSE header carries the settlement result" },
          "402": { "description": "Payment required (see PAYMENT-REQUIRED header)" }
        }
      }
    }
  }
}
