Skip to content

Create Refund

Request Method and Request Path

POST /payment/payin/v1/createRefund

Request Header

FieldData TypeMandatoryDescription
content-typestringYesHard code with application/json
x-api-keystringYesProvided by Paydify, equals to appId
x-api-timestampstringYesCurrent timestamp with millisecond
x-api-signaturestringYesSee Signature Mechanism

Request Body

FieldData TypeMandatoryDescription
appIdstring(20)YesMerchant app ID, Provided by Paydify
paymentTxnIdstring(30)YesPayment unique order ID
mchTxnIdstring(60)YesMerchant unique order ID
txnHashstring(120)YesTransaction hash on-chain
mchExtInfostring(512)NoAdditional extended information, JSON string

Response Header

FieldData TypeMandatoryDescription
x-api-keystringYesProvided by Paydify, equals to appId
x-api-timestampstringYesCurrent timestamp with millisecond
x-api-signaturestringYesSee Signature Mechanism

Response Body

FieldData TypeDescription
statusintError status, 0 indicates success, non-0 indicates failure, see Error Status
msgstringError description
data.txnIdstringRefund unique order ID generated by Paydify
data.mchTxnIdstringMerchant refund order ID
data.statestringRefund status, see Refund Status
data.errorMsgstringReason of failure

Example

shell
# CURL

# Response Example of Success
{
  "status": 0,
  "msg": "success",
  "data": {
    "refundTxnId": "2209141130105863014",
    "paymentTxnId": "2209141130105863014",
    "state": "pending",
    "errorMsg": "xxx"
  }
}

# Response Example of Failure
{
  "status": 9999,
  "msg": "system error",
  "data": null
}
# CURL

# Response Example of Success
{
  "status": 0,
  "msg": "success",
  "data": {
    "refundTxnId": "2209141130105863014",
    "paymentTxnId": "2209141130105863014",
    "state": "pending",
    "errorMsg": "xxx"
  }
}

# Response Example of Failure
{
  "status": 9999,
  "msg": "system error",
  "data": null
}