# 1.1 Refund

# Request URL

  • {domain}/open-api/payment/refund

# Request Method

  • POST

# Request Header

Parameter Name Required Type Description
Content-Type Y string application/json

# Request Body Param

Parameter Name Required Type Description
appId Y string Application Id
param Y string param
sign Y string signature

# param

Parameter Name Required Type Length Example Description
mchRefundOrderId Y string 1-32 1677495496979 Merchant refund order id (unique for customer) format: letter + num, 1-32 characters: CCP20220428011068111
originalTransactionId Y string 1-32 CCP20220428011068111 Original transaction id
refundAmount Y Long - - Refund amount (Unit is in cents)
refundReason N string 1-200 - Refund reason
refundCallbackUrl Y string 1-256 - Refund callback URL
timestamp Y long - 1677495496979 timestamp

# Request Example

# Request Body

{
  "appId": "733b887a4a784708bb369524db5b6ded",
  "sign": "A5Vd8NcQvU3QT41Yee2jCIK58jDAKZ6kP5gEE4q7Yu92hUCY3k00FKTSlCNU+CcZm0LSrGbEMFMID3p7uvXaqy5khNv3kPndrgp7MIRHUmQnMgRK+g1XG7PzWdnrqlXc3g+L+kqVja+qrFRz+uVS6GLKLR1P4AtgTa9dok6NU7YTWOnG9r/FwIVx/At4czfEpI10pvg2TptVpiANmseGmz4G30hkaYTTNahkcOMQJn6PDFjivHvjNLZNJVOqHQzVUa+kca1yZZMPHtgxR647KjoY2oAjjl0Y45GL6zP9qHD/eVwcPPAPrRZ4K2o05OJnPf67fAcWNVqpnu6ZGQIXhQ==",
  "param": "{\"originalTransactionId\":\"CU518563189147832780\",\"mchRefundOrderId\":\"refund488455057142\",\"refundAmount\":10000,\"refundReason\":\"testRefund\",\"refundCallbackUrl\":\"http://www.test.com\",\"timestamp\":1722415059}"
}

How to construct request body


# Response Param

Parameter Name Type Description
code integer response code
message string response message
data Object data

# data

Parameter Name Type Description
mchRefundOrderId string Merchant refund order id (unique for customer)
refundTransactionId string Platform refund transaction id
refundCreateTime string Refund create time
refundAmount Long Refund amount (Unit is in cents)
refundStatus string Refund status

# Response Example

{
  "code": 10000,
  "message": "Success",
  "data": {
    "mchRefundOrderId": "refund488455057142",
    "refundTransactionId": "1818566685947728",
    "refundCreateTime": "2024-07-31 16:37:40",
    "refundAmount": 10000,
    "refundStatus": "PENDING"
  }
}

Code Collection

# Failed Response Example

{
  "code": 21016,
  "message": "Merchant ip forbidden"
}