Skip to main content

Query Transaction

Process​

Description:

  • Merchant calls the API to query detailed information about BNPL transactions by order code.
  • Baokim searches for transactions based on the parameters sent by MERCHANT and returns a list of transactions that meet the request.

API Information​

Method: GET

URL: /api/merchant-hosted/bnpl/detail

Request​

(Parameters sent by the partner)

Main Parameters Table​

No.Field NameData TypeRequiredDescription
1request_idString(100)✅Unique ID of the request from Merchant to Baokim
2request_timeString(20)✅Request sent time. Format: YYYY-MM-DD H:i:s
3merchant_codeString(50)✅Unique merchant identifier
4mrc_order_idString(50)✅Unique transaction code sent by the partner (generated by the partner, can be considered as order code)

Request Example​

{
"request_id": "MERCHANT050015588AXE014",
"request_time": "2020-08-11 14:41:00",
"merchant_code": "MERCHANT",
"mrc_order_id": "VLAD_1753867524"
}

Response​

(Parameters returned by Baokim)

Main Parameters Table​

No.Field NameData TypeRequiredDescription
1codeNumber(3)✅Baokim error code
2messageString(200)✅Error code message
3dataObject✅Data returned

Data Information​

No.Field NameData TypeRequiredDescription
1order_idNumber✅Baokim order code
2mrc_order_idString(50)✅Merchant order code
3merchant_codeString(50)✅Unique identifier for partner: MERCHANT
4customer_nameString(200)✅Full customer name, no accents, with spaces
5customer_phoneString(10)✅Customer phone number
6customer_emailString(255)✅Customer email
7customer_addressString(500)✅Customer address
8package_codeString(255)✅Loan package code
9nameString(20)✅Loan package name
10periodNumber✅Term (1, 3, 6, 9, 12 months)
11min_amountNumber✅Minimum amount to apply for this loan package
12max_amountNumber✅Maximum amount to apply for this loan package
13down_payment_percentNumber✅% of down payment amount
14down_payment_amountNumber✅Down payment amount
15original_amountNumber✅Order amount
16user_feeNumber✅User fee
17merchant_feeNumber✅Merchant fee
18total_paylater_amountNumber✅Total deferred payment amount (fees included)
19payment_per_periodNumber✅Payment amount per period
20total_amountNumber✅Total amount user needs to pay (down payment + deferred payment)
21difference_amountNumber✅Amount difference compared to straight payment
22document_requiredString❌Type of document required for verification (e.g. national ID)
23provider_codeString(20)✅Finance organization name
24descriptionString(255)✅Order description
25url_successString(255)✅URL redirect when loan approval is successful
26url_failString(255)✅URL redirect when loan approval fails
27statusNumber✅Order status
28extensionObject✅Extended information (product list)
29created_atDatetime✅Order creation time
30updated_atDatetime✅Order update time

Extension Information​

No.Field NameData TypeRequiredDescription
1itemsArray✅List of product objects

Items Information​

No.Field NameData TypeRequiredDescription
1item_idNumber❌Product identifier assigned by the merchant
2item_codeString(50)✅Product code
3item_nameString(255)✅Product name
4item_amountNumber✅Product price
5quantityNumber✅Product quantity
6urlString(500)✅Product link

Response Example​

{
"code": 0,
"message": "Success",
"data": {
"order_id": 1870436,
"mrc_order_id": "VLAD_1753867524",
"merchant_code": "MERCHANT",
"customer_name": "Nguyễn Trung Quân",
"customer_phone": "0394827170",
"customer_email": "[email protected]",
"customer_address": "40, ngách 16/255 đường Láng, Đống Đa, Hà Nội",
"package_code": "homecredit_1month",
"name": "Home Credit 1 month",
"period": 1,
"min_amount": 1000000,
"max_amount": 500000,
"down_payment_percent": 20,
"down_payment_amount": 2000000,
"original_amount": 10000000,
"user_fee": 0,
"merchant_fee": 100000,
"total_paylater_amount": 8000000,
"payment_per_period": 8000000,
"total_amount": 10100000,
"difference_amount": 100000,
"document_required": "CCCD",
"provider_code": "HOMECREDIT",
"description": "Deferred payment order",
"url_success": "https://example.com/success",
"url_fail": "https://example.com/fail",
"status": 1,
"extension": {
"items": [
{
"item_id": 123456,
"item_code": "AEIQ_4562",
"item_name": "Máy tính xách tay ABC",
"item_amount": 10000000,
"quantity": 1,
"url": "https://example.com/product-detail"
}
]
},
"created_at": "2020-08-11 14:41:00",
"updated_at": "2020-08-11 15:41:00"
}
}

Error Codes​

Error CodeDescription
100Success
101System error
102Provider error
104JWT authentication error
105Invalid digital signature
106Order amount is insufficient for refund
107Order cannot be refunded
108Order cannot be cancelled
109Order does not exist
110Merchant order code already exists
422Validation error