We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

shopify PUT request to order keeps failing with Python requests module

shopify PUT request to order keeps failing with Python requests module

mimi33
Excursionist
15 1 5
import requests

access_token = "xxx" headers = { "X-Shopify-Access-Token": access_token, "Content-Type": "application/json", } url = "https://xxx.com/admin/api/2023-01/orders/xxx.json" res = requests.put( url, json={"order": {"id": xxx, "email": "foobar@example.com"}}, headers=headers, )

I am trying to make a PUT request to the Orders REST API. The exact same request works fine with cURL, but does not work with python's request library.

Shopify API returns "{"errors":{"order":"Required parameter missing or invalid"}}", even though the order parameter is clearly visible in my request data.

 

Is there something specific to the library that is preventing this API from working?

What is wrong with the above code?

Replies 0 (0)