若要擷取 Zonos 系統中國際訂單的詳情,您可以查詢 GraphQL API。這可讓您擷取訂單詳情和與訂單相關的任何適用資訊,例如運費報價、落地成本報價等。
首先,在 Zonos Dashboard 中註冊 Zonos 帳戶並設定您的帳戶。之後,您可以取得 API 金鑰,以便使用 Zonos API 進行驗證。
由於 GraphQL 的運作方式,您可以只要求感興趣的欄位,或可選擇要求系統中與訂單相關的所有資訊——選擇權在您。請查閱 GraphQL API 參考以了解可用的欄位。
與訂單相關的資訊(例如 落地成本報價詳情、運費報價詳情、購物車詳情等)可以通過將這些物件中的欄位新增到您的 order 查詢中來透過圖表進行查詢。
order
至少,您需要訂單號碼才能查詢 API。這通過 GraphQL 請求中變數內的 orderId 欄位傳遞。
orderId
query order($orderId: String!) {
order(orderId: $orderId) {
# ... other field names here
}
現在您已建立並設定了請求,可以將 POST 請求傳送至 Zonos API。請確保使用 API 金鑰進行驗證,並在請求中提供正確的版本標題。
POST
POST https://api.zonos.com/graphql
https://api.zonos.com/graphql
accountOrderNumber
amountSubtotals {
duties
taxes
fees
shipping
items
landedCosts {
id
rootId
tariffRate
duties {
amount
currency
formula
item {
description
exchangeRate {
rate
sourceCurrencyCode
targetCurrencyCode
fees {
note
type
taxes {
deMinimis {
method
threshold
shipmentRating {
currencyCode
displayName
minTransitAt
maxTransitAt
details {
carrierCode
amountSubtotals
fuelSurcharge
insuranceCost
otherSurcharge
shipmentRatingCartons
chargeableWeight
carton
length
width
height
weight
shippingProfile
customServiceLevelCode
landedCostMethod
serviceLevel
code
擷取訂單詳情
擷取訂單詳情
使用 GraphQL 擷取您的訂單詳情。若要擷取 Zonos 系統中國際訂單的詳情,您可以查詢 GraphQL API。這可讓您擷取訂單詳情和與訂單相關的任何適用資訊,例如運費報價、落地成本報價等。
取得您的 API 金鑰
首先,在 Zonos Dashboard 中註冊 Zonos 帳戶並設定您的帳戶。之後,您可以取得 API 金鑰,以便使用 Zonos API 進行驗證。
決定要擷取哪些詳情
由於 GraphQL 的運作方式,您可以只要求感興趣的欄位,或可選擇要求系統中與訂單相關的所有資訊——選擇權在您。請查閱 GraphQL API 參考以了解可用的欄位。
與訂單相關的資訊(例如 落地成本報價詳情、運費報價詳情、購物車詳情等)可以通過將這些物件中的欄位新增到您的
order查詢中來透過圖表進行查詢。至少,您需要訂單號碼才能查詢 API。這通過 GraphQL 請求中變數內的
orderId欄位傳遞。query order($orderId: String!) {order(orderId: $orderId) {# ... other field names here}}傳送您的請求
現在您已建立並設定了請求,可以將
POST請求傳送至 Zonos API。請確保使用 API 金鑰進行驗證,並在請求中提供正確的版本標題。POST
https://api.zonos.com/graphqlquery order($orderId: String!) {order(orderId: $orderId) {accountOrderNumberamountSubtotals {dutiestaxesfeesshippingitems}landedCosts {idrootIdtariffRateduties {amountcurrencyformulaitem {iddescription}exchangeRate {ratesourceCurrencyCodetargetCurrencyCode}}fees {amountcurrencydescriptionnoteformulatypeitem {iddescription}exchangeRate {rate}}taxes {amountcurrencyformulaitem {iddescription}exchangeRate {rate}}deMinimis {formulamethodnotethresholdtype}shipmentRating {idamountcurrencyCodedisplayNameminTransitAtmaxTransitAtdetails {amountcarrierCodeamountSubtotalsshippingfuelSurchargeinsuranceCostotherSurchargeshipmentRatingCartonschargeableWeightcartonlengthwidthheightweightshippingProfileidcustomServiceLevelCodelandedCostMethodserviceLevelcode這個頁面有幫助嗎?