Skip to main content

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 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
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
8original_amountNumberTotal order amount
9mrc_order_idString(50)Merchant order code
10package_codeString(50)Loan package code (retrieved from the "Retrieve finance organizations and loan packages" API response)
11url_successString(255)URL Baokim redirects to when loan approval is successful
12url_failString(255)URL Baokim redirects to when loan approval fails
13extensionObjectExtended information: products, order, sales point

Items Information (product array)

No.Field NameData TypeRequiredDescription
1itemsArrayList of product information objects

extension.items Information (product array)

No.Field NameData TypeRequiredDescription
1item_codeString(50)Product code
2item_nameString(255)Product name
3item_amountNumberProduct price
4quantityNumberProduct quantity
5urlString(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 NameData TypeRequiredDescription
1codeNumber(3)Baokim error code
2messageString(200)Baokim error code message
3dataObjectData returned by Baokim

Data Information

No.Field NameData TypeRequiredDescription
1order_idNumberBaokim order code
2mrc_order_idString(50)Merchant order code
3kyc_urlString(255)Customer KYC link
4created_atDatetimeOrder creation time
5updated_atDatetimeOrder 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 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