For more customizations, merchants can pass to the Transaction API request their own "user-defined fields" up to 9 fields and accordingly, they would receive those fields in the callback response.


In this article you will be going to know about:


Sample Request Payload

The following is a sample request using transaction API and including user-defined fields


{
  "profile_id": "profile_id",
  "tran_type": "sale",
  "tran_class": "ecom",
  "cart_id": "cart_11111",
  "cart_currency": "USD",
  "cart_amount": 200,
  "cart_description": "Description of the items/services",
  "return": "https://webhook.site/4b3af623-085f-4b82-ab22-cb6cedeba218",
  "callback": "https://webhook.site/4b3af623-085f-4b82-ab22-cb6cedeba218",
  "user_defined": {
    "udf1": "UDF1 Test1",
    "udf2": "UDF2 Test2",
    "udf3": "UDF3 Test3",
    "udf4": "UDF4 Test4",
    "udf5": "UDF5 Test5",
    "udf6": "UDF6 Test6",
    "udf7": "UDF7 Test7",
    "udf8": "UDF8 Test8",
    "udf9": "UDF9 Test9"
  }
}

Sample Response Payload (Callback)


{
  "tran_ref": "TST2111000149148",
  "merchant_id": 3469,
  "profile_id": 65945,
  "cart_id": "cart_11111",
  "cart_description": "Description of the items/services",
  "cart_currency": "USD",
  "cart_amount": "200.00",
  "tran_currency": "USD",
  "tran_total": "200.00",
  "tran_type": "Sale",
  "tran_class": "ECom",
  "customer_details": {
    "name": "first last",
    "email": "[email protected]",
    "phone": "0522222222",
    "street1": "address street",
    "city": "dubai",
    "state": "DU",
    "country": "AE",
    "ip": "196.219.145.121"
  },
  "payment_result": {
    "response_status": "A",
    "response_code": "G08429",
    "response_message": "Authorised",
    "cvv_result": " ",
    "avs_result": " ",
    "transaction_time": "2021-04-20T08:47:09Z"
  },
  "payment_info": {
    "payment_method": "Visa",
    "card_type": "Credit",
    "card_scheme": "Visa",
    "payment_description": "4111 11## #### 1111",
    "expiryMonth": 11,
    "expiryYear": 2023,
    "IssuerCountry": "",
    "IssuerName": ""
  },
  "user_defined": {
    "udf1": "UDF1 Test1",
    "udf2": "UDF2 Test2",
    "udf3": "UDF3 Test3",
    "udf4": "UDF4 Test4",
    "udf5": "UDF5 Test5",
    "udf6": "UDF6 Test6",
    "udf7": "UDF7 Test7",
    "udf8": "UDF8 Test8",
    "udf9": "UDF9 Test9"
  }
}