POST
validate
credit_card
1 creditValidate a credit card number using Luhn algorithm and detect card type
Endpoint
POST /api/v1/tools/validate/credit_card
Body Parameters
number
string
required
Example
input
Request
{
"number": "4532015112830366"
}
output
Response
{
"valid": true,
"card_type": "Visa",
"number_sanitized": "4532 0151 1283 0366"
}
Response Format
HTTP/1.1 200 OK
SUCCESS
{
"success": true,
"data": {
"valid": true,
"card_type": "Visa",
"number_sanitized": "4532 0151 1283 0366"
},
"meta": {
"tool": "credit_card",
"credits_consumed": 1
}
}
HTTP/1.1 422 Unprocessable Entity
ERROR
{
"success": false,
"data": null,
"error": {
"code": "validation_error",
"message": "The given data was invalid."
}
}
Sign in to try this tool directly from the docs.
Code Examples
Request Example
lightbulb
Developer Tip
Credits are deducted before execution. If the upstream tool fails, credits are automatically refunded to your account.