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.
Body
Please pay attention to the required + acceptable values as well as the data types.
-
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.
-
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)
-
The unique identifier of the giftcard to be debited.
-
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
-
Minimum value is
0.01, maximum value is99999.99. -
1 = Sale / Debit transaction 2 = Top Up 3 = Refund
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¤cyCode=826&identifier=hiRBkrv6ClU3PkZkuKXK61NWg1p51OVr&siteId=10&transactionTotal=12.34&transactionType=1'
# Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NzA0MTU0ODgsImlzcyI6ImFwaS5naWZ0Y2FyZC5hcHBkZWxpdmVyYW5jZS5jb20iLCJuYmYiOjE2NzA0MTU0ODgsInVzZXJOYW1lIjoiY2hyaXNAaWlzOS5jby51ayIsImNsaWVudElkIjoiMiIsInRva2VuLXR5cGUiOiJSRUZSRVNIIn0.fCiB66HaX5EaM-2t43I_Kvg7W0Jsp6OLQ2HiUZV3kjTilLzfbKN23Ql_sz1OtiysaHIlLV31ORxfBXWOKDLsGw
# Payload
{
"allowPartialAuth": "1",
"currencyCode": "826",
"identifier": "hiRBkrv6ClU3PkZkuKXK61NWg1p51OVr",
"siteId": "10",
"transactionTotal": 12.34,
"transactionType": "1"
}
# Headers
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NzA0MTU0ODgsImlzcyI6ImFwaS5naWZ0Y2FyZC5hcHBkZWxpdmVyYW5jZS5jb20iLCJuYmYiOjE2NzA0MTU0ODgsInVzZXJOYW1lIjoiY2hyaXNAaWlzOS5jby51ayIsImNsaWVudElkIjoiMiIsInRva2VuLXR5cGUiOiJSRUZSRVNIIn0.fCiB66HaX5EaM-2t43I_Kvg7W0Jsp6OLQ2HiUZV3kjTilLzfbKN23Ql_sz1OtiysaHIlLV31ORxfBXWOKDLsGw
# Payload
{
"allowPartialAuth": "1",
"currencyCode": "826",
"identifier": "hiRBkrv6ClU3PkZkuKXK61NWg1p51OVr",
"siteId": "10",
"transactionTotal": 12.34,
"transactionType": "1"
}
{
"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
}
}
{
"message": "string",
"timestamp": 42,
"data": {
"result": 42,
"resultDesc": "string",
"remainToPay": 42.0,
"cardBalance": 42.0
}
}
{
"message": "Data Invalid: Required fields missing from request",
"timestamp": 1671029563
}
{
"message": "string",
"timestamp": 42
}