Shopify Python API Request ISO 8601 Fomat

- 1 answer

The Shopify API reference says:

Show products last updated after date (format: 2014-04-25T16:15:47-04:00)

If I have a datetime object when making an API call, do I need to convert the datetime to a string of ISO 8601 format prior to making the request?

i.e. do I need to do this?

min_date =
shopify.Product.count(created_at_min = str(min_data.isoformat()))

My request would look like this then:


Versus this (if I pass the unformatted datetime object in):


(If so, why doesn't the Shopify Python API handle this conversion automatically, seems kind of silly?)



(From a response to my issue on the Shopify Python repo): The Shopify API actually does accept several date formats, but it's always safest to use the format that is documented in the API documentation (ISO 8601), as this is guaranteed to continue working in the future.

The current Shopify Python module does not currently handle date formatting, because the bulk of the functionality of the library is for wrapping HTTP requests using pyactiveresource - it is largely a port of and hasn't been extended to do this.