Cập nhật thông tin đơn hàng
Đường dẫn
- URL:
/cb-core/api/v1/payment/update-info - Method:
POST - Mô tả: API này cho phép cập nhật thông tin thanh toán của một đơn hàng sau khi thanh toán được tạo và đã hoàn thành
Request
Bảng Request
| Tham số | Loại dữ liệu + Độ dài | Bắt buộc | Mô tả |
|---|---|---|---|
| request_id | string(50) | Yes | Unique request ID, suggested format: MerchantCode+YYYYMMDDHHMMSS+UniqueId |
| request_time | string(19) | Yes | Request time in format: YYYY-MM-DD HH:MM:SS |
| merchant_code | string(20) | Yes | Merchant code provided by Baokim before integration |
| sub_merchant_code | string(50) | Yes | Sub merchant code provided by Baokim before integration |
| merchant_payment_id | string(50) | Yes | Merchant payment's ID |
| seller_id | string(50) | Yes | Seller ID matching the Onboarding Sellers API |
| article | array | Yes | List of articles |
| article.id | string(20) | Yes | Article ID |
| article.name | string(255) | Yes | Name of product/service |
| article.quantity | int(3) | Yes | Article quantity |
| article.price | double | Yes | Article price |
| customer | object | Yes | Customer information |
| customer.first_name | string(100) | Yes | Customer first name |
| customer.last_name | string(100) | Yes | Customer last name |
| customer.email | string(255) | Yes | Customer email |
| customer.phone | string(255) | Yes | Customer phone |
| customer.address | string(255) | Yes | Customer address |
| customer.date_of_birth | datetime | Yes | Customer date of birth formt YYYY-MM-DD |
| customer.gender | tinyint | Yes | Customer gender 1. Male 2. Female, 3. Other |
| customer.social_id | string(20) | Yes | Customer social id |
| billings | object | Yes | Billing information |
| billings.first_name | string(50) | Yes | First name |
| billings.last_name | string(50) | Yes | Last name |
| billings.address | string(255) | Yes | Billing address |
| billings.city | string(255) | Yes | City of billing address |
| billings.state | string(255) | Yes | State of billing address |
| billings.zip_code | string(255) | Yes | Zip code of billing address |
| billings.street | string(255) | Yes | Street name of the billing address |
| billings.street_number | string(255) | Yes | Street number of the billing address |
| billings.house_number | string(255) | Yes | House number of the billing address |
| billings.house_extension | string(255) | Yes | House extension of the billing address |
| shippings | object | Yes | Shipping information |
| shippings.first_name | string(50) | Yes | First name |
| shippings.last_name | string(50) | Yes | Last name |
| shippings.address | string(255) | Yes | Shipping address |
| shippings.city | string(255) | Yes | City of shipping address |
| shippings.state | string(255) | Yes | State of shipping address |
| shippings.zip_code | string(255) | Yes | Zip code of shipping address |
| shippings.street | string(255) | Yes | Street name of the shipping address |
| shippings.street_number | string(255) | Yes | Street number of the shipping address |
| shippings.house_number | string(255) | Yes | House number of the shipping address |
| shippings.house_extension | string(255) | No | House extension of the shipping address |
Ví dụ Request
{
"request_id": "MerchantCode+YYYYMMDDHHMMSS+UniqueId",
"request_time": "YYYY-MM-DD HH:MM:SS",
"merchant_code": "MerchantCode",
"sub_merchant_code": "SubMerchantCode",
"seller_id": "SELLER12345678901234510281",
"merchant_payment_id": "MerchantOrderID",
"article":
[
{
"id": 1,
"name": "Product name",
"price": 300000,
"quantity": 1
}
],
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone": "1234567890",
"address": "123 Main St",
"date_of_birth": "1990-01-01",
"gender": 1,
"social_id": "1234567890"
},
"billings": {
"first_name": "John",
"last_name": "Doe",
"address": "123 Main St",
"city": "New York",
"state": "NY",
"zip_code": "10001",
"street": "Main St",
"street_number": "123",
"house_number": "456",
"house_extension": "A"
},
"shippings": {
"first_name": "Jane",
"last_name": "Doe",
"address": "456 Main St",
"city": "New York",
"state": "NY",
"zip_code": "10001",
"street": "Main St",
"street_number": "123",
"house_number": "456",
"house_extension": "A"
}
}
Response
Bảng Response
| Tham số | Loại dữ liệu + Độ dài | Bắt buộc | Mô tả |
|---|---|---|---|
| response_code | int(4) | Yes | Error code from Baokim as per Error Codes Table |
| response_message | string(100) | Yes | Description of the error code from Baokim as per Error Codes Table |
| data | object | Yes | Data of the response |
| data.merchant_code | string(20) | Yes | Merchant code provided by Baokim before integration |
| data.sub_merchant_code | string(20) | Yes | Sub merchant code provided by Baokim before integration |
| data.seller_id | string(20) | Yes | Seller ID provided by Baokim before integration |
| data.merchant_payment_id | string(100) | Yes | The reference code of order managed in your system. This code is unique |
| article | array | Yes | List of articles |
| article.id | string(20) | Yes | Article ID |
| article.name | string(255) | Yes | Name of product/service |
| article.quantity | int(3) | Yes | Article quantity |
| article.price | double | Yes | Article price |
| customer | object | Yes | Customer information |
| customer.first_name | string(100) | Yes | Customer first name |
| customer.last_name | string(100) | Yes | Customer last name |
| customer.email | string(255) | Yes | Customer email |
| customer.phone | string(255) | Yes | Customer phone |
| customer.address | string(255) | Yes | Customer address |
| customer.date_of_birth | datetime | Yes | Customer date of birth formt YYYY-MM-DD |
| customer.gender | tinyint | Yes | Customer gender 1. Male 2. Female, 3. Other |
| customer.social_id | string(20) | Yes | Customer social id |
| billings | object | Yes | Billing information |
| billings.first_name | string(50) | Yes | First name |
| billings.last_name | string(50) | Yes | Last name |
| billings.address | string(255) | Yes | Billing address |
| billings.city | string(255) | Yes | City of billing address |
| billings.state | string(255) | Yes | State of billing address |
| billings.zip_code | string(255) | Yes | Zip code of billing address |
| billings.street | string(255) | Yes | Street name of the billing address |
| billings.street_number | string(255) | Yes | Street number of the billing address |
| billings.house_number | string(255) | Yes | House number of the billing address |
| billings.house_extension | string(255) | Yes | House extension of the billing address |
| shippings | object | Yes | Shipping information |
| shippings.first_name | string(50) | Yes | First name |
| shippings.last_name | string(50) | Yes | Last name |
| shippings.address | string(255) | Yes | Shipping address |
| shippings.city | string(255) | Yes | City of shipping address |
| shippings.state | string(255) | Yes | State of shipping address |
| shippings.zip_code | string(255) | Yes | Zip code of shipping address |
| shippings.street | string(255) | Yes | Street name of the shipping address |
| shippings.street_number | string(255) | Yes | Street number of the shipping address |
| shippings.house_number | string(255) | Yes | House number of the shipping address |
| shippings.house_extension | string(255) | No | House extension of the shipping address |
Ví dụ Response
{
"response_code": 200,
"response_message": "Thành công",
"data": {
"merchant_code": "PHUONGTT",
"sub_merchant_code": "SUBPHUONGTT",
"seller_id": "SELLER12345678901234510281",
"order_id": "BK1234567890",
"merchant_payment_id": "1234567890",
"article": [
{
"id": 1,
"name": "Product name",
"price": 300000,
"quantity": 1
}
],
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone": "1234567890",
"address": "123 Main St",
"date_of_birth": "1990-01-01",
"gender": 1,
"social_id": "1234567890"
},
"billings": {
"first_name": "John",
"last_name": "Doe",
"address": "123 Main St",
"city": "New York",
"state": "NY",
"zip_code": "10001",
"street": "Main St",
"street_number": "123",
"house_number": "456",
"house_extension": "A"
},
"shippings": {
"first_name": "Jane",
"last_name": "Doe",
"address": "456 Main St",
"city": "New York",
"state": "NY",
"zip_code": "10001",
"street": "Main St",
"street_number": "123",
"house_number": "456",
"house_extension": "A"
}
}
}
Mã lỗi
| Mã Response | Thông báo Response |
|---|---|
| 200 | Thành công |
| 99 | Đang xử lý |
| 11 | Thất bại |
| 101 | Lỗi hệ thống |
| 110 | Mã merchant không hợp lệ |
| 120 | Signature không hợp lệ |
| 422 | Lỗi xác thực |