Cards
Create Card
POST

/cards

Bearer*
curl --request POST \
  --url https://api.thanx.com/cards \
  --header 'Authorization: Bearer <token>' \
  --data '{
  "last4": "<last4>",
  "type": "<type>",
  "encrypted_pan": "<encrypted_pan>",
  "zip_code": "<zip_code>"
}'

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"
  }
}