Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Checkout REST API does not expose the `total_duties` key in its response when getting a Checkout

Checkout REST API does not expose the `total_duties` key in its response when getting a Checkout

JamesGilmore
Shopify Partner
10 1 2

Hey Shopify,

 

Another issue again from me relating to your Checkout API using REST. This time relating to duties!

Issues

When a retailer charges duties for any of their items in the Checkout, the amount is not expose to us when calling the REST API.

 

Shopify's API documentation does show that this field should get expose, but only being shown in examples:

https://shopify.dev/api/admin-rest/2022-10/resources/checkout#get-checkouts-token

(search for `total_duties`).

 

Impact

We only know duties exist implicitly because there is a price discrepancy. i.e.

total_price != total_line_items_price + total_tax + shipping_rate.price - applied_discount.discount

We have to calculate the amount ourselves, which is trivial, until you add the complexity that `total_line_items_price` might include the `total_tax` amount within its total. Even being informed by the `

taxes_included` in the `shop.json` endpoint does not reliably cover this use case.

 

Example

  • retailer: marais-australia-1
  • checkout_token: 8db0b6d2f1e33d6518886a2a65f4eb1e
  • Checkout object (N.B. no `total_duties`)

 

{
    "total_price": "6991.09",
    "total_tax": "0.00",
    "total_line_items_price": "6400.00",
    "shipping_rate": {
        "id": "shopify-Standard%20International-50.00",
        "price": "50.00",
        "title": "Standard International"
    },
    "applied_discount": null,
}

 

 

  • Calculating duties as line_items + tax + shipping - discount != total_price

 

6991.09 - 6400.00 - 50.00 = 541.09

 

 

So total_duties = 541.09. Funnily enough, if you use your web checkout, that exact amount is being reported as the amount of duties to pay!

 

Resolution

Can we have the `total_duties` amount exposed to us on all checkouts, whether any duties exist or not, please?

Replies 0 (0)