Refund Result Callback
This API must be called on the server side. Never call it directly from the frontend (APP client, web page, mini game, etc.) to avoid the risk of credential leakage.
API Description
API English name pay.refundNotify
Description When refund processing completes (succeeded or failed), the APP server calls this API to sync the refund result to SUD.
Note: This API requires secondary encryption and signing of server-to-server communication: request parameters must be encrypted and signed, and responses must be signature-verified and decrypted. This effectively prevents data tampering and leakage.
Call Method
HTTPS Call
POST /v1/pay/refund/notify?access_token=ACCESS_TOKENPrepend the base URL for your application's service region to the API path. See Service Regions and API Addresses.
Request Parameters - Query
| Field | Type | Default | Required | Description |
|---|---|---|---|---|
| access_token | string | Yes | API call credential |
Request Parameters - Body
| Field | Type | Default | Required | Description |
|---|---|---|---|---|
| env | number | Yes | Environment configuration 0-production environment, 1-test environment | |
| refund_id | string | Yes | [Refund number] The unique identifier generated on the payment side for this refund order when the refund request is accepted successfully | |
| sud_refund_no | string | Yes | SUD refund number | |
| sud_trade_no | string | Yes | SUD business order number | |
| status | string | Yes | Refund order status, enum: REFUNDED-refund succeeded, REFUND_FAIL-refund failed. Only terminal states need to be reported; the in-progress state (REFUNDING) does not. This field represents the refund order's own status |
Return Value
The returned JSON data packet
| Field | Type | Description |
|---|---|---|
| errcode | int32 | Error code |
| errmsg | string | Error message |
Call Example
Note: The request example below shows the business data before encryption; what is actually sent is the ciphertext with signature headers, and the response example shows the business data after signature verification and decryption. See Server API Signature and Encryption for the packaging and signing rules.
Request Data Example
{
"env": 0,
"refund_id": "50300123420231024567890",
"sud_refund_no": "sud_refund_20231024123456",
"sud_trade_no": "sud_20231024123456",
"status": "REFUNDED"
}Response Data Example
{
"errcode": 0,
"errmsg": "ok"
}