Refund Transaction

With the refund API you can issue a refund to customer. The payment is immediately refunded to the payment method associated with Transaction.

There are 2 types of refunds, you can perform full refund or a partial refund.

  • a full refund - the whole amount of Transaction will be refunded, or
  • a partial refund - only a certain part of the amount is refunded.

Note

  • Only paid transactions with status ‘Success’ can be refunded.
  • Refund can be issued, even if the settlement is still pending.
  • Your settlement account will be debited to fulfill the refund.
  • Refund can fail if your settlement account has insufficient funds to fulfill the refund.
  • Partial refunds can be initiated multiple time until total paid amout is refunded.
  • Refund APIs requires different API keys for RSA encryption and are provided upon request.

API ENDPOINTS

Testing url:

https://checkout-sandbox.payway.com.kh/api/merchant-portal/merchant-access/online-transaction/refund

Production url:

https://checkout.payway.com.kh/api/merchant-portal/merchant-access/online-transaction/refund

Method: POST

Response Parameter Description

# Field name Data type Remark Example
1 request_time
mandatory
Timestamp [UTC] Format YYYYmmddHis 20210123234559
2 merchant_id
mandatory
String [20] Merchant id provided by PayWay integration teams onlinesshop24
3 merchant_auth
mandatory
Text

{"mc_id":"ec000002","tran_id":"00002894", "refund_amount":"0.01"}

RSA.PUBLIC(merchant_id, tran_id, refund_amount)

(Encrypt using the public key)

884113079983ac7b7d18f69bd11ec72c3e460be35f2a32650b607ad6e9
4 hash
mandatory
Text Encrypted with Api Keys sha512(request_time + merchant_id + merchant_auth)API_Keys 3nd/2Z4g45Paoqx06QA3UQeHRC2Ts37zjudG7DqyyU2FMYqwtEsXkaEmNOSiFh6Y+IHRdwnA2WA/M/Qg==

Note:

Please calculate merchant_auth

Example Request

  • 
            {
              "request_time":"20210922050705",
              "merchant_id":"ec000002",
              "merchant_auth":"9aaa43e6929a75208cdb29ab498d9604600101d8dc00-20201019130940"
              "hash":"EVDFA2118UD0boKhkAcObrmRIU263x3pwIltgxEI6JfhLmpE/X+5KIGNiG8tIQU64pOtvtfbMa2b5q9CCt+sWw=="
            }
          

Example Response

  • 
            {
              "grand_total":"1.5",
              "total_refunded":"0.09"
              "currency":"USD"
              "transaction_status": "REFUNDED",
              "status": {
                "code": "00",
                "message": "Success!"
              }
            }
          

Response Parameter Description

# Field name Data type Remark Example
1 grand_total Double
2 total_refunded Double
3 currency String
4 transaction_status String
5 status Array
5.5 code String
5.5 message String