Retrieve a single document
Supply information needed to retrieve a single Zonos-generated customs document.
To retrieve a single customsSpec
, a user can query by the ID of the customsSpec
they want to return.
Query
query CustomsSpec($id: ID!) {
customsSpec(id: $id) {
id
deliveryDutyPaid
declarationStatement
amountSubtotals {
duties
fees
insurance
shipping
}
customsItems {
items {
id
}
}
}
}
Variables
{
"id": "customs_spec_66b544c9-439f-4a82-b5bb-1a00274e8a61"
}
Response
{
"data": {
"customsSpec": {
"id": "customs_spec_66b544c9-439f-4a82-b5bb-1a00274e8a61",
"declarationStatement": "I declare this is a declaration statement",
"amountSubtotals": {
"duties": 10.0,
"fees": 5.0,
"insurance": 10.0,
"shipping": 15.99
},
"customsItems": [
{
"items": [
{
"id": "test_item_123"
}
]
}
]
}
}
}
Retrieve multiple documents
Supply information needed to retrieve multiple Zonos-generated customs documents.
In scenarios where a user would like to pull back multiple customsSpecs
by DateTimeRange
and trackingNumber
, the following query can be used.
Query
query CustomsSpecs($first: Int, $filter: CustomsSpecFilter) {
customsSpecs(first: $first, filter: $filter) {
edges {
node {
id
amountSubtotals {
duties
fees
insurance
}
}
}
}
}
Variables
{
"first": 5,
"filter": {
"between": {
"before": "2022-09-25T12:00:00Z",
"after": null
},
"trackingNumber": null
}
}
Response
{
"data": {
"customsSpecs": {
"edges": [
{
"node": {
"id": "customs_spec_ee8eae49-64cd-440e-ac92-3cd90ce4be5b",
"amountSubtotals": {
"duties": 143.0,
"fees": 2.0,
"insurance": 100.0
}
}
},
{
"node": {
"id": "customs_spec_da0015aa-78cc-46c0-9006-bf25e0d7c57f",
"amountSubtotals": {
"duties": 143.0,
"fees": 2.0,
"insurance": 100.0
}
}
},
{
"node": {
"id": "customs_spec_8e8039f5-2e8c-4958-922f-f4dad0bc190f",
"amountSubtotals": {
"duties": 143.0,
"fees": 2.0,
"insurance": 100.0
}
}
},
{
"node": {
"id": "customs_spec_30e31150-13fe-423f-952a-13582454744a",
"amountSubtotals": {
"duties": 143.0,
"fees": 2.0,
"insurance": 100.0
}
}
}
]
}
}
}
Retrieve customs specs
Users of the Zonos Customs API also have the ability to retrieve a customsSpec
based on the accountOrderNumber
, DateTimeRange
, order id
, and the Zonos storeId
. In this scenario, a user will query the orders
DGS as opposed to customsSpec
.
Retrieve documents for orders
Supply information needed to retrieve Zonos-generated customs documentation for a single order.
To retrieve a single customsSpec
, a user can query by the ID of the order
tied to the customsSpec
.
Query
query OrderQuery($id: String!) {
order(orderId: $id) {
id
customsSpecs {
id
amountSubtotals {
taxes
shipping
duties
fees
insurance
items
}
clearanceType
currency
}
}
}
Variables
{
"id": "order_ad8dfd1f-5776-425f-8e4d-a0bd4e7d86e3"
}
Response
{
"data": {
"order": {
"id": "order_ad8dfd1f-5776-425f-8e4d-a0bd4e7d86e3",
"customsSpecs": [
{
"id": "customs_spec_6a4aed06-5303-4e83-965d-2accdb00b600",
"amountSubtotals": {
"taxes": 10.21,
"shipping": 25.99,
"duties": 143,
"fees": 2,
"insurance": 100,
"items": 30.2
},
"clearanceType": "COMMERCIAL",
"currency": "USD"
},
{
"id": "customs_spec_dcbc618c-7480-4651-b59b-d634b0e68e9c",
"amountSubtotals": {
"taxes": 10.21,
"shipping": 25.99,
"duties": 143,
"fees": 2,
"insurance": 100,
"items": 30.2
},
"clearanceType": "COMMERCIAL",
"currency": "USD"
}
]
}
}
}
Retrieve customs documentation
Retrieve one or multiple customs documents for one or mutiple orders.
GraphQL
Once a
customsSpec
has been generated or created for a particular shipment, it can be queried. These queries can be used by anyone who is looking to pull back acustomsSpec
based onid
,dateTimeRange
, ortrackingNumber
.