Skip to main content

Refund Order

Refund order API used for Merchant/Partner to refund for a successful payment.

EndPoint

POST /binancepay/openapi/order/refund

Request Parameters

AttributesTypeRequiredLimitationDescription
refundRequestIdstringYmaximum length 64The unique ID assigned by the merchant to identify a refund request.The value must be same for one refund request.
prepayIdstringYmaximum length 19The unique ID assigned by Binance for the original order to be refunded.
refundAmountdecimalYlimitation refer to Create Order API order amountYou can perform multiple partial refunds, but their sum should not exceed the order amount.
refundReasonstringNmaximum length 256
webhookUrlstringNmaximum length 256. Can only start with http or https.The URL for refund order notification. If the webhookUrl is passed in the parameter, the webhook url configured on the merchant platform will not take effect, and the currently passed url will be called back first.

Sample Request Body

{
"refundRequestId": "68711039982968832",
"prepayId": "383729303729303",
"refundAmount": 25.17,
"refundReason": ""
}

Response Parameters

AttributesTypeRequiredLimitationDescription
statusstringY"SUCCESS" or "FAIL"status of the API request
codestringY-request result code, refer to
dataRefundResultN-response body, refer to
errorMessagestringNmaximum length 256

Child Attribute

RefundResult

AttributesTypeRequiredLimitationDescription
refundRequestIdstringYmaximum length 64The unique ID assigned by the merchant to identify a refund request.
prepayIdstringYmaximum length 19The unique ID assigned by Binance for the original order to be refunded.
orderAmountstringYlimitation refer to Create Order API order amountThe total amount of prepay order.
refundedAmountstringYlimitation refer to Create Order API order amountThe total refunded amount included this refund request.
refundAmountstringYlimitation refer to Create Order API order amountThe refund amount of this refund request.
remainingAttemptsintY-The remaining attempts of this original order. If this value becomes 1, then your next refund request amount will be ignored. We will refund all the remaing amount of this original order.
payerOpenIdstringYmaximum length 32The payer open id of this refund which is the merchant open id.
duplicateRequeststringY-The flag to mark this request refundRequestId is duplicate or not. It will be 'Y' or 'N'

Response Parameters

{
"status": "SUCCESS",
"code": "000000",
"data": {
"refundRequestId": "68711039982968832",
"prepayId": "383729303729303",
"orderAmount": "100.11",
"refundedAmount": "10.88",
"refundAmount": "5.00",
"remainingAttempts":8,
"payerOpenId":"dde730c2e0ea1f1780cf26343b98fd3b",
"duplicateRequest":"N"
},
"errorMessage": ""
}

Result Code

NameCodeReasonSolution
UNKNOWN_ERROR400000An unknown error occurred while processing the request.Try again later
INVALID_REQUEST400001Parameter format is wrong or parameter transferring doesn't follow the rules.Please check whether the parameters are correct.
INVALID_SIGNATURE400002Incorrect signature resultCheck whether the signature parameter and method comply with signature algorithm requirements.
INVALID_TIMESTAMP400003Timestamp for this request is outside of the time window.Sync server clock
INVALID_API_KEY_OR_IP400004API identity key not found or invalid.Check API identity key
BAD_API_KEY_FMT400005API identity key format invalid.Check API identity key.
BAD_HTTP_METHOD400006Request method not supported.Check Request method.
MEDIA_TYPE_NOT_SUPPORTED400007Media type not supported.Check Request Media type.
INVALID_REQUEST_BODY400008Request body is not a valid json object.Check Request body
MANDATORY_PARAM_EMPTY_OR_MALFORMED400100A parameter was missing/empty/null, or malformed.
INVALID_PARAM_WRONG_LENGTH400101A parameter was not valid, was empty/null, or too long/short, or wrong format.
INVALID_PARAM_WRONG_VALUE400102A parameter was not valid, the value is out of range.
INVALID_PARAM_ILLEGAL_CHAR400103A parameter was not valid, contains illegal characters
INVALID_REQUEST_TOO_LARGE400104Invalid request, content length too large
ORDER_NOT_FOUND400202Order not found.
PAYMENT_ACCOUNT_NOT_FOUND400601account not found
PAYMENT_PAY_ORDER_NOT_FOUND400602pay order not found
PAYMENT_INVALID_PAY_ORDER_EXPIRED400603The pay order is already expired
PAYMENT_TRANSACTION_INVALID_OR_NOT_FOUND400604Transaction not found or invalid
PAYMENT_REFUND_AMOUNT_PRECISION_INVALID400605Refund amount precision is not valid
MERCHANT_REFUND_ACCESS_FORBIDDEN400606Account has no accessibility to this function
PAYMENT_REFUND_TOO_MANY_TIMES400607Refund too many times
PAYMENT_REFUND_AMOUNT_INVALID400608Refund amount is not valid
PAYMENT_LAST_REFUND_AMOUNT_INVALID400609Refund amount is not valid
MERCHANT_REFUND_LIMITATION400610This refund amount is larger than your refund limit please ask admin to approve
PAYMENT_INSUFFICIENT_BALANCE400611Insufficient Balance
PAYMENT_PENDING400612payment in processing