MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
946 stars 277 forks source link

Polling Shopify API #362

Closed chhatch closed 4 years ago

chhatch commented 4 years ago

I'm using this library to create draft orders. From the Shopify docs:

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.

I didn't see anything about this in the documentation here or in the response I get from creating a draft order. How is this handled?

lpinca commented 4 years ago

It is done automatically. See https://github.com/MONEI/Shopify-api-node/blob/066c49589c9cee5290089773bd52e45406956604/index.js#L138-L149