Is it Possible to Schedule a FulfillmentOrder?

Is it Possible to Schedule a FulfillmentOrder?

Lawrence_Montgo
Shopify Partner
2 0 0

We are building a custom fulfillment app for our specific use case.

We get a lot of pre orders on our products so we want to use the 'schedule' status of FulfillmentOrders to set a date they are scheduled to be fulfilled.


But when we grab fulfillmentOrder data, it tells us the only actions we can take are:

'supported_actions': ['create_fulfillment', 'move', 'hold'],

 

Despite this, we tried to make a request to the GraphQL as follows:

 
fulfill_at_datetime = datetime.strptime(latest_release['release_date'], '%Y-%m-%d') - timedelta(days=self.n_days_before_release)
fulfill_at_datetime = fulfill_at_datetime.strftime('%Y-%m-%d %H:%M:%S')
data = {
"fulfillment_order": {
"new_fulfill_at": fulfill_at_datetime
}
}
url = f"https://{SHOPIFY['URL']}/admin/api/{SHOPIFY['API_VERSION']}/fulfillment_orders/{fulfillment_order['fulfillment_orders']['id']}/reschedule.json"
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Shopify-Access-Token": "xyz",
}
resp = requests.post(url, headers=headers, data=json.dumps(data))
 
 
but we get a 422 response with error message saying {'errors': ['Fulfillment order must be scheduled.']}

So - is it possible to schedule FulfillmentOrders? If so, how?!

Thanks!
Reply 1 (1)

Eric-HAN
Shopify Partner
180 25 20

Hi, there

before you do reschedule operation  ,you need to confirm the fulfillment order status. if it's scheduled, you can go on your reschedule operation.

Also you need to check the fulfillAt field, when the date reaches, it will move to open state.

you could Reschedules the fulfill_at time of a scheduled fulfillment order .
you can this api to update the fulfillAt field to a new date and time.

- Helpful? Please hit Like and mark it as a solution
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me    Buy Me A Coffee