I am developing a private fulfillment app for our company and after reading through the api specs regarding fulfillment's I want to confirm I understand the "proper" flow for fully completed fulfillment's, and have a couple questions.
- Subscribe to the fulfillment webhook.
- On receipt of a fulfillment, respond with a POST to /admin/orders/450789469/fulfillments/255858046/open.json to open(acknowledge) the fulfillment.
- After shipping the item(s), update the tracking number(s) on the fulfillment with a PUT to /admin/orders/450789469/fulfillments/255858046.json
- Complete the fulfillment with a POST to /admin/orders/450789469/fulfillments/255858046/complete.json.
- Are there shortcuts to this such as, can I set the status of the fulfillment to "success" in step three or does completing the fulfillment as in step 4 do something special to the fulfillment?
- I presume that I will also need to assume that with the webhooks, we'll miss some fulfillment's. I was expecting to find an API that returns all pending fulfillment's but it appears that does not exist. Is the following the right way to retrieve pending fulfillment's?
- Request every order, see if it is in our system.
- If it is not in our system, then request the fulfillment.
- Enter the flow above at step 2.
Thanks for your input.