-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating new fulfillment through API throws 406 error #208
Comments
I've inspected the logs, and the URI you are actually posting to is:
It looks like |
Also, not sure if you've tried to obscure those line item IDs or something, but they should be entirely numeric identifiers. |
I think I may have figured out a work around by reading through a lot of the other tickets on eCommerce U. Looks like you have to instantiate a Fulfillment object with the order_id. I have a myriad of questions about this interface however. For example, does line_items have to be an array of line_item() objects or can it be a list of dictionaries that contain the 'id' as a key? Also, it appears that you have to pass a list of tracking_numbers, and sending an individual tracking number as above does not work. It would really be amazing if there were some docs that went with this project. There is lots of confusion about how to use the APIs, and just pointing people at active resources docs are not the same as knowing how to use this tool. |
The IDs are just Long numbers. When storing shopify IDs in the database, they come out as Longs. They are numeric. |
Just in case other people run into this, here is the missing piece: The code that I found works, looks like this:
Closing for now, since it's not a bug but more that this project desperately needs some docs. |
Sorry for the confusion, been spending too much time in Ruby-land. The documentation is here, this library is simply a wrapper. It does assume a bit of knowledge of ActiveResource though, since it's built on The data should be passed as indicated in the documentation – line items is an array of dicts, each with a single key value pair for id. |
Okay, that works. Would it be accurate, that whenever in the docs, there is an endpoint such as /admin/orders/#{id}/fulfillments.json, and I want to create a new Fulfillment, that the order ID has to be passed in on instantiation of the Fulfillment object? Seems like this would be the missing piece that you should add to the README. This is really the missing piece I think. I thought I could instantiate a Fulfillment, and then add the order_id after the fact. But you cannot. OrderID must be provided on instantiation as far as I can tell. |
Thanks for the actionable feedback! Let's re-open this and I'll close it when I've addressed your concerns in the README. |
For now, if you're ever confused about usage I recommend looking at the API docs, and double-checking against the unit tests in this repo when you're confused about specific usage when it relates to ActiveResource. Admittedly, the test that would have clarified this (creating a new fulfilment) doesn't seem to exist, so perhaps should be added. If you're not a Rails developer, this primer on ActiveResource was very helpful for me: http://tutorials.jumpstartlab.com/topics/web_services/active_resource.html |
Closed by #228. |
I'm trying to fulfill orders through the Shopify Python API, but cannot seem to create a new fulfillment without being thrown a 406 error. Here is the code that I have written to reproduce:
Here is the Traceback I get back from the API on this:
The text was updated successfully, but these errors were encountered: