Skip to main content

Tokenize card

POST/api/v1/bank/wallet/tokenization/Bearer Token

Request headers

HeaderValueRequired
AuthorizationBearer {A55_ACCESS_TOKEN}Yes
Content-Typeapplication/jsonYes
Idempotency-KeyUUID v4Recommended

Request body

FieldTypeRequiredDescription
wallet_uuidstring (UUID)YesWallet ID
merchant_uuidstring (UUID)YesMerchant ID
cardobjectYesCard information to tokenize
card.holder_namestringYesCardholder's name as printed on the card
card.numberstringYesCard number (PAN), 13–16 digits
card.expiry_monthstringYesExpiration month (0112), 2 digits
card.expiry_yearstringYesExpiration year (YYYY), 4 digits
card.cvvstringYesCard security code (CVV), 3 digits
Card data handling

When sending raw card data, A55 encrypts and vaults it immediately upon receipt. If you prefer to avoid handling card data on your backend, use the A55Pay SDK or Checkout Page instead.


Response fields

FieldTypeDescription
token_uuidstring (UUID)Reusable token identifier for future charges
card_brandstringCard brand (visa, mastercard, amex, elo)
card_last_fourstringLast 4 digits of the card
card_expiry_monthstringExpiry month
card_expiry_yearstringExpiry year
statusstringactive on success
created_atstringISO 8601 creation timestamp

Response example

{
"token_uuid": "d7641ce9-9411-432c-bb25-240ce7dd3cef",
"card_brand": "visa",
"card_last_four": "3191",
"card_expiry_month": "12",
"card_expiry_year": "2030",
"status": "active",
"created_at": "2026-03-21T14:30:00-03:00"
}

HTTP status codes

StatusDescription
200Card tokenized successfully
400Invalid card data or missing required fields
401Invalid or expired Bearer token
403Insufficient permissions for this wallet
404Wallet not found
409Card already tokenized for this wallet
422Card validation failed (invalid number, expired)
429Rate limit exceeded
500Internal server error — retry with exponential backoff

Code examples

curl -s -X POST https://sandbox.api.a55.tech/api/v1/bank/wallet/tokenization/ \
-H "Authorization: Bearer $A55_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 880e8400-e29b-41d4-a716-446655440003" \
-d '{
"wallet_uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"merchant_uuid": "d6f921ef-5bdd-4ebf-a065-bd38de839bd1",
"card": {
"holder_name": "MARIA SILVA",
"number": "4024007153763191",
"expiry_month": "12",
"expiry_year": "2030",
"cvv": "123"
}
}'

Sandbox simulation

In sandbox, tokenization outcomes follow the same test card rules as charges. A successful enrollment returns HTTP 200 with a token_uuid; failures return HTTP 400 with card_tokenization_failed.

Requires tokenization_enabled: true on the merchant. Contact your account manager to enable it.


Error response example

{
"status": "error",
"message": [
{
"code": "INVALID_CARD_NUMBER",
"source": "validation",
"description": "Card number failed Luhn check"
}
]
}