Partner API - Order Payment - Create Payment

Tạo thông tin thanh toán cho lịch hẹn/đơn hàng ở trang thanh toán.

Về module Order Payment

Endpoint

URL/PartnerAPI/CustomerSchedule/user/createPayment
MethodPOST

Headers schema

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

Body schema

FieldTypeRequiredRuleMô tả
customerScheduleIdnumberYes> 0ID lịch hẹn
paymentMethodTypenumberYesGiá trị trong danh sách payment typeLoại phương thức thanh toán
paymentMethodIdnumberNo> 0 nếu truyềnID phương thức thanh toán
paymentMethodSubTypestringNoChuỗi định danh subtypeSub-type thanh toán
stationServicesListnumber[]NoMỗi phần tử > 0Danh sách dịch vụ trạm
stationsIdnumberNo> 0 nếu truyềnID trạm

Sample Request

curl --location 'https://ttdk-develop-server.service.makefamousapp.com/PartnerAPI/CustomerSchedule/user/createPayment' \
  --header 'Content-Type: application/json' \
  --header 'apiKey: demo_partner_api_key' \
  --data '{
    "customerScheduleId": 1869,
    "paymentMethodType": 2,
    "paymentMethodId": 1,
    "stationServicesList": [101]
  }'

Success response

{
  "statusCode": 200,
  "error": null,
  "message": "Success",
  "data": {
    "customerScheduleId": 1869,
    "isSuccess": 1,
    "paymentStatus": "New",
    "totalPayment": 120000,
    "orderData": { "orderId": 99999 },
    "errorMessage": null,
    "errorCode": null,
    "inAppGtelOrderId": null,
    "paymentMethodId": 1,
    "paymentMethodType": 2,
    "paymentMethodSubType": null,
    "metaData": null,
    "bankQR": {
      "qrData": "https://.../qr.png",
      "qrCode": "000201...",
      "paymentContent": "ORDER99999"
    },
    "momoQR": null,
    "paymentLinkUrl": null,
    "paymentDeepLink": null,
    "paymentGatewayData": null
  }
}

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.
429APIKEY_QUOTA_EXCEEDEDVượt quota cho apiKey.
500UNKNOWN_ERRORLỗi hệ thống nội bộ.

Tham khảo

Data test cho developer