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