DOCS

Retrieve order details

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.

1

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.

2

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.

1query order($orderId: String!) {
2 order(orderId: $orderId) {
3 # ... other field names here
4 }
5}
3

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

1query order($orderId: String!) {
2 order(orderId: $orderId) {
3 accountOrderNumber
4 amountSubtotals {
5 duties
6 taxes
7 fees
8 shipping
9 items
10 }
11 landedCosts {
12 id
13 rootId
14 tariffRate
15 duties {
16 amount
17 currency
18 formula
19 item {
20 id
21 description
22 }
23 exchangeRate {
24 rate
25 sourceCurrencyCode
26 targetCurrencyCode
27 }
28 }
29 fees {
30 amount
31 currency
32 description
33 note
34 formula
35 type
36 item {
37 id
38 description
39 }
40 exchangeRate {
41 rate
42 }
43 }
44 taxes {
45 amount
46 currency
47 formula
48 item {
49 id
50 description
51 }
52 exchangeRate {
53 rate
54 }
55 }
56 deMinimis {
57 formula
58 method
59 note
60 threshold
61 type
62 }
63 shipmentRating {
64 id
65 amount
66 currencyCode
67 displayName
68 minTransitAt
69 maxTransitAt
70 details {
71 amount
72 carrierCode
73 type
74 }
75 amountSubtotals {
76 shipping
77 fuelSurcharge
78 insuranceCost
79 otherSurcharge
80 }
81 shipmentRatingCartons {
82 chargeableWeight
83 carton {
84 length
85 width
86 height
87 weight
88 }
89 }
90 shippingProfile {
91 id
92 customServiceLevelCode
93 landedCostMethod
94 serviceLevel {
95 code
96 }
97 }
98 }
99 }
100 }
101}

Was this page helpful?