Purchases

Creating a Purchase

In order to create a purchase you must submit the following details:

Either Or

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_holder\": \"Jim Smith\", \
        \"card_number\": \"5123456789012346\", \
        \"card_expiry\": \"05/2023\", \
        \"cvv\": \"987\", \
        \"amount\": 1000, \
        \"reference\": \"ORD18838206\", \
        \"customer_ip\": \"111.222.111.123\" \
    }"

Responses

Successful — HTTP 200
{
  "successful": true,
  "response": {
    "authorization": 1384819815,
    "id": "071-P-HZGZ9C4U",
    "card_number": "512345XXXXXX2346",
    "card_holder": "Jim Smith",
    "card_expiry": "2023-05-31",
    "card_token": "1tyyuywf",
    "amount": 1000,
    "decimal_amount": 10.0,
    "successful": true,
    "message": "Approved",
    "reference": "ORD18838206",
    "currency": "AUD",
    "settlement_date": "2013-11-20",
    "transaction_date": "2013-11-19T11:10:15+11:00",
  },
  "errors": [

  ],
  "test": true
}
Failed (bad data) — HTTP 400
{
    "successful": false,
    "response": {
        "test": true
    },
    "errors": ["Invalid Card Number"]
}
Failed (declined card) — HTTP 200
{
  "successful": true,
  "response": {
    "authorization": 1384819972,
    "id": "071-P-5BYLEA3E",
    "card_number": "444433XXXXXX1111",
    "card_holder": "Jim Smith",
    "card_expiry": "2023-05-31T23:59:59+10:00",
    "card_token": "v15njdgu",
    "amount": 1000,
    "decimal_amount": 10.0,
    "successful": false,
    "message": "Declined",
    "reference": "ORD18838206",
    "currency": "AUD",
    "settlement_date": "2013-11-20",
    "transaction_date": "2013-11-19T11:12:52+11:00",
  },
  "errors": [

  ],
  "test": true
}

Retrieve a Purchase

Definition

Authentication: Basic xxxxxxxxxxxxx
GET /v1.0/purchases/{PURCHASE_ID} HTTP/1.1

Example Request

$ curl https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/001-P-YH8JHU7 -u TEST:TEST

Responses

Successful — HTTP 200
{
    "successful": true,
    "response": {
        "authorization": "55355",
        "id": "001-P-YH8JHU7",
        "card_number": "444433XXXXXX1111",
        "card_holder": "John Smith",
        "card_expiry": "10/2011",
        "amount": 349,
        "authorized": true,
        "reference": "ORD18838206",
        "message": "Approved",
    },
    "test": true
    "errors": []
}
Failed (not found) — HTTP 404
{
    "successful": false,
    "response": null,
    "test": true
    "errors": ["Purchase not found"]
}
Failed (Permission Denied) — HTTP 403
{
  "successful": false,
  "response": null,
  "test": true,
  "errors": ["You do not have permissions to access this record"]
}