GET /v1/card-formatFormat and mask credit card
Validation Utils lf-validation-utils
Tidies up a card number's spacing and hides all but the last few digits. Format and mask credit card
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
number | string | Yes | Card number |
mask_char | string | No | Mask character (default '*') |
Response Schema
formatted (string): Grouped card number
masked (string): Masked number
network (string): Detected network
last_four (string): Last four digits
valid_luhn (boolean): Luhn result
cURL Example
curl 'https://lf-validation-utils.laminarforge.dev/v1/card-format?number=<number>' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-validation-utils.laminarforge.dev/v1/card-format'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'number': '<number>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())