Skip to main content

Create Installment Conversion Transaction

Process

Description:

  • Merchant sends a request to create an installment conversion (IC) transaction to Baokim after successfully processing the customer's card transaction.
  • Baokim records the request and returns order information in pending conversion status.

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
4bank_noString(6)Unique bank code on Baokim
5customer_id_numberString(12)Customer ID / CCCD / passport number
6customer_nameString(200)Full customer name, no accents, with spaces
7customer_phoneString(10)Customer phone number
8customer_emailString(255)Customer email
9customer_addressString(500)Customer address
10product_nameString(255)Product name(s) in the order
11auth_codeString(50)Authorization code
12card_noString(10)First 6 + last 4 digits of card. Example: card 53396xxxxxxx82111 → send 5339682111
13mrc_order_idString(50)Merchant order code
14loan_pack_idNumber(10)Loan package ID (retrieved from "Retrieve banks and installment loan packages" API response)
15auth_timeString(50)Time when customer charged the card
16total_payment_amountNumber(50)Amount customer charged on card

Request Example

{
"request_id": "MERCHANT050015588AXE012",
"request_time": "2020-08-11 14:41:00",
"merchant_code": "MERCHANT",
"bank_no": "970436",
"customer_id_number": "H0119600",
"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",
"product_name": "Tủ lạnh LG",
"auth_code": "1312338",
"card_no": "5339682111",
"mrc_order_id": "VLAD_1753867524",
"loan_pack_id": 638,
"auth_time": "2020-08-11 14:41:00",
"total_payment_amount": 10700000
}

Response

(Parameters returned by Baokim)

Main Parameters Table

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

Data Information

No.Field NameData TypeRequiredDescription
1bank_noString(6)Bank code on Baokim
2customer_id_numberString(12)Customer ID / CCCD / passport
3customer_nameString(200)Full customer name, no accents, with spaces
4customer_phoneString(10)Customer phone number
5customer_emailString(255)Customer email
6customer_addressString(500)Customer address
7product_nameString(255)Product name(s) in the order
8auth_codeString(50)Authorization code
9card_noString(50)First 6 + last 4 digits of card (Example: card 53396xxxxxxx82111 then send 5339682111)
10mrc_order_idString(50)Merchant order code
11loan_packageObjectLoan package information
12auth_timeString(50)Card payment time
13total_payment_amountIntegerCard payment amount
14statusIntegerOrder status on Baokim
15installment_fee_amountIntegerInstallment conversion fee
16monthly_payment_amountIntegerMonthly installment payment amount (total loan / term)
17installment_amountIntegerInstallment registered amount
18order_idIntegerUnique order code created by Baokim
19created_atString(20)Order creation time
20updated_atString(20)Order update time

loan_package Information

No.Field NameData TypeRequiredDescription
1loan_pack_idIntegerLoan package ID on Baokim system
2package_nameString(255)Loan package name
3grace_periodIntegerInstallment term (months)
4conversion_feeDecimalInstallment conversion fee (%)

Response Example

{
"code": 0,
"message": "Success",
"data": {
"bank_no": "970436",
"customer_id_number": "H0119600",
"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",
"product_name": "Tủ lạnh LG",
"auth_code": "1312338",
"card_no": "5339682111",
"mrc_order_id": "VLAD_1753867524",
"loan_package": {
"loan_pack_id": 638,
"package_name": "6-month installment package",
"grace_period": 6,
"conversion_fee": 2.0
},
"auth_time": "2020-08-11 14:41:00",
"total_payment_amount": 10700000,
"status": 1,
"installment_fee_amount": 700000,
"monthly_payment_amount": 1188889,
"installment_amount": 10700000,
"order_id": 45467,
"created_at": "2020-08-11 14:41:00",
"updated_at": "2020-08-11 15:41:00"
}
}

Error Codes

Error CodeDescription
200Success
11Failure
101Baokim system error
102Basic auth authentication error
103Signature authentication error
104Validation error: Invalid RequestId
105Validation error: Invalid RequestTime
106Validation error: Invalid PartnerCode
107Validation error: Invalid CustomerName
108Validation error: Invalid CustomerPhone
109Validation error: Invalid CustomerEmail
110Validation error: Invalid BankCode
112Validation error: Invalid ClientIdNo
113Validation error: Invalid AuthCode
114Validation error: Invalid CardNo
118Validation error: Invalid ReferenceId
122Validation error: Invalid ConversionMoney
123Validation error: Invalid PayPerMonth
124Validation error: Invalid InstallmentAmount
125Validation error: Invalid TotalPaymentAmount
126Installment bank and card issuer bank do not match
127Validation error: Invalid Operation
142Invalid status
157Card BIN does not support installment
159Invalid start time (fromTime)
160Invalid end time (toTime)
168Invalid installment term
170Loan package not configured on Baokim
171Transaction cancellation not supported
174Invalid cancellation time
176Invalid payment time
177Invalid cancellation reason