error: "fulfillment": "Required parameter missing or invalid"

Aalen
Visitor
2 0 0

Hi! I am trying to post a fulfillment with python but keep getting this:

{
    "errors": {
        "fulfillment": "Required parameter missing or invalid"
    }
}

Im using this Python code:

postData =  {
                        "fulfillment": {
                            "location_id": f"{location_id}",
                            "line_items": [
                                {
                                    "id": f"{product_id}",
                                    "quantity": 1
                                }
                            ]
                        }
                    }
        
        postDataJson = json.dumps(postData)

        headers = {"Accept": "application/json", "Content-Type": "application/json"}
        rPostData = requests.post(f"{url}/admin/api/2021-04/orders/{orderid}/fulfillments.json", json=postDataJson, headers=headers)

 

Thanks in advance.

 

REGARDS

Reply 1 (1)

garyrgilbert
Shopify Partner
397 40 165

Hi,

 

upgrade to 2023-04. Shopify has stopped supporting api versions younger than 2022-07.

https://shopify.dev/docs/api/admin-rest/2023-04/resources/fulfillment

 

Cheers,

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution