Get your API key
First, register for a Zonos account and configure your account in Zonos Dashboard. You will then be able to get your API key, which will allow you to authenticate with the Zonos API.
Decide what details to retrieve
Because of how GraphQL works, you can request only the fields you are interested in from the API, or you could choose to request all information the system has relating to an order—the choice is up to you. Consult the GraphQL API reference for available fields.
Information associated with the order such as landed cost quote details, shipment rating details, cart details, etc. can be queried through the graph by adding fields from those objects to your order query.
At a minimum, you need an order number to be able to query the API. This is passed in the orderId field with the variables in your GraphQL request.
query order($orderId: String!) { order(orderId: $orderId) { # ... other field names here }}Send your request
Now that you've built your request and configured it, you can send a POST request to the Zonos API. Make sure to authenticate with your API key and provide the correct version header in your request.
POST https://api.zonos.com/graphql
query order($orderId: String!) { order(orderId: $orderId) { accountOrderNumber amountSubtotals { duties taxes fees shipping items } landedCosts { id rootId tariffRate duties { amount currency formula item { id description } exchangeRate { rate sourceCurrencyCode targetCurrencyCode } } fees { amount currency description note formula type item { id description } exchangeRate { rate } } taxes { amount currency formula item { id description } exchangeRate { rate } } deMinimis { formula method note threshold type } shipmentRating { id amount currencyCode displayName minTransitAt maxTransitAt details { amount carrierCode type } amountSubtotals { shipping fuelSurcharge insuranceCost otherSurcharge } shipmentRatingCartons { chargeableWeight carton { length width height weight } } shippingProfile { id customServiceLevelCode landedCostMethod serviceLevel { code } } } } }}
Retrieve order details
Retrieve your order details with GraphQL.To retrieve details for your international orders in the Zonos system, you can query the GraphQL API. This allows you to retrieve order details and any applicable information tied to an order, such as shipment ratings, landed cost quotes, etc.