Refund
For a period after a payment transaction has been completed and a refund is required by either the Payer or Merchant, the Merchant can refund the Payer via this API. After the YabandPay receives and verifies the refund request successfully, the Payer will be refunded with the request refund amount (less than or equal to the original payment amount) according to the refund rules.
[!TIP|style:flat] 注意:
For any transaction completed more than one year prior, a refund is not supported;
A refund for a transaction can be processed in the form of multiple partial refunds. In this case, the original order number is required . The total refund amount cannot exceed the original payment amount.
Partial refund for one order should be less than 30 times.
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
Parameter | Type | Description | Required |
---|---|---|---|
user | String | the UID of cashier account | Required |
sign | String | signature | Required |
method | String | v3.CreateRefund | Required |
time | Long | timestamp | Required |
- Parameter
Parameter | Type | Description | Required |
---|---|---|---|
trade_id | String | the trade_id from YabandPay | Required |
m_refund_id | String | merchant reference refund number | Optional |
refund_amount | String | merchant-defined refund amount, For example1.99 | Required |
refund_currency | String | Currency code, ISO 4217, e.g., EUR, CHF. It must be the same as the currency of the original transaction order. | Required |
refund_description | String | refund description | Required |
notify_url | String | asynchronous notification url | Optional |
Signature:
Lexicographical sequence and URL key-value format new string
"m_refund_id=20240304094405131317&method=v3.CreateRefund¬ify_url=https://www.yabandpay.com&refund_amount=0.1&refund_currency=EUR&refund_description=test&time=1546588959&trade_id=5feb401d-d9a4-776f-211f-882b60f14d9d&user=016683"
Use stringA and secret_key to get stringSign
Get Signature:
"5050194672112e5c720f6d4265f30b001f5bab11b24c2675b56056915f92a608"
Example Request:
{
"user": "016683",
"sign": "5050194672112e5c720f6d4265f30b001f5bab11b24c2675b56056915f92a608",
"method": "v3.CreateRefund",
"time": 1546588959,
"data": {
"trade_id": "5feb401d-d9a4-776f-211f-882b60f14d9d",
"m_refund_id": "20240304094405131317",
"refund_amount": "0.1",
"refund_currency": "EUR",
"refund_description": "test",
"notify_url": "https://www.yabandpay.com/notify"
}
}
Example Response:
{
"status": true,
"code": "200",
"data": {
"trade_id": "5feb401d-d9a4-776f-211f-882b60f14d9d",
"refund_id": "3841510a-4d18-4a61-808d-431a45006de2",
"m_refund_id": "20240304094405131317",
"refund_amount": "0.10",
"refund_currency": "EUR",
"state": "refund processing"
},
"message": ""
}
More Information:
Return results:
On a successful API call, the response will be
"status": true
.On a failed API call, the response will be
"status": false
.
Please note: Refunds are processed asynchronously. When the response returns "status": true
, it indicates that the submission was successful. After successful submission, we strongly recommend using both Order Query and Asynchronous Notification simultaneously to synchronize and update refund status, ensuring real-time accuracy of payment information.
Refund status:
Code | State | Description |
---|---|---|
20 | to-be-approval | Waiting for admin approval. |
21 | refund pending | The current balance is insufficient. It will be automatically submitted when the balance is sufficient. |
22 | refund processing | Refund has been submitted. |
23 | refunded | Refund successfully. |
24 | refund failed | Refund failed, please try again. |
25 | refund error | Please contact our staff. |
26 | refund cancelled | The refund order has been cancelled. |