Tính thông tin thanh toán (tổng tiền, giảm giá...) cho trang thanh toán.
| URL | /PartnerAPI/Order/user/calculatePaymentInfo |
|---|---|
| Method | POST |
| Header | Required | Mô tả |
|---|---|---|
| apiKey hoặc apikey | Yes | Khóa xác thực API của đối tác |
| Field | Type | Required | Rule | Mô tả |
|---|---|---|---|---|
| orderId | number | No | > 0 nếu truyền | ID đơn hàng |
| licensePlatesList | string[] | No | Mảng biển số hợp lệ | Danh sách biển số |
| productIds | number[] | object[] | No | object[] theo dạng { productId, quantity } | Danh sách sản phẩm |
| promotionCode | string | No | Mã khuyến mãi hợp lệ | Mã giảm giá |
curl --location 'https://ttdk-develop-server.service.makefamousapp.com/PartnerAPI/Order/user/calculatePaymentInfo' \
--header 'Content-Type: application/json' \
--header 'apiKey: demo_partner_api_key' \
--data '{
"orderId": 12345,
"promotionCode": "SALE10"
}'
{
"statusCode": 200,
"error": null,
"message": "Success",
"data": {
"subTotalAmount": 100000,
"payment": 100000,
"taxAmount": 8000,
"discountAmount": 10000,
"totalPayment": 98000,
"totalAmount": 98000,
"paidAmount": 0,
"unpaidAmount": 98000,
"refundAmount": 0,
"debtStatus": 0,
"promotionData": null,
"salesChannel": "PARTNER"
}
}
| HTTP | Mã lỗi | Mô tả |
|---|---|---|
| 400 | INVALID_REQUEST | Dữ liệu đầu vào không hợp lệ. |
| 401 | UNAUTHORIZED | apiKey không hợp lệ hoặc không có quyền truy cập. |
| 500 | UNKNOWN_ERROR | Lỗi hệ thống nội bộ. |