Skip to content

Create Refund

Request Method and Path

POST /payin/v1/createRefund

Request Headers

Field NameTypeRequiredDescription
content-typestringYesapplication/json
x-api-keystringYesProvided by Paydify, same as appId
x-api-timestampstringYesTimestamp in milliseconds
x-api-signaturestringYesSignature, see Signature Algorithm

Request Body

Field NameTypeRequiredDescription
mchTxnIdstring(60)YesMerchant order ID
paymentTxnIdstring(30)YesPayment order ID
txnHashstring(120)YesBlockchain transaction hash
mchExtInfostring(512)NoMerchant extension information, JSON string

Response Headers

Field NameTypeRequiredDescription
x-api-keystringYesProvided by Paydify, same as appId
x-api-timestampstringYesTimestamp in milliseconds
x-api-signaturestringYesSignature, see Signature Algorithm

Response

Field NameTypeDescription
codestringResponse code, SYS_SUCCESS indicates success
messagestringResponse message
messageDetailstringDetailed response message
successbooleanWhether the request was successful
data.refundTxnIdstringPaydify refund order ID
data.paymentTxnIdstringAssociated payment order ID
data.statestringRefund status, enum values see Refund Status
data.errorMsgstringRefund failure reason description

Example

shell
# Request

# Successful response
{
  "code": "SYS_SUCCESS",
  "message": null,
  "messageDetail": null,
  "data": {
    "refundTxnId": "2209141130105863014",
    "paymentTxnId": "2209141130105863014",
    "state": "pending",
    "errorMsg": "xxx"
  },
  "success": true
}

# Failed response
{
  "code": "SYS_ERROR",
  "message": "System error",
  "messageDetail": "Error details",
  "data": null,
  "success": false
}
# Request

# Successful response
{
  "code": "SYS_SUCCESS",
  "message": null,
  "messageDetail": null,
  "data": {
    "refundTxnId": "2209141130105863014",
    "paymentTxnId": "2209141130105863014",
    "state": "pending",
    "errorMsg": "xxx"
  },
  "success": true
}

# Failed response
{
  "code": "SYS_ERROR",
  "message": "System error",
  "messageDetail": "Error details",
  "data": null,
  "success": false
}