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.
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.
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.
query GetCustomsSpec($referenceId: String!) { customsSpecByReference(referenceId: $referenceId) { id currencyCode amountSubtotals { items shipping } reasonForExport incoterm declarationStatement attributes { type value } serviceLevel { name code carrier { name code } } parties { id type person { companyName firstName lastName email phone } location { countryCode line1 locality postalCode administrativeAreaCode administrativeArea } } customsItems { id amount quantity hsCode hsCodeSource description countryOfOrigin items { id amount currencyCode quantity } } }}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.
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.