DOCS

Match orders to get customs info

/

Retrieve customs documentation for an order

Get customs info for an existing order.

GraphQL

If you are a partner of Zonos and we share mutual customers, you can use Clear to update and retrieve complete customs documentation on an existing Zonos order. You can retrieve customs data on a shipment where the shipper may have provided missing or inaccurate information. For example, it is common for a shipper to provide a poor description or not provide an HS code. Zonos can add, supplement, or improve information such as a description, HS code, country of origin, prices, and more.

1

Create the origin party

Zonos will be unable to know the origin of this shipment as the label was not manifested in the Zonos dashboard. To ensure that we can pull back the proper order details, you need to create a party with the origin details including the account and accountOrderNumber as the referenceId. The referenceIdfor this party MUST be the account and accountOrderNumber joined with a hypen as shown in the example below.

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
mutation originParty {
  partyCreate(
    input: {
      referenceId: "100051-O-1434321"
      person: {
        firstName: "John"
        lastName: "Doe"
        email: "test@test.com"
        phone: "5555555555"
      }
      location: {
        administrativeArea: "Utah"
        administrativeAreaCode: "UT"
        countryCode: US
        line1: "348 N 2450 E"
        line2: "#245"
        locality: "St George"
        postalCode: "84790"
      }
      type: ORIGIN
    }
  ) {
    id
  }
}

Variables

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "shipFrom": {
    "type": "ORIGIN",
    "referenceId": "root_cd8d3d85-283f-4865-af77-9cda0c123c0a",
    "location": {
      "administrativeArea": "Utah",
      "administrativeAreaCode": "UT",
      "countryCode": "US",
      "line1": "370 Buena Vista Boulevard",
      "locality": "St. George",
      "postalCode": "84790"
    }
  }
}

Response

1
2
3
4
5
6
7
8
9
10
{
  "data": {
    "shipFrom": {
      "id": "party_ac64040b-228e-424c-a090-6da03197011d",
      "location": {
        "countryCode": "US"
      }
    }
  }
}
2

Retrieve the Zonos orderId

Supply Zonos with the account number of the merchant as well as their accountOrderNumber to match the details from your system with the order in our system. The API reference can be found here.

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
mutation {
  orderLink(input: { account: "10051", accountOrderNumber: "1434321" }) {
    id
    root {
      id
      parties {
        id
        type
        location {
          countryCode
          postalCode
        }
      }
      items {
        id
        description
      }
      shipmentRatings {
        id
      }
      landedCosts {
        amountSubtotals {
          duties
          taxes
          fees
          shipping
        }
      }
    }
  }
}

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
{
  "data": {
    "orderLink": [
      {
        "id": "order_cd6bca4e-6da4-430c-aaf3-7a8b161627a4",
        "root": {
          "id": "100051-O-1434321",
          "parties": [
            {
              "id": "party_2fdf56a0-2bb2-4443-b8ca-a984d335ffcf",
              "type": "ORIGIN",
              "location": {
                "countryCode": "US",
                "postalCode": "84790"
              }
            },
            {
              "id": "party_9b3ac542-da12-4869-bcf4-00f42af17f6f",
              "type": "DESTINATION",
              "location": {
                "countryCode": "FR",
                "postalCode": "47310"
              }
            }
          ],
          "items": [
            {
              "id": "item_c0a329ef-d157-4fa2-8982-be4420717f64",
              "description": "Monoprice 4-Port SATA Serial ATA PCI RAID Controller Card, Silicon Image"
            },
            {
              "id": "item_67e9fd3f-8f84-4027-9b06-f6b26915d1d2",
              "description": "CORSAIR iCUE H115i RGB PRO XT, 280mm Radiator, Dual 140mm PWM Fans, Software Control, Liquid CPU Cooler, CW-9060044-WW LGA 1700 Compatible"
            }
          ],
          "shipmentRatings": [
            {
              "id": "shipment_rating_fc73d892-1336-47c5-a620-40903388332d"
            }
          ],
          "landedCosts": [
            {
              "amountSubtotals": {
                "duties": 53.67,
                "taxes": 147.89,
                "fees": 42.37,
                "shipping": 15.0
              }
            }
          ]
        }
      }
    ]
  }
}
3

Create a shipment

The final step to retrieving customs information for a shipment is creating the shipment itself. Part of this flow is creating the shipmentCarton that contains the item details for the shipment that are necessary for the customsSpec. The shipment will automatically generate a customs object if you pass true in the generateCustoms field.

Mutation

1
2
3
4
5
6
7
8
9
10
11
12
13
mutation CreateShipment($createShipment: ShipmentCreateInput!) {
  shipmentCreate(input: $createShipment) {
    id
    customSpec {
      id
    }
    shipmentCartons {
      carton {
        id
      }
    }
  }
}

Variables

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "createShipment": {
    "orderId": "order_3a369733-3046-4390-b0a4-99a2f8a1c2a2",
    "trackingNumber": "12345",
    "generateCustoms": true,
    "parties": [
      "party_2fdf56a0-2bb2-4443-b8ca-a984d335ff3g",
      "party_5c928cde-67fa-4ee4-b77a-2628fbcd5ac9"
    ],
    "serviceLevel": "custom.custom",
    "shipmentCartons": [
      {
        "height": 10,
        "length": 10,
        "width": 10,
        "weight": 1,
        "items": ["item_8a0ecee9-42ff-4544-9610-8e8d679ef0a3"]
      }
    ]
  }
}

Response

1
2
3
4
5
6
7
8
9
10
{
  "data": {
    "shipmentCreate": {
      "id": "shipment_a125e480-369c-4606-abf8-ff34295b15cb",
      "customSpec": {
        "id": "customsSpec_a19875ec-b85c-11ed-afa1-0242ac120002"
      }
    }
  }
}

Was this page helpful?