Skip to main content

Refund Order

Process

Description:

  • Merchant calls the API to refund an order.
  • If Baokim returns error code 116 (Original transaction paid from E-wallet), please call the API again with bank account information to receive the refund.

API Information

Method: POST

URL: /b2b/core/api/ext/mm/refund/send

Request

Main Parameters Table

ParameterTypeRequiredDescriptionExample
request_idStringRequest IDRQID0001
request_timeIntegerRequest time2023-08-18T10:00:00.000Z
master_merchant_codeString (max 50)Master merchant code provided by BaokimBAOKIMMASTERMERCHANT
sub_merchant_codeString (max 50)Sub merchant code provided by BaokimBAOKIMSUBMERCHANT
mrc_order_idStringOrder ID to refundBK_24121706176582
descriptionStringRefund content
amountIntegerAmount to refund if partial refund10000
account_noStringBank account to receive refund (when error code = 116)1903000000000018
bank_noString (max 6)Bank code to receive refund (when error code = 116)970407
installmentObjectInstallment cancellation informationnull

Installment Information

ParameterTypeDescription
only_cancel_installmentInteger0-Cancel all / 1-Cancel installment only

Request Example

{
"request_id": "RQID0001",
"request_time": "2023-08-18T10:00:00.000Z",
"master_merchant_code": "BAOKIMMASTERMERCHANT",
"sub_merchant_code": "BAOKIMSUBMERCHANT",
"mrc_order_id": "BK_24121706176582",
"description": null,
"amount": 10000,
"account_no": 1903000000000018,
"bank_no": 970407,
"installment": null
}

Response

Main Parameters Table

ParameterTypeRequiredDescription
codeInteger
messageString
dataObject

Order Information (data.order)

ParameterTypeRequiredDescription
idIntegerBaokim order ID
mrc_order_idStringMerchant's order ID
total_amountIntegerOrder amount
payment_methodIntegerPayment method
statusIntegerOrder status (see table below)
completed_atDateTimeSuccess time
created_atDateTimeCreation time
updated_atDateTimeLast update time

Order Status (data.order.status)

ValueStatus
0Initialized
1Success
2Rejected
3Pending approval
4Waiting for installment conversion
5Processing
6Waiting for down payment
7Expired
8Refunding
9Refunded

Transaction Information (data.transactions)

ParameterTypeRequiredDescription
idIntegerBaokim transaction ID
typeIntegerTransaction type: 1-Payment, 2-Refund
payment_methodIntegerPayment method
sub_merchant_feeIntegerSub merchant fee charged
master_merchant_feeIntegerMaster merchant fee charged
master_merchant_modelIntegerMaster merchant model
user_feeIntegerUser fee charged
total_amountIntegerTotal customer payment after fees
amountIntegerAmount changing sub merchant balance
descriptionStringTransaction content
statusIntegerStatus: 0-Initialized, 1-Success, 2-Failed, 3-Pending
bnplObjectBNPL information (if any)
installmentObjectInstallment information (if any)
completed_atDateTimeSuccess time
created_atDateTimeCreation time
updated_atDateTimeLast update time

BNPL Information (data.transactions.bnpl)

ParameterTypeRequiredDescription
payment_per_monthInteger
paylater_amountInteger
down_paymentInteger
providerInteger

Installment Information (data.transactions.installment)

ParameterTypeRequiredDescription
card_brandInteger
periodInteger
payment_per_periodInteger
bank_codeInteger