準備 mutation 輸入
orderCreate mutation 需要特定的輸入數據。雖然提供了其他可選欄位,但以下欄位為必填項:
currencyCode:訂單所用的貨幣。landedCostId:訂單中使用的 Landed Cost 報價的 ID。accountOrderNumber:您分配的訂單號(通常是平台的訂單號)。每個訂單號在組織內必須唯一。
每個 landedCostId 只能用於單個訂單。如果您需要建立多個訂單,必須為每個訂單生成新的 Landed Cost 報價。重複使用 landedCostId 將導致錯誤。
傳送 mutation
擁有所需的輸入數據後,使用您選擇的客戶端程式庫或工具向 API 端點發送 GraphQL mutation。以下是如何構造 mutation 的範例:
在根據 Landed Cost 報價建立訂單時使用此 mutation。
1
mutation CreateOrder($input: OrderCreateInput!) {2
orderCreate(input: $input) {3
id4
organization5
landedCosts {6
id7
}8
}9
}GraphQL API ReferenceTypes, inputs, and operations used in this guide
INPUTS
MUTATIONS
建立訂單
了解如何從 Landed Cost 報價建立訂單。GraphQL
建立或計算
landedCost後,您必須使用orderCreatemutation 將您收到的landedCost報價綁定到訂單,這樣能啟用我們的 Landed Cost 保證。建立訂單後,Zonos 費用將被收取。