Transaction History API


Description

This API is used to fetch card level transactions.
Method: POST

URL/Path: baseurl/rest/v3/order/{id}/cards/?offset={offset}&limit={limit}

E.g.: extapi12.budgetree .in/rest/v3/order/id/cards/?offset=offset&limit=limit

Request Body

                {
                    "startDate": "2019-01-24T15:59:59Z", (iso format)
                    "endDate": "2020-10-19T20:59:59Z", (iso format)
                    "limit": 7,  (2-byte integer)
                    "offset": 5, (2-byte integer)
                    "cards": [{
                        "cardNumber": "9999998880016217", (50)
                        "pin": "321721" (25)
                    }]
                }
                                
             

Request Parameters

Field Name Mandatory Data Type Length Description
startDate No DateTime DateTime (ISO Format) Iso-8601, Make use of merchant timezone here
endDate No DateTime DateTime (ISO Format) Iso-8601, Make use of merchant timezone here
limit No int 2-byte integer Set the number of transactions to be retrieved
offset No int 2-byte integer Iso-8601, Make use of merchant timezone here
cards Yes Json Card list
cardNumber Yes string String, max 50
pin Yes string String, max 25

Sample Response

NOTE: The sample contains information on the length of the parameters


                    {
                        "code": 0, (255) string
                        "message": "Successfully fetched transaction history",(255) string
                        "messages": [],(255) string
                        "refno": "",
                         "store": 1,(10) int
                        "cards": [
                            {
                                "cardNumber": "9999998880016217",(50) string
                                "currencyNumericCode": "356",(3) string
                                "balance": 0,(22,4) decimal
                                "status": "Created",(20) string
                                 "activationDate": "2020-10-13T03:54:35Z",(isoformat)
                                "Transactions": [
                                    {
                                        "type": "GIFT CARD CANCEL ACTIVATE",(100) string
                                        "amount": 200,(22,4) decimal
                                        "balance": 0,(22,4) decimal
                                        "status": "SUCCESS",(20) string
                                        "currencyNumericCode": "356",(3) string
                                        "outletName": "GB-CORP-OUTLET-01",(50) string
                                        "date": "2020-10-19T09:50:25Z",(iso-format)
                                        "notes": "test cancel",(4000) string
                                        "additionalTxnFields": {
                                            "AdjustmentAmount": 0,(22,4) decimal
                                            "ApprovalCode": "1269324",(12) string
                                            "BatchNumber": 10187995,(4-byte integer)
                                            "BusinessReferenceNumber": null,(50) string
                                            "CurrencyCode": "INR",(3) string
                                            "CurrencySymbol": "₹",(25) string
                                            "ErrorCode": null,(25) string
                                            "ExtendedParameters": null,(json object)
                                            "Loyalty": 0,(22,4) decimal
                                            "OutletCode": null,(50) string
                                            "PGReferenceNumber": null,(50) string
                                            "ResponseCode": 0,(4-byte integer)
                                            "ResponseMessage": "Transaction successful.",(256) string
                                            "TransactionId": 9374614677 (4-byte integer)
                                        }
                                    },
                                    { // second node
                                        "type": "GIFT CARD ACTIVATE",
                                        "amount": 200,
                                        "balance": 200,
                                        "status": "CANCELLED",
                                        "currencyNumericCode": "356",
                                        "outletName": "GB-CORP-OUTLET-01",
                                        "invoiceNumber": "abcd12345",
                                        "date": "2020-10-13T03:54:34Z",
                                        "notes": "test aravind",
                                        "additionalTxnFields": {
                                            "AdjustmentAmount": 0,
                                            "ApprovalCode": "1267727",
                                            "BatchNumber": 10187857,
                                            "BusinessReferenceNumber": null,
                                            "CurrencyCode": "INR",
                                            "CurrencySymbol": "₹",
                                            "ErrorCode": null,
                                            "ExtendedParameters": null,
                                            "Loyalty": 0,
                                            "OutletCode": null,
                                            "PGReferenceNumber": null,
                                            "ResponseCode": 0,
                                            "ResponseMessage": "Transaction successful.",
                                            "TransactionId": 1
                                        }
                                    }
                                ]
                            }
                        ],
                        "provider": {
                            "code": "0",(255)
                            "message": "Transaction successful."(255)
                        }
                    }
                                
             

Response Parameters

Success

Field Name Mandatory Data Type Description Example
code Yes string
message Yes string
messages Yes Json array
refno Yes string
notes No string
store Yes int
cards Yes Json array List of cards along with card and transaction details
currencyNumericCode Yes string
status Yes string Card status
activationDate Yes string ISO format
expiry No string ISO format
balance No decimal(22,4) Card current balance
transactions Yes Json array List of transactions
type Yes string Transaction type
outletName Yes string
amount Yes decimal(22,4)
invoiceNumber Yes string
date Yes string ISO format
notes Yes string
balance Yes decimal(22,4) Balance after transaction
status Yes string Card status after transaction
currencyNumericCode Yes string
additionalTxnFields No string
provider Yes string
code Yes string Provider level transaction code
message No string Provider level transaction message

Failure

Field Name Mandatory Data Type Description Example
code Yes string
message Yes string
messages Yes Json array

Generic failures samples


            {
                "code": " 5141",
                "message": "Transaction history failed,
                "messages": "[]"
              }
              {
                "code": " 6053",
                "message": "Could not process your request. Please try again later",
                "messages": "[]"
              }         
             

Card pin empty config error


            {
                "code": " 5140",
                "message": "Card pin should not be empty",
                "messages": "[]"
              }        
             

Last updated on: