I'm developing a custom app. I created a new Fulfillment Service with a callback URL. I want to completely automate the whole workflow without the merchant having to manually fulfill the line items that are part of the fulfillment service (but without enabling the Shopify automatic fulfillment for all orders).
The fulfillment service callback is only called after the line items have been fulfilled, so I can't use that. So I subscribed to the orders/paid webhook topic. Now, I'm notified whenever a new order is placed (and paid) and I can go through the line items to see if there's any line items that are to be fulfilled by my fulfillment service. What I'm having trouble with though is the next step where I need to automatically submit a fulfillment order request because I don't have the assigned fulfillment order id. So my specific question is: Is there a way to query (either via the REST or GraphQL APIs) the unsubmitted assigned fulfillment orders given an order id?
The only way I've found to do this would be to query for all assigned fulfillment orders and look for the one that matches the order id. But there seems to be no way of filtering nor sorting assigned fulfillment orders by date, so this could take a while and I might have to make several API calls to paginate and go through all the results.
Any help would be appreciated. Thanks.
Solved! Go to the solution