Skip to main content

Refund Order

Refund order API used for Marchant/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.
prepayIdstringY-The unique ID assigned by Binance for the original order to be refunded.
refundAmountdecimalY-The refund amount that is initiated by the merchant.
refundReasonstringNmaximum length 256

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
dataRefundResultY-response body, refer to
errorMessagestringY-

Child Attribute#

RefundResult#

AttributesTypeRequiredLimitationDescription
refundRequestIdstringYmaximum length 64The unique ID assigned by the merchant to identify a refund request.
prepayIdstringY-The unique ID assigned by Binance for the original order to be refunded.
orderAmountdecimalYminimum unit: 0.01, minimum equivalent value: 0.5 USDThe total amount of prepay order.
refundedAmountstringY-The total refunded amount included this refund request.
refundAmountstringY-The refund amount of this refund request.
remainingAttemptsstringY-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.
payerOpenIdstringY-The 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
UNKNOW_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.
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
INVALID_PREPAY_ID400301Invalid prepayId
TOO_MANY_REFUND_ATTEMPTS400302refund attempts more than 10 times
INVALID_REFUND_AMOUNT400303refund amount is grater than remaining amount
this order has been fullly refuned already
ACCOUNT_REMENING_AMOUNT_NOT_ENOUGH400304the merchant account remening amount is not enough to do refund