1
取得您的 API 金鑰
首先,在 Zonos Dashboard 中註冊 Zonos 帳戶並設定您的帳戶。之後,您可以取得 API 金鑰,以便使用 Zonos API 進行驗證。
2
決定要擷取哪些詳情
由於 GraphQL 的運作方式,您可以只要求感興趣的欄位,或可選擇要求系統中與訂單相關的所有資訊——選擇權在您。請查閱 GraphQL API 參考以了解可用的欄位。
與訂單相關的資訊(例如 落地成本報價詳情、運費報價詳情、購物車詳情等)可以通過將這些物件中的欄位新增到您的 order 查詢中來透過圖表進行查詢。
至少,您需要訂單號碼才能查詢 API。這通過 GraphQL 請求中變數內的 orderId 欄位傳遞。
1
query order($orderId: String!) {2
order(orderId: $orderId) {3
# ... other field names here4
}5
}3
傳送您的請求
現在您已建立並設定了請求,可以將 POST 請求傳送至 Zonos API。請確保使用 API 金鑰進行驗證,並在請求中提供正確的版本標題。
POST https://api.zonos.com/graphql
1
query order($orderId: String!) {2
order(orderId )3
accountOrderNumber4
amountSubtotals5
duties6
taxes7
fees8
shipping9
items10
11
landedCosts12
id13
rootId14
tariffRate15
duties16
amount17
currency18
formula19
item20
id21
description22
23
exchangeRate24
rate25
sourceCurrencyCode26
targetCurrencyCode27
28
29
fees30
amount31
currency32
description33
note34
formula35
36
item37
id38
description39
40
exchangeRate41
rate42
43
44
taxes45
amount46
currency47
formula48
item49
id50
description51
52
exchangeRate53
rate54
55
56
deMinimis57
formula58
method59
note60
threshold61
62
63
shipmentRating64
id65
amount66
currencyCode67
displayName68
minTransitAt69
maxTransitAt70
details71
amount72
carrierCode73
74
75
amountSubtotals76
shipping77
fuelSurcharge78
insuranceCost79
otherSurcharge80
81
shipmentRatingCartons82
chargeableWeight83
carton84
length85
width86
height87
weight88
89
90
shippingProfile91
id92
customServiceLevelCode93
landedCostMethod94
serviceLevel95
code
擷取訂單詳情
使用 GraphQL 擷取您的訂單詳情。若要擷取 Zonos 系統中國際訂單的詳情,您可以查詢 GraphQL API。這可讓您擷取訂單詳情和與訂單相關的任何適用資訊,例如運費報價、落地成本報價等。