Create shipments via API
After calculating a Landed Cost and creating an order, you can send tracking numbers and other shipment details to Zonos through the API.
Use this workflow when you're creating a shipment for an existing order and don't need to modify item or party details. It supports optional tracking numbers, fulfillment centers, and service level selection.
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
mutation CreateShipment($input: ShipmentCreateWorkflowInput!) {
shipmentCreateWorkflow(input: $input) {
id
status
trackingDetails {
number
}
serviceLevel {
id
name
carrier {
id
name
}
}
shipmentCartons {
id
carton {
id
width
length
height
weight
items {
item {
id
amount
description
}
}
}
label {
url
trackingNumber
id
documentFiling
}
}
}
}
Basic Variables
1
2
3
4
5
6
{
"input": {
"generateLabel": true,
"orderId": "order_12345678-1234-1234-1234-123456789abc"
}
}
With Fulfillment Center
1
2
3
4
5
6
7
{
"input": {
"generateLabel": true,
"orderId": "order_12345678-1234-1234-1234-123456789def",
"fulfillmentCenter": "fulfillment_center_12345"
}
}
With Custom Tracking
1
2
3
4
5
6
7
{
"input": {
"generateLabel": false,
"orderId": "order_12345678-1234-1234-1234-123456789ghi",
"trackingNumbers": ["tracking_example_1", "tracking_example_2"]
}
}
With Service Level
1
2
3
4
5
6
7
{
"input": {
"generateLabel": true,
"orderId": "order_12345678-1234-1234-1234-123456789jkl",
"serviceLevel": "dhl.express_example"
}
}
Void a shipment
To cancel a created label, use the following mutation to void the shipment. Any associated labels will also be voided automatically. Note that once a shipment is voided, it cannot be updated or restored.
Mutation
1
2
3
4
5
6
7
8
9
10
11
12
mutation {
shipmentStatusUpdate(
input: {
shipment: "shipment_12345678-1234-1234-1234-123456789stu"
status: VOIDED
note: "Voiding shipment"
}
) {
id
status
}
}
Create a shipment
Create shipments with the Zonos API using GraphQL mutations.
GraphQL
If you're integrated with the Zonos API and approved to ship outside of Dashboard, use the
shipmentCreateWorkflow
mutation to create shipments and provide tracking information. These mutations also allow you to inform Zonos about domestic shipments to cross-docking facilities.Note: If you're using a Duty and Tax app with a platform that automatically syncs tracking numbers to Zonos, or if you're shipping directly through Dashboard, these mutations are not required.