Create BNPL Transaction
Process
Description:
- Merchant sends a request to create a BNPL transaction to Baokim.
- Baokim returns a KYC link for redirecting the user to perform verification.
API Information
Method: POST
Request
(Parameters sent by the partner)
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String(100) | ✅ | Unique ID of the request from Merchant to Baokim |
| 2 | request_time | String(20) | ✅ | Request sent time. Format: YYYY-MM-DD H:i:s |
| 3 | merchant_code | String(50) | ✅ | Unique merchant identifier |
| 4 | customer_name | String(200) | ✅ | Full customer name, no accents, with spaces |
| 5 | customer_phone | String(10) | ✅ | Customer phone number |
| 6 | customer_email | String(255) | ✅ | Customer email |
| 7 | customer_address | String(500) | ✅ | Customer address |
| 8 | original_amount | Number | ✅ | Total order amount |
| 9 | mrc_order_id | String(50) | ✅ | Merchant order code |
| 10 | package_code | String(50) | ✅ | Loan package code (retrieved from the "Retrieve finance organizations and loan packages" API response) |
| 11 | url_success | String(255) | ✅ | URL Baokim redirects to when loan approval is successful |
| 12 | url_fail | String(255) | ✅ | URL Baokim redirects to when loan approval fails |
| 13 | extension | Object | ✅ | Extended information: products, order, sales point |
Items Information (product array)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | items | Array | ✅ | List of product information objects |
extension.items Information (product array)
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | item_code | String(50) | ✅ | Product code |
| 2 | item_name | String(255) | ✅ | Product name |
| 3 | item_amount | Number | ✅ | Product price |
| 4 | quantity | Number | ✅ | Product quantity |
| 5 | url | String(500) | ❌ | Product link |
Request Example
{
"request_id": "MERCHANT050015588AXE012",
"request_time": "2020-08-11 14:41:00",
"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",
"original_amount": 10000000,
"mrc_order_id": "VLAD_1753867524",
"package_code": "home_1month",
"down_payment_amount": 2000000,
"url_success": "https://example.com/success",
"url_fail": "https://example.com/fail",
"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"
}
]
}
}
Response
(Parameters returned by Baokim)
Request Parameters
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | code | Number(3) | ✅ | Baokim error code |
| 2 | message | String(200) | ✅ | Baokim error code message |
| 3 | data | Object | ✅ | Data returned by Baokim |
Data Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | order_id | Number | ✅ | Baokim order code |
| 2 | mrc_order_id | String(50) | ✅ | Merchant order code |
| 3 | kyc_url | String(255) | ✅ | Customer KYC link |
| 4 | created_at | Datetime | ✅ | Order creation time |
| 5 | updated_at | Datetime | ✅ | Order update time |
Response Example
{
"code": 0,
"message": "Success",
"data": {
"order_id": 1870436,
"mrc_order_id": "VLAD_1753867524",
"kyc_url": "https://pay-vn.kredivo.com/?session=MDkwYjgzOWY5NTQ0YmE3ZW5DN0hiTytnN0JpM2I3TTFJaElKMFRBc3ZoVzZMOWgzQlovTFMzUG1ZTURQd0tYL3hzUWh3R3c2ZXlxb2dpZ2pGcWpHRUNWQktkUT0=",
"created_at": "2020-08-11 14:41:00",
"updated_at": "2020-08-11 15:41:00"
}
}
Error Codes
| Error Code | Description |
|---|---|
| 100 | Success |
| 101 | System error |
| 102 | Provider error |
| 104 | JWT authentication error |
| 105 | Invalid digital signature |
| 106 | Order amount is insufficient for refund |
| 107 | Order cannot be refunded |
| 108 | Order cannot be cancelled |
| 109 | Order does not exist |
| 110 | Merchant order code already exists |
| 422 | Validation error |