Giftcard Management

POST /gift_card

Create a new giftcard.

Required params are:

  • value (Int: Initial amount deposited onto giftcard, between 10-1000)
  • transaction_id (String: Your internal reference)
{
  "value": <value_amount>,
  "transaction_id": "<transaction_id>"
}

A successful request returns a 201 and the giftcard object.

Example return structure:

{
  "transaction_id": "<transaction_id>",
  "giftcard" : {
    "status":"NOT REDEEMED YET",
    "code":"HTF-2KQX-G530",
    "expiry_date":"2019-01-24T00:34:20+0000",
    "created_date":"2018-01-24T00:34:20+0000",
    "description":"Generated by: <seller_name, ref: <transaction_id>"
  }
}

GET /gift_card/<code>

Check the balance of a previously created giftcard.

A successful request returns a 200 and the giftcard object.

Example return structure:

{
 "giftcard": {
  "status":"NOT REDEEMED YET",
  "code":"<code>",
  "expiry_date":"2019-01-24T00:34:20+0000",
  "created_date":"2018-01-24T00:34:20+0000",
  "balance":100,
  "description":"Generated by: <seller_name, ref: <creation_transaction_id>"
 }
}

POST /gift_card/void

Void an existing giftcard rendering it unusable.

Required params are:

  • code (String: The redeemable giftcard code returned by the inital create method)
{
  transaction_id: "foobar",
  code: "<code>"
}

A successful request returns a 200 and the giftcard object.

Example return structure:

{
 "transaction_id":"foobar",
 "giftcard" : {
  "status":"VOIDED",
  "code":"HTF-2KQX-G530",
  "expiry_date":"2019-01-24T00:34:20+0000",
  "created_date":"2018-01-24T00:34:20+0000",
  "balance":100,
  "description":"Generated by: <seller_name, ref: <creation_transaction_id>"
 }
}