准备mutation输入
orderCreate mutation需要特定的输入数据。虽然还有其他可选字段,但以下字段是必需的:
currencyCode:订单所用的货币。landedCostId:订单中使用的登陆成本报价的ID。accountOrderNumber:您分配的订单号(通常是平台的订单号)。每个订单号在组织内必须是唯一的。
每个landedCostId只能用于单个订单。如果您需要创建多个订单,您必须为每个订单生成新的登陆成本报价。重复使用landedCostId将导致错误。
发送mutation
一旦您拥有必需的输入数据,使用您选择的客户端库或工具将GraphQL mutation发送到API端点。以下是如何组织mutation的示例:
当您基于登陆成本报价创建订单时使用此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
创建订单
了解如何从登陆成本报价创建订单。GraphQL
一旦您创建或计算了
landedCost,您必须使用orderCreatemutation将您收到的landedCost报价与订单绑定,这将启用我们的Landed Cost guarantee。一旦订单创建,Zonos费用将被扣除。