Once you did initiate your transactions successfully on your account, you will still have a connection to it. With the already existing transactions in your account, you can perform a number of operations/actions on them like Query, Refund, Void, Capture, etc…



In this article you will be going to know about:



Postman Endpoint Collection


For the purposes of this article, you will need to use the following postman endpoints collection for testing and integrating, for proceeding with this please click here.


Query Transaction


If you have a transaction that you want to fetch its details, to know more about its status, type, etc.. you can use this endpoint as it will return the details of the requested transaction


Sample Request Payload

Post

{{domain}}/payment/query


{
  "profile_id": "profile_id",
  "tran_ref": "SFT2010820000692"
}

Sample Response Payload

{
  "tran_ref": "SFT2105330091090",
  "tran_type": "Sale",
  "cart_id": "Sample Payment",
  "cart_description": "Sample Payment",
  "cart_currency": "SAR",
  "cart_amount": "1",
  "customer_details": {
    "name": "First Name",
    "email": "email@domain.com",
    "phone": "05005279032",
    "street1": "str1",
    "city": "riyadh",
    "state": "riyadh",
    "country": "SA",
    "ip": "10.0.0.1"
  },
  "payment_result": {
    "response_status": "A",
    "response_code": "G15046",
    "response_message": "Authorised",
    "transaction_time": "2022-07-12T12:24:06Z"
  },
  "payment_info": {
    "card_type": "Credit",
    "card_scheme": "Visa",
    "payment_description": "4111 11## #### 1111"
  }
}

Refund Transaction

Refund request is available for those Authenticated Sale transactions or Authenticated Capture transactions. In which the tran_type should be “refund” and the requested transaction id to be refunded should be passed to tran_ref parameter in the request.


A new transaction (with new refernce) with type refund will be created for the refund process and will be linked to the original sale/capture transaction.


Sample Request Payload

Post{{domain}}/payment/request


{
  "profile_id": "profile_id",
  "tran_type": "refund",
  "tran_ref": "SFT2111000149148",
  "tran_class": "ecom",
  "cart_id": "cart_1234",
  "cart_currency": "SAR",
  "cart_amount": 10,
  "cart_description": "Refund reason"
}


Sample Response Payload (Successful Refund)

{
  "tran_ref": "SFT2111100150559",
  "tran_type": "Refund",
  "cart_id": "cart_1234",
  "cart_description": "Refund reason",
  "cart_currency": "SAR",
  "cart_amount": "10.00",
  "customer_details": {
    "name": "first name last name",
    "email": "address@email.com",
    "phone": "0500000000",
    "street1": "address street",
    "city": "riyadh",
    "state": "riyadh",
    "country": "SA",
    "ip": "10.0.0.10"
  },
  "payment_result": {
    "response_status": "A",
    "response_code": "G97111",
    "response_message": "Authorised",
    "transaction_time": "2022-09-21T09:25:11Z"
  },
  "payment_info": {
    "card_type": "Credit",
    "card_scheme": "Visa",
    "payment_description": "4111 11## #### 1111"
  }
}

Sample Response Payload (Failed Refund)


{
  "tran_ref": "SFT2111100150570",
  "tran_type": "Refund",
  "cart_id": "cart_1234",
  "cart_description": "Refund reason",
  "cart_currency": "SAR",
  "cart_amount": "10.00",
  "customer_details": {
    "name": "first name last name",
    "email": "address@email.com",
    "phone": "0500000000",
    "street1": "address street",
    "city": "riyadh",
    "state": "riyadh",
    "country": "SA",
    "ip": "10.0.0.10"
  },
  "payment_result": {
    "response_status": "D",
    "response_code": "320",
    "response_message": "Unable to refund",
    "transaction_time": "2022-09-21T09:33:54Z"
  },
  "payment_info": {
    "card_type": "Credit",
    "card_scheme": "Visa",
    "payment_description": "4111 11## #### 1111"
  }
}

Capture Transaction

Capture request is available for successfully Authenticated Authorize transactions, to process a capture request tran_type should be “capture” and the transaction id of the original Authorize transaction that you want to capture should be passed in the tran_ref parameter.


Sample Request Payload

Post{{domain}}/payment/request


{
  "profile_id": "profile_id",
  "tran_class": "ecom",
  "tran_type": "capture",
  "tran_ref": "SFT2111100150565",
  "cart_id": "cart_1234",
  "cart_currency": "SAR",
  "cart_amount": 200,
  "cart_description": "Description of the items/services",
  "callback": ""
}

Sample Response Payload

{
  "tran_ref": "SFT2111100150569",
  "tran_type": "Capture",
  "cart_id": "cart_1234",
  "cart_description": "Description of the items/services",
  "cart_currency": "SAR",
  "cart_amount": "200.00",
  "callback": "https://webhook.site",
  "customer_details": {
    "name": "first name last name",
    "email": "address@email.com",
    "phone": "0500000000",
    "street1": "address street",
    "city": "riyadh",
    "state": "riyadh",
    "country": "SA",
    "ip": "10.0.0.10"
  },
  "payment_result": {
    "response_status": "A",
    "response_code": "G97564",
    "response_message": "Authorised",
    "transaction_time": "2022-09-21T09:32:44Z"
  },
  "payment_info": {
    "card_type": "Credit",
    "card_scheme": "Visa",
    "payment_description": "4111 11## #### 1111"
  }
}


Void Transaction


Void requests are available for Authenticated Authorize transactions that are not fully captured yet. To process a void request tran_type should be “void” and the transaction id of the original Authorize transaction that you want to capture should be passed in the tran_ref parameter.


Sample Request Payload

Post{{domain}}/payment/request


{
  "profile_id": "profile_id",
  "tran_class": "ecom",
  "tran_type": "void",
  "tran_ref": "SFT2111100150606",
  "cart_id": "cart_1234",
  "cart_currency": "SAR",
  "cart_amount": 100,
  "cart_description": "Void reason"
}

Sample Response Payload


{
  "tran_ref": "SFT2111100150608",
  "tran_type": "Void",
  "cart_id": "cart_1234",
  "cart_description": "Void reason",
  "cart_currency": "SAR",
  "cart_amount": "100.00",
  "customer_details": {
    "name": "first name last name",
    "email": "address@email.com",
    "phone": "0500000000",
    "street1": "address street",
    "city": "riyadh",
    "state": "riyadh",
    "country": "SA",
    "ip": "10.0.0.1"
  },
  "payment_result": {
    "response_status": "A",
    "response_code": "G98948",
    "response_message": "Authorised",
    "transaction_time": "2022-09-21T09:55:48Z"
  },
  "payment_info": {
    "card_type": "Credit",
    "card_scheme": "Visa",
    "payment_description": "4111 11## #### 1111"
  }
}