訂單 API
訂單擷取
生產端點:
https://transact.ti.com/v2/store/orders/
使用訂單擷取 API 擷取訂單相關資訊。
您可以執行的操作:
- 查看最近訂單列表(預設為過去 30 天)。
- 透過訂單編號取得特定訂單的詳細資訊。
步驟:
- 驗證:您需要指派給您的 API 金鑰和密鑰,才能進行 API 驗證。
- API 要求:傳送訂單 API 要求,以取得訂單狀態和其它詳細資訊。
- API 回應:您會收到包含狀態程式碼 (200 OK) 的回應,以及附有訂單詳細資訊的 JSON。
- 依日期篩選訂單(選用):
- 若要指定日期範圍,請在要求中附上查詢參數「startDate」和「endDate」。
- 例如:https://transact.ti.com/v2/store/orders?startDate=2021-05-01&endDate=2025-05-31
- 擷取特定的訂單詳細資訊:
- 若要取得特定訂單的詳細資訊,請使用訂單編號查詢訂單 API。
- 例如:"https://transact.ti.com/v2/store/orders/T999999999"
使用訂單號碼的範例要求:
curl --request GET \
--url 'https://transact.ti.com/v2/store/orders/{orderNumber}'
--header 'Authorization: Bearer {access_token}' \
Example response:
{
"orderNumber": 0,
"orderStatus": "string",
"customerPurchaseOrderNumber": "string",
"subTotal": 0,
"totalPrice": 0,
"lineItems": [
{
"tiPartNumber": "string",
"tiPartDescription": "string",
"quantity": "string",
"status": "string",
"unitPrice": 0,
"customReelIndicator": true
}
],
"shippingAddress": [
{
"addressType": "string",
"firstName": "string",
"lastName": "string",
"company": "string",
"addressLine1": "string",
"addressLine2": "string",
"town": "string",
"state": "string",
"postalCode": "string",
"country": "string",
"email": "string",
"phoneNumber": "string",
"companyURL": "string"
}
],
"billingAddress": [
{
"addressType": "string",
"firstName": "string",
"lastName": "string",
"company": "string",
"addressLine1": "string",
"addressLine2": "string",
"town": "string",
"state": "string",
"postalCode": "string",
"country": "string",
"email": "string",
"phoneNumber": "string",
"companyURL": "string"
}
],
"orderMessages": [
{
"code": "string",
"type": "string",
"Message": "string"
}
],
"customerOrderAttributes": [
{
"attribute": "string"
}
],
"orderPlacedTime": "string",
"paymentType": "string",
"currencyISO": "string",
"totalTax": 0,
"checkoutProfileIdentifier": "string",
"totalDeliveryCost": 0,
"totalDiscount": 0,
"couponCodes": "string"
}