Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: How to fulfill only specific order items of an order (partial fulfillment) using rest API

How to fulfill only specific order items of an order (partial fulfillment) using rest API

Aniket-Chopade
Shopify Partner
5 0 0

When a merchant clicks on "Request Fulfillment" they request a fulfillment on all order items in an order.

In the scenario that certain order items cant be fulfilled by our app due to lack of availability of delivery partner while other specific items can only be fulfilled by us because inventory management and control rests with our app what is the correct way to initiate deliveries of specific items while denying others

On following the guide here it seems that there is no option to reject fulfillment request on per order item basis
https://shopify.dev/docs/apps/build/orders-fulfillment/fulfillment-service-apps/build-for-fulfillmen...

Replies 6 (6)

Liam
Community Manager
3108 344 911

Hi Aniket,

 

This may be easier to achieve with GraphQL API rather than the REST API, using the fulfillmentCreateV2 mutation. First, you need to identify the fulfillment order and the specific line items you want to fulfill. You can retrieve this information using the order query to get the fulfillment orders associated with an order. Then you'd use the fulfillmentCreateV2 mutation to create a fulfillment for the specific line items. You need to provide the fulfilmentOrderId and specify the fulfilmentOrderLineItems  with their respective IDs and quantities. 

 

 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

AnshumanPanda
Shopify Partner
4 0 0

Hey Liam,

We also wanted the same thing.

We wanted to reject on per order item basis..

Using fulfillmentCreateV2, i can mark some items as fulfilled but i wanted other items for which inventory is not present to be rejected.

Any help on how to solve this?

Eric-HAN
Shopify Partner
282 30 30

HI, there

Why dont you split your order into tow fulfllment orders?

- 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
AnshumanPanda
Shopify Partner
4 0 0

Hi,

I tried that..

But i was not able to split the order after the order was marked as 'fulfillment requested' in admin console. The error was 

Fulfillment order: XXX is currently not in a splittable state.

 

Our flow is onto our fulfillment app location, the order is dropped which can contain multiple Skus.

While fulfilling on our end, some order line items can be fulfilled while others mayn't be able to be fulfilled due to some reasons.

We want to somehow tell Shopify these particular order items can't be fulfilled.

Eric-HAN
Shopify Partner
282 30 30

1. cancel request
2.split the order 
3.request fulfillment order 
Is it Ok?

- 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
AnshumanPanda
Shopify Partner
4 0 0

Thanks for this Eric!!..

These steps worked from API also.

Upvoting...