Need help?

Extra data fields in order.json and check order API

Merchants utilizing the order.json API have the option to enhance their requests with additional or personalized data. This can be achieved by appending a custom name:value pair directly to the order.json API call. The "name" in this context is open to any designation, providing flexibility in data representation.

This feature provides substantial utility, empowering merchants to conveniently include supplementary details in their API requests.

The platform's support extends to a maximum of 5 parameters for this purpose. If the number of parameters exceeds this limit during order creation, the system will promptly generate an exception to appropriately address the situation.

Example: Creating an Order using the create order.json API

{
   "method":"create",
   "store":1234,
   "authkey":"mykey1234",
   "order":{
      "cartid":"12324",
      "test":"1",
      "amount":"10.50",
      "currency":"AED",
      "description":"My purchase"
   },
   "return":{
      "authorised":"https://www.mysite.com/authorised",
      "declined":"https://www.mysite.com/declined",
      "cancelled":"https://www.mysite.com/cancelled"
   },
   "customer":{
      "email":"xxx",
      "name":{
         "title":"xxx",
         "forenames":"xxx",
         "surname":"xxx"
      },
      "address":{
         "line1":"xxx",
         "line2":"xxx",
         "line3":"xxx",
         "city":"xxx",
         "state":"xxx",
         "country":"xxx",
         "areacode":"xxx"
      },
      "ref":"xxx"
   },
   "extra":{
      "extra1":"xxx",
      "extra2":"xxx",
      "extra3":"xxx"
   }
}

In the above JSON request, "extra1," "extra2," and "extra3" can be customized with user-defined names.

Upon successfully creating an order, its details can be retrieved using the checkorder API. This API also displays any new extra parameters added during order creation.

Example: Using the checkorder API to Retrieve Order Details
Request:

{

  "method": "check",
  "store": 1234,
  "authkey": "mykey1234",
 "order": {
    "ref": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}

Response:

{
   "method":"check",
   "trace":"4001/359070/64eefb9a",
   "order":{
      "ref":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "cartid":"12324",
      "test":1,
      "amount":"10.50",
      "currency":"AED",
      "description":"Test Transaction",
      "status":{
         "code":3,
         "text":"Paid"
      },
      "transaction":{
         "ref":"xxxxxxxxx",
         "date":"30 Aug 2023 12:17 GST",
         "type":"sale",
         "class":"ECom",
         "status":"A",
         "code":"xxxxxxx",
         "message":"Authorised"
      },
      "paymethod":"Card",
      "card":{
         "type":"Visa Credit",
         "country":"AE",
         "expiry":{
            "month":4,
            "year":2027
         }
      },
      "customer":{
         "email":"[email protected]",
         "name":{
            "forenames":"abc",
            "surname":"xyz"
         },
         "address":{
            "line1":"xxxxxxxxxxxxxxxxxxx",
            "city":"Dubai",
            "country":"AE",
            "mobile":"0525621203"
         }
      },
      "extra":{
         "extra1":"xxx",
         "extra2":"xxx",
         "extra3":"xxx"
      }
   }
}

Feel free to replace "extra1," "extra2," and "extra3" with your preferred custom names when including supplementary data in your API requests.