擷取訂單詳細資訊

使用 GraphQL 擷取您的訂單詳細資訊。

若要擷取您在 Zonos 系統中的國際訂單詳細資訊,您可以查詢 GraphQL API。這允許您擷取訂單詳細資訊和與訂單相關的任何適用資訊,例如運費費率、著陸成本報價等。

1

取得您的 API 金鑰

首先,在 Zonos Dashboard 上註冊 Zonos 帳戶並設定您的帳戶。然後您將能夠取得您的 API 金鑰, 這將允許您使用 Zonos API 進行驗證。

由於 GraphQL 的運作方式,您可以只從 API 要求您感興趣的欄位,或者您可以選擇要求系統與訂單相關的所有資訊—選擇權在您。請參閱 GraphQL API 參考 以了解可用的欄位。

與訂單相關的資訊,例如 著陸成本報價詳細資訊、運費費率詳細資訊、購物車詳細資訊等,可以通過將這些物件的欄位新增到您的 order 查詢來透過圖表查詢。

至少,您需要一個訂單號碼才能查詢 API。這在您的 GraphQL 請求中透過變數中的 orderId 欄位傳遞。

1query order($orderId: String!) {
2 order(orderId: $orderId) {
3 # ... other field names here
4 }
5}

現在您已建立並設定您的請求,您可以向 Zonos API 發送 POST 請求。確保使用您的 API 金鑰進行驗證,並在您的請求中提供正確的版本標頭。

POST https://api.zonos.com/graphql

1query order($orderId: String!) {
2 order( )
3 accountOrderNumber
4 amountSubtotals
5 duties
6 taxes
7 fees
8 shipping
9 items
10 
11 landedCosts
12 id
13 rootId
14 tariffRate
15 duties
16 amount
17 currency
18 formula
19 item
20 id
21 description
22 
23 exchangeRate
24 rate
25 sourceCurrencyCode
26 targetCurrencyCode
27 
28 
29 fees
30 amount
31 currency
32 description
33 note
34 formula
35 
36 item
37 id
38 description
39 
40 exchangeRate
41 rate
42 
43 
44 taxes
45 amount
46 currency
47 formula
48 item
49 id
50 description
51 
52 exchangeRate
53 rate
54 
55 
56 deMinimis
57 formula
58 method
59 note
60 threshold
61 
62 
63 shipmentRating
64 id
65 amount
66 currencyCode
67 displayName
68 minTransitAt
69 maxTransitAt
70 details
71 amount
72 carrierCode
73 
74 
75 amountSubtotals
76 shipping
77 fuelSurcharge
78 insuranceCost
79 otherSurcharge
80 
81 shipmentRatingCartons
82 chargeableWeight
83 carton
84 length
85 width
86 height
87 weight
88 
89 
90 shippingProfile
91 id
92 customServiceLevelCode
93 landedCostMethod
94 serviceLevel
95 code