1
取得您的 API 金鑰
首先,在 Zonos Dashboard 上註冊 Zonos 帳戶並設定您的帳戶。然後您將能夠取得您的 API 金鑰, 這將允許您使用 Zonos API 進行驗證。
2
決定要擷取的詳細資訊
由於 GraphQL 的運作方式,您可以只從 API 要求您感興趣的欄位,或者您可以選擇要求系統與訂單相關的所有資訊—選擇權在您。請參閱 GraphQL API 參考 以了解可用的欄位。
與訂單相關的資訊,例如 著陸成本報價詳細資訊、運費費率詳細資訊、購物車詳細資訊等,可以通過將這些物件的欄位新增到您的 order 查詢來透過圖表查詢。
至少,您需要一個訂單號碼才能查詢 API。這在您的 GraphQL 請求中透過變數中的 orderId 欄位傳遞。
1
query order($orderId: String!) {2
order(orderId: $orderId) {3
# ... other field names here4
}5
}3
發送您的請求
現在您已建立並設定您的請求,您可以向 Zonos API 發送 POST 請求。確保使用您的 API 金鑰進行驗證,並在您的請求中提供正確的版本標頭。
POST https://api.zonos.com/graphql
1
query order($orderId: String!) {2
order( )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。這允許您擷取訂單詳細資訊和與訂單相關的任何適用資訊,例如運費費率、著陸成本報價等。