DOCS

Retrieve customs details

Retrieve customs details

Retrieve order details to prepare a shipment.

GraphQL

If you are a partner of Zonos and are working with a customer that uses your platform for shipping, you can call Zonos for details about the order. These details can be used in your label request to the carrier to ensure that the details passed are the same details used to ensure that Zonos guarantees the duties and taxes assessed on that shipment. We will return details about tax IDs, items, including HS codes and customs descriptions, and account numbers that should be billed for duties and taxes.

Call Zonos for customs details 

Follow the steps below to allow your customers to retrieve customs details that can be used when creating shipments from your platform.

1

Allow customers to pass in their Zonos 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

Query customs details

Use the following query to pull back customs details needed to create the shipment. For the orderId, you can use the Zonos order ID or the accountOrderNumber that will likely already be in your system.

1query GetCustomsSpec($referenceId: String!) {
2 customsSpecByReference(referenceId: $referenceId) {
3 id
4 currencyCode
5 amountSubtotals {
6 items
7 shipping
8 }
9 reasonForExport
10 incoterm
11 declarationStatement
12 attributes {
13 type
14 value
15 }
16 serviceLevel {
17 name
18 code
19 carrier {
20 name
21 code
22 }
23 }
24 parties {
25 id
26 type
27 person {
28 companyName
29 firstName
30 lastName
31 email
32 phone
33 }
34 location {
35 countryCode
36 line1
37 locality
38 postalCode
39 administrativeAreaCode
40 administrativeArea
41 }
42 }
43 customsItems {
44 id
45 amount
46 quantity
47 hsCode
48 hsCodeSource
49 description
50 countryOfOrigin
51 items {
52 id
53 amount
54 currencyCode
55 quantity
56 }
57 }
58 }
59}
3

Create the shipment with the carrier

Once you have pulled in the customs details for an order, you can use those details in your request to the carrier. When you retrieve the label and tracking number back from the carrier, you can use the shipmentCreate mutation, to tell Zonos about the tracking number so that we can update the status of the order.

Was this page helpful?