Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shopify fulfillment

Tags:

json

The online shopify docs for fulfillment show this example:

POST /admin/orders/#{id}/fulfillments.json  

{  
  "fulfillment": {  
    "tracking_number": null,  
    "line_items": [  
      {  
       "id": 466157049  
      }  
     ]  
  }  
}  

The docs also say that not specifying an item id will cause all items to fulfill.

My postdata to that api endpoint reads:

{"fulfillment":{"tracking_number":null}}  

This comes back:

{"errors":{"fulfillment":"can't be blank"}}

I have tried this:

{"fulfillment":{"tracking_number":null,"line_items":[{"id":300668234}]}}

which is a valid item id for my order. The same message comes back.

Ideas?

like image 916
Michael Greer Avatar asked Dec 06 '25 05:12

Michael Greer


1 Answers

Are you setting your Content-Type to application/json?

Trying sending the same request using cURL

curl -X POST -H 'Content-Type: application/json' -d @fulfillment.json https://API_KEY:[email protected]/admin/orders/ORDER_ID/fulfillments.json

If that works, it means you aren't sending your request correctly.

like image 86
csaunders Avatar answered Dec 07 '25 21:12

csaunders



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!