/
In order to create a label, you are required to create a shipment
that the label will be associated with. You can choose to create a label at the same time as the shipment
or after using the shipment
ID
.
Mutation
mutation CreateShipment($createShipment: ShipmentCreateInput!) {
shipmentCreate(input: $createShipment) {
id
shipmentCartons {
tracking {
id
label {
id
trackingNumber
createdAt
url
}
}
carton {
id
}
}
}
}
Variables
{
"createShipment": {
"orderId": "order_3a369733-3046-4390-b0a4-99a2f8a1c2a2",
"generateLabel": true,
"serviceLevel": "service_level_56489602-42fb-4f47-afb3-2135e87d215d",
"generateCustoms": false
}
}
Response
{
"data": {
"shipmentCreate": {
"id": "shipment_235ac4a5-9e8f-43be-9483-6cf1640c386b",
"shipmentCartons": [
{
"tracking": {
"id": "tracking_544f408e-54f6-478e-84d3-79c02353a065",
"label": {
"id": "label_bd402891-4ec2-4de0-921a-da9b1e5d5963",
"trackingNumber": "CM289918636US",
"createdAt": "2023-04-20T15:29:59.925-06:00",
"url": "https://zonos-prod.s3.amazonaws.com/public/files/label_images/20230420/a2924ff8-d4ce-4480-87c5-e9decd5f2378.pdf"
}
},
"carton": {
"id": "carton_cba16718-452f-4e55-b8f8-370c76849263"
}
}
]
}
}
}
In the event that you wish to cancel a label that has been created, you can use the following mutation to void the label.
Mutation
mutation LabelVoid($input: LabelVoidInput!) {
labelVoid(input: $input)
}
Variables
{
"input": {
"id": "label_58a9811d-a602-4443-9461-1b656d13afdf"
}
}
Response
{
"data": {
"labelVoid": "SUCCESS"
}
}
Generate a label with the Zonos API
Learn how to create and void labels using the Zonos API.COMING SOON
In order to faciliate the Landed Cost guarantee, you are typically required to ship orders via Dashboard. If using Dashboard to print labels does not work with your existing processes, you can now generate labels via the Zonos Label API.