Taxes change after initially calculated for draft order

Taxes change after initially calculated for draft order

jc-wagster
Shopify Partner
3 0 2

Hi,

 

We have a flow that simplified looks like this:

 

1. The GraphQL API is used to calculate taxes and eligible shipping rates for a given draft order:

https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/draftOrderCalculate

 

2. Then, the draft order is created with the exact same product and customer details + a shipping rate from the previous API response:

https://shopify.dev/docs/api/admin-rest/2024-01/resources/draftorder#post-draft-orders


3. Using taxes and selected shipping rate from step 1, the collection of payments for these draft orders happen outside Shopify. Once that is done, the draft order is marked as complete and transitioned to a paid order:

https://shopify.dev/docs/api/admin-rest/2024-01/resources/draftorder#put-draft-orders-draft-order-id... 

 

 

We have noticed that in some cases, taxes on the order (and corresponding draft order) changes after it was calculated in step 1. This is a problem because it means that the wrong payment amount was collected.

 

What do we need to do in order to be guaranteed that the taxes on the draft order are final before it transitions to an order?

 

 

In the documentation for the API request in step 2, it says:

Polling

When you create and update draft orders some calculations are done asynchronously, such as calculating shipping and taxes. There might be times when a draft order is created but these calculations haven't completed. In these cases, you need to poll the draft order until the calculations are finished. When a draft order requires polling, a 202 accepted response code is returned along with location and retry-after response headers. The location header refers to the URL to be polled, and retry-after denotes the interval (in seconds) at which polling requests should be sent. When the draft order is ready, a 200 OK response code will be returned.

 

Does this mean that once this API request returns 200 OK, taxes are final?

Replies 0 (0)