{
    "openapi": "3.0.3",
    "info": {
        "title": "C4CHECK Card Checker API",
        "description": "Verify a card's status with one request. Results are normalized to Live, Dead or Error; billing is per classified result from a prepaid balance and errors are never charged. API checks always bill normally (free-check promotions apply to the web checker only).",
        "version": "1.1.0",
        "contact": {
            "url": "https://c4check.com/api/index.php"
        }
    },
    "servers": [
        {
            "url": "https://c4check.com"
        }
    ],
    "paths": {
        "/api/v1/api.php": {
            "get": {
                "summary": "Check a single card",
                "description": "Submits one card to the chosen gateway and returns the normalized classification plus the check id, the gateway identifier, your remaining balance and the amount charged.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "gateway",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "fast-checker"
                            ]
                        },
                        "description": "Gateway API identifier (slug — recommended), numeric id, or exact name. Active gateways: fast-checker"
                    },
                    {
                        "name": "cc",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Pipe-separated card fields in the gateway input format. Common formats: CC|MM|YYYY|CVV (standard), CC|MM|YYYY|CVV|ZIP (AVS), CC|MM|YYYY|ZIP (CCN), CC|MM|YYYY (dumps). Example: 4307410677293014|01|2030|651"
                    },
                    {
                        "name": "json",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        },
                        "description": "Return JSON (recommended). Without it the response is the plain-text result."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Classification result. JSON when json=1, otherwise the plain-text value Live, Dead or Error.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "result",
                                        "id",
                                        "gateway",
                                        "balance",
                                        "charge"
                                    ],
                                    "properties": {
                                        "result": {
                                            "type": "string",
                                            "enum": [
                                                "Live",
                                                "Dead",
                                                "Error"
                                            ],
                                            "description": "Live = active and chargeable; Dead = closed/blocked/invalid; Error = no definitive answer (not charged)."
                                        },
                                        "id": {
                                            "type": "integer",
                                            "example": 1284,
                                            "description": "Check record id, useful for support and reconciliation."
                                        },
                                        "gateway": {
                                            "type": "string",
                                            "example": "fast-checker",
                                            "description": "Gateway API identifier used."
                                        },
                                        "balance": {
                                            "type": "string",
                                            "example": "99.33",
                                            "description": "Balance after the check."
                                        },
                                        "charge": {
                                            "type": "string",
                                            "example": "0.0300",
                                            "description": "Amount charged, 4 decimals; 0 on errors."
                                        }
                                    }
                                }
                            },
                            "text/plain": {
                                "schema": {
                                    "type": "string",
                                    "enum": [
                                        "Live",
                                        "Dead",
                                        "Error"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid API key, or disabled account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Invalid API key"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Insufficient balance — rejected before any gateway call, nothing charged",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Insufficient balance"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown, disabled or deleted gateway, or gateway URL not configured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Invalid gateway or gateway not active"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Missing card data, wrong field count for the gateway format, failed Luhn checksum, or missing ZIP for AVS/CCN formats",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Invalid card format"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (5 requests/second per IP, burst 10)"
                    },
                    "500": {
                        "description": "Unexpected internal failure — reservation released, nothing charged",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Check failed; no charge applied"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "The provider returned an empty response or transport failure — nothing charged",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Gateway returned empty response"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/public/bins.php": {
            "get": {
                "summary": "Public BIN/IIN reference lookup",
                "description": "Free issuer-range metadata: brand, card type, issuing bank and country. Reference data only — never account status.",
                "parameters": [
                    {
                        "name": "action",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "meta",
                                "countries",
                                "brands",
                                "banks",
                                "bins",
                                "lookup"
                            ]
                        },
                        "description": "Operation to perform."
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "ISO 3166-1 alpha-2 country code (for banks/bins)."
                    },
                    {
                        "name": "brand",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Brand filter."
                    },
                    {
                        "name": "bank",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Issuing bank filter."
                    },
                    {
                        "name": "bin",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "6–8 digit prefix (for lookup)."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Reference metadata"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            }
        }
    }
}