About this endpoint
What it does
Validates a card number using the Luhn algorithm, detects the card network, and returns normalized/masked card-number details. The request sends a card number in the body; the response returns validation and formatting fields for that number.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| card_number | String | Yes | The card number. Spaces and dashes are ignored. |
Response
Returns a JSON object with iin, note, last4, valid, length, masked, network, formatted, luhn_valid, and length_valid fields. The response is a single JSON object containing these top-level fields.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| iin | String | No | The card IIN/BIN value. |
| note | String | No | A textual note. |
| last4 | String | No | The last 4 digits of the card number. |
| valid | Boolean | No | Whether the card number is valid. |
| length | Integer | No | The card number length. |
| masked | String | No | A masked version of the card number. |
| network | String | No | The detected card network. |
| formatted | String | No | The formatted card number. |
| luhn_valid | Boolean | No | Whether the number passes the Luhn check. |
| length_valid | Boolean | No | Whether the number length is valid. |