Cards
Create Card
This endpoint registers a new card with Thanx.
POST
/cards
Bearer*
Deprecation Coming Soon
This card registration endpoint will be superseded by the new card registration API endpoint, which eliminates the need for encrypting the card via Thanx Tokenization SDKs.
Full credit card PANs should never be sent to this API endpoint.
Request Field
last4required
string
Last 4 digits of the card PAN
typerequired
string
Card type (visa
, mastercard
, amex
)
encrypted_panrequired
string
Encrypted Card PAN (Must use Thanx Tokenization SDKs for this. No raw PANs should ever be sent to Thanx APIs)
zip_coderequired
string
The card’s billing zip code
Response
id
string
Card ID
user_id
string
The user the card belongs to
last4
string
Last 4 digits of the card PAN
type
enum
Card type (visa, mastercard, amex)
zip_code
string
The card’s billing zip code
curl https://api.thanxsandbox.com/cards \
-X POST \
$AUTH_HEADERS
-d '{
"card": {
"last4": "1234",
"type": "visa",
"encrypted_pan": "...",
"zip_code": "12345"
}
}'
{
"card": {
"id": "92b7b0dac4",
"user_id": "weorufsdf",
"last4": "1234",
"type": "visa",
"zip_code": "12345"
}
}
curl https://api.thanxsandbox.com/cards \
-X POST \
$AUTH_HEADERS
-d '{
"card": {
"last4": "1234",
"type": "visa",
"encrypted_pan": "...",
"zip_code": "12345"
}
}'
{
"card": {
"id": "92b7b0dac4",
"user_id": "weorufsdf",
"last4": "1234",
"type": "visa",
"zip_code": "12345"
}
}