DOCS

Create a shipment

/

Create a shipment

Create a shipment with the Zonos API.

GraphQL

If you are integrated with the Zonos API and are approved to ship outside of Dashboard, you will need to create a shipment and provide tracking numbers using the shipmentCreate mutation. You can also use these mutations to tell Zonos about domestic shipments to cross-docking facilities.

If you are using a Duty and Tax app and shipping with a platform that syncs tracking numbers to Zonos or shipping in Dashboard, you will not need to use this mutation.

Create a shipment via the API 

Once a Landed Cost has been calculated and an order has been created, you can send us tracking numbers and other shipment details via the API.

Shipment details
Tracking numbers
Create a label

Use this request when you are telling Zonos about a shipment but do not need a label. You will pass details about items, parties, shipmentCartons, and trackingNumbers that are tied to the order. By giving us these details we will be able to know if the order has been fulfilled partially or in its entirety.

Mutation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
mutation {
  itemCreateWorkflow(
    input: {
      amount: "50"
      currencyCode: USD
      quantity: 1
      sku: "test1"
      description: "shoes"
      hsCode: "670121"
    }
  ) {
    amount
    id
    sku
  }
  partyCreateWorkflow(
    input: [
      {
        location: {
          administrativeArea: "Utah"
          administrativeAreaCode: "UT"
          countryCode: US
          line1: "123 Test Street"
          locality: "St George"
          postalCode: "84770"
        }
        person: { companyName: "test Corp", phone: "8018565714" }
        type: ORIGIN
      }
      {
        location: {
          administrativeArea: "Quebec"
          administrativeAreaCode: "QC"
          countryCode: CA
          line1: "2147 Pitfield Blvd"
          locality: "Pierrefonds"
          postalCode: "H9H 3C7"
        }
        person: {
          email: "test@gmail.com"
          firstName: "firstName"
          lastName: "lastName"
          phone: "5022303021"
          companyName: "goProTest"
          metadata: { key: "key", value: "value" }
        }
        type: DESTINATION
      }
    ]
  ) {
    type
    id
    organization
  }
  cartonsCreateWorkflow(
    input: {
      dimensionalUnit: INCH
      height: "5"
      length: "5"
      weight: "5"
      weightUnit: POUND
      width: "10"
    }
  ) {
    items {
      item {
        amount
        id
        quantity
        sku
      }
    }
    length
    width
    weight
    weightUnit
    height
    id
  }
  shipmentCreateWorkflow(
    input: {
      orderId: "order_627db90e-d2e2-4499-b388-bfd5d8d33e18"
      trackingNumber: "1232332342312"
      generateLabel: false
    }
  ) {
    id
  }
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
  "data": {
    "shipmentCreate": {
      "id": "shipment_e633562f-9773-4e69-bfc9-df63c052a847",
      "order": {
        "id": "order_627db90e-d2e2-4499-b388-bfd5d8d33e18"
      },
      "parties": [
        {
          "id": "party_fc99156b-4d5d-4eb5-8ac3-be2b0b36a0b2",
          "type": "ORIGIN",
          "location": {
            "countryCode": "US"
          },
          "person": {
            "firstName": "Jane",
            "lastName": "Doe"
          }
        },
        {
          "id": "party_235f82a-4d5d-4eb5-8ac3-be2b0b36b2d4",
          "type": "DESTINATION",
          "location": {
            "countryCode": "CA"
          },
          "person": {
            "firstName": "John",
            "lastName": "Doe"
          }
        }
      ],
      "serviceLevel": {
        "id": "service_level_8193df42-05d3-4874-be18-2ee72a82210f"
      },
      "shipmentCartons": {
        "id": "shipment_carton_a2f67792-68a4-4f3d-a921-5a9b3be6be69",
        "carton": {
          "id": "carton_a2f67792-68a4-4f3d-a921-5a9b3be6be69",
          "dimensionalUnit": "INCH",
          "height": 5,
          "length": 10,
          "width": 8,
          "weightUnit": "POUND",
          "weight": 2,
          "items": {
            "edges": [
              {
                "node": {
                  "id": "item_eb05ad0c-ad1e-49ea-8aaa-fdb1b5e329ad"
                }
              },
              {
                "node": {
                  "id": "item_eb05ad0c-ad1e-49ea-8aaa-fdb1b5e329ad"
                }
              }
            ]
          }
        }
      }
    }
  }
}

Voiding a shipment 

In the event that you wish to cancel a label that has been created, you can use the following mutation to void the shipment. If labels have been created for the shipment, they will be voided as well. Once a shipment has been voided, it cannot be updated.

Request

1
2
3
4
5
6
7
8
9
10
11
12
mutation {
  shipmentStatusUpdate(
    input: {
      shipment: "shipment_f1fe4dbd-e471-49fa-94e7-84e369083223"
      status: VOIDED
      note: "Voiding shipment"
    }
  ) {
    id
    status
  }
}

Was this page helpful?