DOCS

Calculate landed cost graphql

/

Calculate a landed cost

Learn how to calculate duty and tax with GraphQL.

GraphQL

Zonos offers a total landed cost calculation, including the sum of duties, taxes, and additional fees from customs, brokers, or the shipping carrier.

Required details for calculations 

To get an accurate landed cost quote using Zonos, you will need to supply as much as detail as possible.

HS codes

If you do not pass in an hsCode, the default hsCode assigned to your store will be used. We highly recommend using product-specific HS codes as it leads to a more accurate landed cost quote. If you need help generating HS codes for your products, learn about Zonos Classify and how to request a classification.

Powering landed cost calculations with Classify

If you do not pass in an hsCode, we'll first check Zonos Catalog to see if you have an HS code for your item. If you don't, we'll call Classify to generate a classification to power your landed cost calculation based on the following itemCreateWorkflow product detail fields: description, category, and material. If your product detail fields are not detailed enough to generate a classification based on Classify's confidence scoring, the default hsCode assigned to your store will be used.

By default, if you do not supply an hsCode and we call Classify, the hsCode generated by Classify will not be returned in the response as it will only be utilized internally to generate your landed cost. However, if you have a Classify subscription, we'll return Classify's HS code in your landed cost response, create a Catalog item if one doesn't already exist, and store your HS code for future use.

Shipping cost

Calculate shipping for the Landed Cost

If you would like Zonos to calculate the shipping costs, you will use the shipmentRatingCalculateWorkflow portion of the request. The shipment options returned in the calculated shipping response will correlate with the serviceLevels you have assigned to shipping profiles in Dashboard. If you are expecting a serviceLevel in the response but it does not show up, please ensure that that serviceLevel is enabled and is supported by the method you selected.

Enter shipping costs manually for the Landed Cost

If you know the serviceLevel and amount for a shipment, you can pass those in the shipmentRatingCreateWorkflow portion of the request. We will use those values to calculate any associated carrier fees and return those in the response.

Calculated shipping
Manual shipping

Mutation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
mutation {
  partyCreateWorkflow(
    input: [
      {
        location: {
          administrativeArea: "Utah"
          administrativeAreaCode: "UT"
          countryCode: US
          line1: "345 N 2450 E"
          line2: "#151"
          locality: "St George"
          postalCode: "84790"
        }
        type: ORIGIN
      }
      {
        location: {
          administrativeArea: "BC"
          administrativeAreaCode: "BC"
          countryCode: CA
          line1: "27 Sussex Dr."
          locality: "Victoria"
          postalCode: "V8T 2V9"
        }
        person: {
          email: "test@gmail.com"
          firstName: "firstName"
          lastName: "lastName"
          phone: "5022303021"
          companyName: "goProTest"
          metadata: { key: "key", value: "value" }
        }
        type: DESTINATION
      }
      {
        type: PAYOR
        location: {
          administrativeArea: "ON"
          administrativeAreaCode: "ON"
          countryCode: CA
          latitude: 1.2
          line1: "asdf"
          line2: "asdf"
          locality: "locality"
          longitude: 3423.2
          postalCode: "M4C 1A1"
        }
        person: {
          email: "test@gmail.com"
          firstName: "firstName"
          lastName: "lastName"
          phone: "5022303021"
          companyName: "goProTest"
          metadata: { key: "key", value: "value" }
        }
      }
    ]
  ) {
    type
    id
    organization
  }

  itemCreateWorkflow(
    input: [
      {
        amount: 69
        currencyCode: USD
        countryOfOrigin: US
        quantity: 1
        productId: "productId"
        hsCode: "1006.30"
        description: "description"
        measurements: [
          { type: WIDTH, value: 2, unitOfMeasure: CENTIMETER }
          { type: WEIGHT, value: 2, unitOfMeasure: POUND }
        ]
      }
      {
        amount: 62
        currencyCode: CAD
        countryOfOrigin: US
        hsCode: "1006.30"
        quantity: 1
        productId: "productId2"
        description: "description2"
        measurements: [
          { type: WIDTH, value: 2, unitOfMeasure: CENTIMETER }
          { type: WEIGHT, value: 2, unitOfMeasure: POUND }
        ]
      }
    ]
  ) {
    id
    amount
  }
  cartonizeWorkflow {
    id
    type
    items {
      item {
        id
      }
    }
  }
  shipmentRatingCalculateWorkflow {
    id
    amount
  }
  landedCostCalculateWorkflow(
    input: { endUse: FOR_RESALE, method: DAP, tariffRate: ZONOS_PREFERRED }
  ) {
    id
    duties {
      amount
      currency
    }
    taxes {
      amount
      currency
    }
    fees {
      amount
      currency
    }
  }
}
Calculated shipping
Manual shipping

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
{
  "data": {
    "partyCreateWorkflow": [
      {
        "type": "ORIGIN",
        "id": "party_749959ae-b9ff-4de4-b4ac-59cc990c53ba",
        "organization": "organization_dbb64939-12d7-4f12-98ea-7ae5b21acfd0"
      },
      {
        "type": "DESTINATION",
        "id": "party_cd7ff245-76b6-464f-a7bf-151ebe1f8833",
        "organization": "organization_dbb64939-12d7-4f12-98ea-7ae5b21acfd0"
      },
      {
        "type": "PAYOR",
        "id": "party_00e63a9e-9735-44d9-b129-3b3e76c5df25",
        "organization": "organization_dbb64939-12d7-4f12-98ea-7ae5b21acfd0"
      }
    ],
    "itemCreateWorkflow": [
      {
        "id": "item_eb27f071-de8b-4578-9db9-ae69aaf9be3e",
        "amount": 69
      },
      {
        "id": "item_fffa8ba8-cc8d-4e13-bed6-55044a71c115",
        "amount": 62
      }
    ],
    "cartonizeWorkflow": [
      {
        "id": "carton_b34b29c1-ce27-464b-b91b-df8e4a696312",
        "type": "PACKAGE",
        "items": [
          {
            "item": {
              "id": "item_eb27f071-de8b-4578-9db9-ae69aaf9be3e"
            }
          },
          {
            "item": {
              "id": "item_fffa8ba8-cc8d-4e13-bed6-55044a71c115"
            }
          }
        ]
      }
    ],
    "shipmentRatingCalculateWorkflow": [
      {
        "id": "shipment_rating_96787309-9510-43cc-b4fa-c341ff80f4cc",
        "amount": 173.2
      },
      {
        "id": "shipment_rating_b0ccb109-7794-4c7c-b5cc-e2cfbbc5c8ac",
        "amount": 190.1
      }
    ],
    "landedCostCalculateWorkflow": [
      {
        "id": "landed_cost_74d3ce11-bff2-4326-9e6f-368e03ac88b4",
        "duties": [
          {
            "amount": 0.0,
            "currency": "USD"
          },
          {
            "amount": 0.0,
            "currency": "USD"
          }
        ],
        "taxes": [
          {
            "amount": 3.45,
            "currency": "USD"
          },
          {
            "amount": 3.1,
            "currency": "USD"
          },
          {
            "amount": 0.0,
            "currency": "USD"
          },
          {
            "amount": 0.0,
            "currency": "USD"
          }
        ],
        "fees": [
          {
            "amount": 0.13,
            "currency": "USD"
          },
          {
            "amount": 1.44,
            "currency": "USD"
          }
        ]
      },
      {
        "id": "landed_cost_7bbfd354-028c-457f-8c8e-c81bb8fa09a0",
        "duties": [
          {
            "amount": 0.0,
            "currency": "USD"
          },
          {
            "amount": 0.0,
            "currency": "USD"
          }
        ],
        "taxes": [
          {
            "amount": 3.45,
            "currency": "USD"
          },
          {
            "amount": 3.1,
            "currency": "USD"
          },
          {
            "amount": 0.0,
            "currency": "USD"
          },
          {
            "amount": 0.0,
            "currency": "USD"
          }
        ],
        "fees": [
          {
            "amount": 0.13,
            "currency": "USD"
          },
          {
            "amount": 1.44,
            "currency": "USD"
          }
        ]
      }
    ]
  }
}

Was this page helpful?


© 2023 Zonoszonos.com