DOCS

Create a label

/

Generate labels

Create Labels with Zonos API.

GraphQL

In order to faciliate Zonos' Landed Cost guarantee, you are typically required to ship orders via Zonos Dashboard. If using Dashboard to print labels does not work with your existing processes, you can now generate labels via the Zonos Label API.

Create a label 

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 an existing shipment ID.

During shipment
Post-shipment

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
mutation ShipmentLabelWorkflow(
  $shipmentWorkflowInput: ShipmentCreateWorkflowInput!
  $labelInput: LabelCreateWorkflowInput!
) {
  shipmentCreateWorkflow(input: $shipmentWorkflowInput) {
    id
    status
  }
  labelCreateWorkflow(input: $labelInput) {
    id
    trackingNumber
    status
    documentFiling
    labelImage
    labelAmounts {
      amount
      amountType
    }
    shipmentCarton
    statusTransitions {
      changedAt
      note
      status
    }
  }
}

Variables

1
2
3
4
5
6
7
8
9
10
{
  "shipmentWorkflowInput": {
    "orderId": "order_9da73be6-d574-4403-9470-8b352e74cf4a",
    "serviceLevel": "service_level_8193df42-05d3-4874-be18-2ee72a82210f"
  },
  "labelInput": {
    "labelSize": "FOUR_BY_SIX",
    "labelFileType": "PDF"
  }
}

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
{
  "data": {
    "shipmentCreateWorkflow": {
      "id": "shipment_cd535d6f-c92a-41a9-ae70-f6e67ed30dc9",
      "status": "CREATED"
    },
    "labelCreateWorkflow": [
      {
        "id": "label_171c7cf5-b005-45cb-bac4-2bfc141dbacb",
        "trackingNumber": "794602938880",
        "status": "CREATED",
        "documentFiling": "ELECTRONIC",
        "labelImage": "{{BASE64_ENCODED_IMAGE}}",
        "labelAmounts": [
          {
            "amount": 137.87,
            "amountType": "QUOTE"
          }
        ],
        "shipmentCarton": "shipment_carton_480d776e-48d8-4699-9b37-bc26c7d0cd1b",
        "statusTransitions": [
          {
            "changedAt": "2024-02-09T18:54:37.158Z",
            "note": "Label created",
            "status": "CREATED"
          }
        ]
      }
    ]
  }
}

Was this page helpful?