Create Fulfillment Service Error

Solved
Highlighted
Tourist
9 1 0

Is this a possible bug in the Create Fulfillment Service endpoint?

 

I copied the exact JSON object from the docs (except making the 'true' to 'True' for python):

 

            payload = {
                "fulfillment_service": {
                    "name": "Jupiter Fulfillment",
                    "callback_url": "http://google.com",
                    "inventory_management": True,
                    "tracking_support": True,
                    "requires_shipping_method": True
                    "format": "json"
                }
            }

headers = {'X-Shopify-Access-Token': store.shopify_token, 'Content-Type': 'application/json'}
r = requests.post("https://{}/admin/api/2019-10/fulfillment_services.json".format(store.url, endpoint), headers=headers, data=payload)

These same headers, etc work for my other Shopify API POST requests, however I'm getting an odd error:

 

822: unexpected token at 'fulfillment_service=name&fulfillment_service=callback_url&fulfillment_service=inventory_management&fulfillment_service=tracking_support&fulfillment_service=requires_shipping_method

 

It's showing fulfillment_service={variable} for every item in the object. Is this a bug?

 

Can anyone reproduce this issue?

 

Thanks,

 

 

Patrick

0 Likes

Success.

Tourist
9 1 0

I can't figure out how to delete this post, so I'll explain my stupid mistake here.

 

I was needing to wrap the payload in json.dumps()

 

That fixed it!

0 Likes