Tokenization

Tokenizing a Card

Definition

Authentication: Basic xxxxxxxxxxxxx
POST /v1.0/credit_cards HTTP/1.1

Example Request

$ curl https://gateway.sandbox.fatzebra.com.au/v1.0/credit_cards -u TEST:TEST -d" \
  {
    \"card_number\": \"5123456789012346\", \
    \"card_holder\": \"Bob Smith\", \
    \"card_expiry\": \"05/2023\", \
    \"cvv\": \"987\" \
  }"

Responses

Successful — HTTP 200
{
  "successful": true,
  "response": {
    "token": "e1q7dbj2",
    "card_holder": "Bob Smith",
    "card_number": "XXXXXXXXXXXX2346",
    "card_expiry": "2023-05-31T23:59:59+10:00",
    "authorized": true,
    "transaction_count": 0
  },
  "errors": [

  ],
  "test": true
}

Create a Purchase with a Tokenized Card

If you have a tokenized card number you may use this in lieu of the card details in order to complete a transaction. If you have the customer CVV (submitted for this transaction - note, you should never store the CVV) you should provide it, however if the card has previously been tokenized you may proceed without it.

Definition

Authentication: Basic xxxxxxxxxxxxx
POST /v1.0/purchases HTTP/1.1

Example Request

$ curl https://gateway.sandbox.fatzebra.com.au/v1.0/purchases -u TEST:TEST -d" \
  {
    \"card_token\": \"a1bnhj76\", \
    \"cvv\": \"987\", \
    \"amount\": 3490, \
    \"reference\": \"ORD98976\", \
    \"customer_ip\": \"111.222.111.123\" \
  }"

Responses

Successful — HTTP 200
{
    "successful": true,
    "response": {
        "authorization": "55355",
        "id": "001-P-12345AA",
        "card_number": "XXXXXXXXXXXX1111",
        "card_holder": "John Smith",
        "card_expiry": "10/2021",
        "card_token": "a1bhj98j",
        "amount": 349,
        "authorized": true,
        "reference": "ABC123",
        "message": "Approved",
    },
    "test": true
    "errors": []
}
Unsuccessful (Invalid Token) — HTTP 400
{
  "successful": false,
  "response": {},
  "errors": [
    "Card a1bhj98j could not be found"
  ],
  "test": true
}
Failed (declined card) — HTTP 200
{
    "successful": true, // This indicates that the API request was successful
    "response": {
        "authorization_id": null,
        "id": null,
        "card_number": "XXXXXXXXXXXX1111",
        "card_holder": "John Smith",
        "card_expiry": "10/2021",
        "amount": 100,
        "authorized": false,
        "reference": "ABC123",
        "message": "Card Declined - check with issuer",
    },
    "test": true
    "errors": [] 
}