DOCS

Platform shipment integration

Create shipments from your platform

Give customers the ability to create Zonos shipments and labels from your platform.

This guide is designed for shipping platform developers who want to integrate Zonos shipment creation capabilities into their platform for their customers. If you're already using the Zonos API and just need to create shipments for existing orders instead, see our shipment creation guide.

If you are a shipping platform that supports Zonos customers shipping internationally, integrating with Zonos for shipment creation should be a top consideration. This will allow you to offer the most seamless experience for your merchants and their customers by leveraging your platform's existing features while letting Zonos manage the creation of the shipment, label, and supporting customs documentation.

Advantages of using Zonos to create shipments include:

  • Third-party billing of duties and taxes - We will ensure that you or your merchant's carrier account number is used for shipping charges while the bills for duty and tax come to Zonos.
  • Flexibility - Instead of performing dev work to ensure that you can generate compliant labels with your platform, integrate with our API and leave the ever-changing cross-border compliance to us.
  • Accurate customs documentation - When you use Zonos to generate labels, we ensure that the right details are passed to the carrier to ensure that the package clears customs quickly.

This guide will walk you through the steps to implement a complete end-to-end integration that will allow you to call Zonos for shipments from your platform.

Enable label printing 

Follow the steps below to allow your customers to retrieve Zonos labels from your platform.

1

Allow API credentials

The Zonos API is accessible by a credentialToken. Your platform will need to give customers the ability to enter their credentialToken from the Zonos Dashboard into your platform. From here, you will be able to make requests to Zonos on their behalf.

2

Create a shipment

In order to retrieve a label, you are required to create a shipment that the label will be associated with. Zonos manages this process with a workflow that creates shipments and labels in the same request. When performing this mutation, you do not need to pass a serviceLevel as we will use the serviceLevel used from the landedCost that is tied to the order. For the orderId, you can use the Zonos order ID or the accountOrderNumber that will likely already be in your system.

When a shipment and labels are created successfully, we will return labels as a labelImage which is a BASE64_ENCODED_IMAGE, or as a url where the label can be fetched from.

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, service level selection, and declared value insurance.

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"
  }
}

With declared value insurance

1
2
3
4
5
6
7
{
  "input": {
    "generateLabel": true,
    "orderId": "order_12345678-1234-1234-1234-123456789mno",
    "isDeclaredValue": true
  }
}

Declared value

Set "isDeclaredValue": true to enable declared value coverage for all items in your shipment. Zonos automatically claims the full value of all items submitted in the order; merchants cannot modify this amount. This sets the maximum liability the carrier will accept in case of loss, damage, or theft during transit. This feature is only supported for UPS, FedEx, and DHL shipments. Zonos automatically handles the carrier-specific implementation when you enable declared value, including the appropriate parameters in our API calls to these carriers, so you don't need to manage different carrier requirements.

UPS limitations: UPS only covers values between 100-50,000 USD and processes declared value at the carton level. For multi-carton shipments, merchants must split the shipment to designate coverage per carton. UPS also generates an additional insurance form that must be printed with the labels.

FedEx and DHL: Process declared value at the shipment level with no additional restrictions.

3

Void a shipment

In the event that a customer wants to void a shipment, you can use the following mutation that will void all labels tied to the shipment.

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?