TradeCreate
Function
創建訂單
Endpoint
- /v1/point-engine/trade-create
HTTP Method
- POST
Request Body
with receipt
{
"vip_accountno": "040xxxx",
"out_trade_no": "XXXX",
"store_code": "DP01XXXX",
"invoice_id": "123456",
"total_amount": "1000.00",
"payment_amount": "1000.00",
"payment_method": "Visa",
"currency": "HKD",
"sales_time": "2023-01-20T10:00:00+08:00",
"submit_time": "2023-01-20T10:00:00+08:00",
"approval_time": "2023-01-20T10:00:00+08:00",
"burn_point": "0",
"resource": "",
"remark": "",
"receipt_image_url": [
"https://xxxx"
],
"payment_image_url": [
"https://xxxx"
]
}
without receipt
{
"vip_accountno": "040xxxx",
"out_trade_no": "XXXX",
"store_code": "DP01XXXX",
"invoice_id": "123456",
"total_amount": "1000.00",
"payment_amount": "1000.00",
"payment_method": "Visa",
"currency": "HKD",
"sales_time": "2023-01-20T10:00:00+08:00",
"submit_time": "2023-01-20T10:00:00+08:00",
"approval_time": "2023-01-20T10:00:00+08:00",
"burn_point": "0",
"resource": "",
"remark": ""
}
Request Parameters
| Field | Required | Type | Remark | Sample |
|---|---|---|---|---|
| vip_accountno | Yes | string | 會員號,vip_accountno | 040xxxx |
| out_trade_no | Yes | string | 訂單號,需唯一,最多64位 | xxxxxxx |
| store_code | Yes | string | 店铺号 | DP01XXXX |
| invoice_id | Yes | string | 小票单据号 | 123456 |
| total_amount | Yes | string | 訂單總金額 | 1000.00 |
| payment_amount | Yes | string | 支付金额 | 1000.00 |
| payment_method | Yes | string | 支付方式 | Visa |
| currency | No | string | 货币类型: HKD(default) | HKD |
| sales_time | Yes | string | 消費時間, rfc3339 format | 2023-01-01T10:00:00+08:00 |
| submit_time | Yes | string | 提交時間, rfc3339 format | 2023-01-01T10:00:00+08:00 |
| approval_time | Yes | string | 審核時間, rfc3339 format | 2023-01-01T10:00:00+08:00 |
| burn_point | No | int | 抵現積分 | 250 |
| resource | No | string | 來源, [TBC] all resource? | |
| remark | No | string | 备注 | description |
| receipt_image_url | No | [] | 小票圖片,可多張 | description |
| payment_image_url | No | [] | 支付圖片,可多張 | description |
Response Body - Success
{
"code": 0,
"msg": "success",
"data": {
"trade_no": "XXXXXXXX",
"total_point": 300,
"detail": [
{
"point": 100,
"type": "E",
"expire_type": "KDP",
"expire_time": "",
"remark": "xx",
"campaign_code": ""
},
{
"point": 200,
"type": "A",
"expire_type": "QUARTER",
"expire_time": "2023-03-31",
"remark": "xx",
"campaign_code": "xx"
}
]
}
}
Response Parameters
| Field | Type | Remark | Sample |
|---|---|---|---|
| trade_no | string | PointEngine 訂單號,唯一 | XXXXXXXX |
| total_point | number | total point | 300 |
| detail.point | number | point | 100 |
| detail.type | string | 積分類型: E(消費獲得積分), A(促銷贈送積分) | E |
| detail.expire_type | string | 積分有效期類型, KDP(KDP積分過期時間)、QUARTER(季度) | QUARTER |
| detail.expire_time | string | 積分有效期, ""(KDP) 、 Quarter End Date(QUARTER) | 2023-03-31 |
| detail.remark | string | 備注 | remark |
| detail.campaign_code | string | type = A 时,campaign_code有值 |