DOCS

Create orders graphql

/

Create orders

Learn how to create orders from a landed cost quote.

GraphQL

Once you have created or calculated a landedCost, you must use the orderCreate mutation to tie the landedCost quote you received to an order which will enable our Landed Cost guarantee. Once an order is created, the Zonos fee will be charged.

Prepare the mutation input 

The orderCreate mutation requires specific input data. While additional optional fields are available, the following fields are required:

  • currencyCode: The currency the order was placed in.
  • landedCostId: The ID for the landed cost quote used in the order.
  • accountOrderNumber: The order number you assign (often the platform's order number). Each order number must be unique within an organization.

You can create multiple orders using the same landedCostId, but in most circumstances, landed cost quotes cannot be used for more than 90 days. Using a landed cost quote older than 90 days typically voids the landed cost guarantee for that order.

Send the mutation 

Once you have the required input data, send the GraphQL mutation to the API endpoint using your chosen client library or tool. Here's an example of how you can structure the mutation:

Mutation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
mutation {
  orderCreate(
    input: {
      accountOrderNumber: "12343244"
      billTo: "party_00e63a9e-9735-44d9-b129-3b3e76c5df25"
      currencyCode: USD
      grandTotal: 2346.12
      landedCostId: "landed_cost_32e7f442-8e82-47b3-957a-096088b14e7b"
      trackingNumbers: "9205500000000000000000"
    }
  ) {
    id
    organization
    references {
      key
      value
    }
    landedCosts {
      id
    }
  }
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "data": {
    "orderCreate": {
      "id": "order_ec7084f6-0778-47ce-b848-3ba57af9684d",
      "organization": "organization_dbb64939-12d7-4f12-98ea-7ae5b21acfd0",
      "references": [
        {
          "key": "zonosOrderNumber",
          "value": "1001623"
        }
      ],
      "landedCosts": [
        {
          "id": "landed_cost_32e7f442-8e82-47b3-957a-096088b14e7b"
        }
      ]
    }
  }
}

Was this page helpful?