POST /transaction

This API call will present a transaction for processing. Note the fields that are marked as required below and the data types to be used.

The response will contain a JSON object with details of the transaction result.

Headers

  • Authorization string

    Bearer accessToken

Body

Please pay attention to the required + acceptable values as well as the data types.

  • allowPartialAuth integer

    Include this value if you need to support allowing the partial approval of transactions. An example of this would be for a transaction of 20.00 where the giftcard has a balance of 10.00. In this scenario and with this value set to '1' this API would return a partial approval response with a remaining value to pay.

  • currencyCode integer Required

    ISO 4217 Numeric currency code, which much match the currency code of the giftcard to be debited. An error will be returned if a mismatch occurs. Current supported currency codes are 826 (GBP), 840 (USD) and 978 (EUR)

  • identifier string Required

    The unique identifier of the giftcard to be debited.

  • siteId integer Required

    Numeric site ID that this transaction will be logged against.A check is perfomed by this API that the site ID provided belongs to the client

  • transactionTotal number(float) Required

    Minimum value is 0.01, maximum value is 99999.99.

  • transactionType integer Required

    1 = Sale / Debit transaction 2 = Top Up 3 = Refund

Responses

  • 200
    Hide response attributes Show response attributes object
    • message string
    • timestamp integer
    • data object
      Hide data attributes Show data attributes object
      • result integer
      • resultDesc string
      • remainToPay number
      • cardBalance number
  • 400

    A bad request could be returned for a variety of reasons and typically because of invalid data being presented.

    400 Bad Request responses will be accompanied with a "message" value in the response body to help diagnose the issue.

    Hide response attributes Show response attributes object
    • message string
    • timestamp integer
POST /transaction
curl \
 -X POST https://api.gift-stream.com/transaction \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NzA0MTU0ODgsImlzcyI6ImFwaS5naWZ0Y2FyZC5hcHBkZWxpdmVyYW5jZS5jb20iLCJuYmYiOjE2NzA0MTU0ODgsInVzZXJOYW1lIjoiY2hyaXNAaWlzOS5jby51ayIsImNsaWVudElkIjoiMiIsInRva2VuLXR5cGUiOiJSRUZSRVNIIn0.fCiB66HaX5EaM-2t43I_Kvg7W0Jsp6OLQ2HiUZV3kjTilLzfbKN23Ql_sz1OtiysaHIlLV31ORxfBXWOKDLsGw" \
 -d 'allowPartialAuth=1&currencyCode=826&identifier=hiRBkrv6ClU3PkZkuKXK61NWg1p51OVr&siteId=10&transactionTotal=12.34&transactionType=1'
Request example
# Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NzA0MTU0ODgsImlzcyI6ImFwaS5naWZ0Y2FyZC5hcHBkZWxpdmVyYW5jZS5jb20iLCJuYmYiOjE2NzA0MTU0ODgsInVzZXJOYW1lIjoiY2hyaXNAaWlzOS5jby51ayIsImNsaWVudElkIjoiMiIsInRva2VuLXR5cGUiOiJSRUZSRVNIIn0.fCiB66HaX5EaM-2t43I_Kvg7W0Jsp6OLQ2HiUZV3kjTilLzfbKN23Ql_sz1OtiysaHIlLV31ORxfBXWOKDLsGw

# Payload
{
  "allowPartialAuth": "1",
  "currencyCode": "826",
  "identifier": "hiRBkrv6ClU3PkZkuKXK61NWg1p51OVr",
  "siteId": "10",
  "transactionTotal": 12.34,
  "transactionType": "1"
}
Request examples
# Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NzA0MTU0ODgsImlzcyI6ImFwaS5naWZ0Y2FyZC5hcHBkZWxpdmVyYW5jZS5jb20iLCJuYmYiOjE2NzA0MTU0ODgsInVzZXJOYW1lIjoiY2hyaXNAaWlzOS5jby51ayIsImNsaWVudElkIjoiMiIsInRva2VuLXR5cGUiOiJSRUZSRVNIIn0.fCiB66HaX5EaM-2t43I_Kvg7W0Jsp6OLQ2HiUZV3kjTilLzfbKN23Ql_sz1OtiysaHIlLV31ORxfBXWOKDLsGw

# Payload
{
  "allowPartialAuth": "1",
  "currencyCode": "826",
  "identifier": "hiRBkrv6ClU3PkZkuKXK61NWg1p51OVr",
  "siteId": "10",
  "transactionTotal": 12.34,
  "transactionType": "1"
}
Response examples (200)
{
  "message": "OK",
  "timestamp": 1670952423,
  "data": {
    "result": "5",
    "resultDesc": "DECLINED - Insufficient Funds.",
    "remainToPay": "30",
    "cardBalance": "0.00"
  }
}
{
  "message": "OK",
  "timestamp": 1671029179,
  "data": {
    "result": 0,
    "resultDesc": "AUTHORISED",
    "remainToPay": 0,
    "cardBalance": 100
  }
}
{
  "message": "OK",
  "timestamp": 1671029356,
  "data": {
    "result": 1,
    "resultDesc": "PARTIAL_APPROVAL",
    "remainToPay": 5,
    "cardBalance": 0
  }
}
Response examples (200)
{
  "message": "string",
  "timestamp": 42,
  "data": {
    "result": 42,
    "resultDesc": "string",
    "remainToPay": 42.0,
    "cardBalance": 42.0
  }
}
Response examples (400)
{
  "message": "Data Invalid: Required fields missing from request",
  "timestamp": 1671029563
}
Response examples (400)
{
  "message": "string",
  "timestamp": 42
}