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 referenceId
for this party MUST be the account
and accountOrderNumber
joined with a hypen as shown in the example below.
Mutation
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
{
"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
{
"data": {
"shipFrom": {
"id": "party_ac64040b-228e-424c-a090-6da03197011d",
"location": {
"countryCode": "US"
}
}
}
}
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
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
{
"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
}
}
]
}
}
]
}
}
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
mutation CreateShipment($createShipment: ShipmentCreateInput!) {
shipmentCreate(input: $createShipment) {
id
customSpec {
id
}
shipmentCartons {
carton {
id
}
}
}
}
Variables
{
"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
{
"data": {
"shipmentCreate": {
"id": "shipment_a125e480-369c-4606-abf8-ff34295b15cb",
"customSpec": {
"id": "customsSpec_a19875ec-b85c-11ed-afa1-0242ac120002"
}
}
}
}
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.