Register a card
Registers a new credit card for a customer. The card is stored securely in the token vault and can be used for recurring charges.
By default (validateCard=true), a small test transaction (up to R$ 2.00)
is made to validate the card. The customer must verify this amount on their
statement and use the /cards/{id}/activate endpoint to activate the card.
Authorizations
HTTP Basic authentication. Use your secret key as the username and an empty string as password. The API key should be base64 encoded in the format 'username:' when sending the Authorization header.
Body
Customer ID who owns the card
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
Card number
"4111111111111111"
Name printed on card
"JOHN DOE"
Expiration month (01-12)
2"12"
Expiration year (YYYY)
4"2028"
Security code
3"123"
Optional alias for the card
"My Visa Card"
Whether to validate the card with a test transaction. When true, a small amount (up to R$ 2.00) is charged and must be confirmed via the /cards/{id}/activate endpoint.
true
Response
Card registered successfully
Card token ID
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
Card token for future reference
"tok_abc123xyz"
Masked card number (last 4 digits)
"****1111"
Card status
pending_validation, active "pending_validation"
Whether card requires activation
true
Activation instructions (only when validateCard=true)