DOCS

建立訂單 - GraphQL

建立訂單

了解如何從 Landed Cost 報價建立訂單。

GraphQL

建立或計算 landedCost 後,您必須使用 orderCreate mutation 將您收到的 landedCost 報價綁定到訂單,這樣能啟用我們的 Landed Cost 保證。建立訂單後,Zonos 費用將被收取。

準備 mutation 輸入 

orderCreate mutation 需要特定的輸入數據。雖然提供了其他可選欄位,但以下欄位為必填項:

  • currencyCode:訂單所用的貨幣。
  • landedCostId:訂單中使用的 Landed Cost 報價的 ID。
  • accountOrderNumber:您分配的訂單號(通常是平台的訂單號)。每個訂單號在組織內必須唯一。

每個 landedCostId 只能用於單個訂單。如果您需要建立多個訂單,必須為每個訂單生成新的 Landed Cost 報價。重複使用 landedCostId 將導致錯誤。

傳送 mutation 

擁有所需的輸入數據後,使用您選擇的客戶端程式庫或工具向 API 端點發送 GraphQL mutation。以下是如何構造 mutation 的範例:

在根據 Landed Cost 報價建立訂單時使用此 mutation。

1mutation CreateOrder($input: OrderCreateInput!) {
2 orderCreate(input: $input) {
3 id
4 organization
5 landedCosts {
6 id
7 }
8 }
9}
GraphQL API ReferenceTypes, inputs, and operations used in this guide
預約演示

這個頁面有幫助嗎?