Partner API - Order Payment - Calculate Payment Info

Tính thông tin thanh toán (tổng tiền, giảm giá...) cho trang thanh toán.

Về module Order Payment

Endpoint

URL/PartnerAPI/Order/user/calculatePaymentInfo
MethodPOST

Headers schema

HeaderRequiredMô tả
apiKey hoặc apikeyYesKhóa xác thực API của đối tác

Body schema

FieldTypeRequiredRuleMô tả
orderIdnumberNo> 0 nếu truyềnID đơn hàng
licensePlatesListstring[]NoMảng biển số hợp lệDanh sách biển số
productIdsnumber[] | object[]Noobject[] theo dạng { productId, quantity }Danh sách sản phẩm
promotionCodestringNoMã khuyến mãi hợp lệMã giảm giá

Sample Request

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"
  }'

Success response

{
  "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"
  }
}

Mã lỗi

HTTPMã lỗiMô tả
400INVALID_REQUESTDữ liệu đầu vào không hợp lệ.
401UNAUTHORIZEDapiKey không hợp lệ hoặc không có quyền truy cập.
500UNKNOWN_ERRORLỗi hệ thống nội bộ.

Tham khảo

Data test cho developer