We want to change the default fulfillment assignment for an order; currently you can do this through the backend; which looks to POST:
with form data that has to, from location_id and the lineitems.
This also has authenticity_token as part of the form data; which is not part of the normal API token.
What is the best way to reassign the fulfillment location for an order?
I've read the documentation at:
But this only allows me to essentially create a fulfillment and provide a location_id; but in my case; I only need to reassign the default. (which is easily done via the backend).
Does anyone know the best way to perform this task? (or maybe I just do the form_data post to the endpoint but somehow get an authenticity_token?
Any ideas would be appreciated.
(Our current customer service must always update orders when they come in and change the fulfillment location for every order because the default location is only correct 15% of the time and using simple priority rules won't make sense for us)
Thanks - bill
in my case; it's even before it's created - it's when the order is created; it defaults to the highest priority location; and on every order; the customer service rep must update that location by changing it via the backend to match the correct location. So I was thinking about creating a hook that everytime an order is created; I'd update the default location being used.
When this is done in the backend admin; it doesn't create a fulfillment; as a matter of fact; I have no idea what it does; but for some reason; it remembers it. What I did verify is that it calls the fulfillment_location_reassignments. I could do the same thing if I had the ability to generate an authenticity_token.
My app Location Based Fulfillment https://apps.shopify.com/location-based-fulfillment might be able to help. It allows you to create rules to route and fulfill orders based on the shipping address of the order.
Check it out and let me know if you have any questions