Skip to main content

Refund Order

Flow

Description:

  • Merchant calls the order refund API.
  • If Baokim returns error code 116 (original transaction was paid from electronic wallet), please call this API again with the bank account information to receive the refund.

API Information

Method: POST

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

Request

Main Parameters Table

Field NameData TypeRequiredDescription
request_idStringRequest ID
request_timeDatetimeRequest time. Format: YYYY-MM-DD H:m:s
merchant_codeStringMerchant code provided by Baokim
mrc_order_idStringMerchant's order ID
descriptionStringRefund content
amountIntegerAmount to refund if partial refund
account_noStringBank account to receive refund (when error code = 116)
bank_noString(6)Bank code to receive refund (when error code = 116)
installmentObjectInstallment cancellation information

Installment Information

Field NameData TypeRequiredDescription
only_cancel_installmentInteger0 = Cancel full, 1 = Cancel conversion

Request Example

{
"request_id": "RQID0001",
"request_time": "2023-08-18 10:00:00",
"merchant_code": "MERCHANTCODE",
"mrc_order_id": "BK_24121706176582",
"description": null,
"amount": 10000,
"account_no": 1903000000000018,
"bank_no": 970407,
"installment": null
}

Response

note

HTTP 200 - Success

Main Parameters Table

Field NameData TypeRequiredDescription
codeIntegerResult code
messageStringMessage
data.orderObjectOrder information
data.transactionObjectRefund transaction information

Order Information (data.order)

Field NameData TypeRequiredDescription
idIntegerBaokim order ID
mrc_order_idStringMerchant's order ID
total_amountIntegerOrder amount
statusIntegerOrder status (0–9)
completed_atDatetimeSuccess time
created_atDatetimeCreation time
updated_atDatetimeLast update time

Transaction Information (data.transaction)

Field NameData TypeRequiredDescription
idIntegerBaokim transaction ID
order_idIntegerBaokim order ID
mrc_order_idString(50)Merchant's order ID
typeIntegerTransaction type
payment_methodIntegerPayment method
merchant_feeIntegerMerchant fee
user_feeIntegerUser fee
promotion_amountIntegerPromotion amount
total_amountIntegerTotal transaction amount (amount + user_fee)
amountIntegerOrder amount
descriptionString(255)Transaction description
statusIntegerStatus: 0 = Initiated, 1 = Successful, 2 = Failed, 3 = Pending
periodIntegerPeriod (null if not applicable)
completed_atDatetimeCompletion time
created_atDatetimeCreation time
updated_atDatetimeLast update time

Response Example

{
"code": 200,
"message": "Success",
"data": {
"order": {
"id": 4412312,
"mrc_order_id": "BK_021_ANC",
"total_amount": 10000,
"status": 1,
"completed_at": "2023-08-02 08:15:30",
"created_at": "2023-08-02 08:13:30",
"updated_at": "2023-08-02 08:15:30"
},
"transaction": [
{
"id": 112344,
"order_id": 4412312,
"mrc_order_id": "BK_021_ANC",
"type": 1,
"payment_method": 1,
"merchant_fee": 0,
"user_fee": 1000,
"promotion_amount": 0,
"total_amount": 11000,
"amount": 10000,
"description": "Payment for order",
"status": 1,
"period": null,
"completed_at": "2023-08-02 08:15:30",
"created_at": "2023-08-02 08:13:30",
"updated_at": "2023-08-02 08:15:30"
}
]
}
}

Error Codes

Error CodeDescription
102Provider error
104Authentication error
105Invalid digital signature
106Insufficient amount
107Order cannot be refunded
109Order not found