Creating a fulfillment gives 'Line Item {{LINE ITEM ID}} does not exist' but the line item exists'

Andrew-Corknine
Explorer
76 1 29

Hello,

When using API version 2020-04 and creating a fulfillment I am getting a strange error on some orders.

 

The error states

Line Item {{LINE ITEM ID}} does not exist' but the line item exists

 

when passing a line item ID that does exist on the order.  This has only started happening recently.  Is there anyway to get a fix for this?

Replies 6 (6)

hassain
Shopify Staff (Retired)
624 104 187

Hi @Andrew-Corknine ,

 

Could you provide the value of the X-Request-ID header from the Shopify API error response? With this response header we can go through our platform logs and see exactly why this error happened. If you are unable to provide this, please provide information about the Shop, Line Item ID, and query that is causing these errors. 

 

To learn more visit the Shopify Help Center or the Community Blog.

Andrew-Corknine
Explorer
76 1 29

Hi @hassain,

Thank you for getting back to us. 

 

A few request id's with this issue are provided below.  I can provide many more if needed.  Let me know if you need anything else from us or if you find out what is going on and why are are unable to create fulfillments for these items.  Thank You.

 

07c6bd34-0e25-49e3-9e3a-2fb2332b7140

994aa6df-ce85-4370-8661-d21660852d99

69e589d7-3688-411c-955e-fe811bc715c2

70cdf77e-c78e-451c-8e94-fbaaaae2a0c0

 

_JB
Shopify Staff
836 100 222

Hey @Andrew-Corknine,

 

We checked the logs for this one and I believe I can see what's happening. The line_item returning an error was assigned to a fulfillment_service at the time the order was created, but has since been switched to have inventory managed by Shopify. Your API call is attempting to fulfill the item through the fulfillment_service, but the call is failing since the item is no longer assigned to that service.

 

To be honest I'm not 100% sure how the API is supposed to respond when the fulfillment_service has been modified after an order is placed, so I'm going to raise this with our developers for clarification. In the meantime, you can try temporarily re-assigning that variant to the fulfillment service and attempt the fulfillment again. I'll post here with an update when I get word back from our developers.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Andrew-Corknine
Explorer
76 1 29

Hi @_JB 

That seems strange.  I am not really seeing that.  For example on request id 

787bf853-3312-47c6-93b7-952681ebb8da

 

The fulfillment service on the line_item and currently on the variant are both set the the fulfillment service I am trying to create the fulfillment for.  Am I missing something?

_JB
Shopify Staff
836 100 222

Hey @Andrew-Corknine,

 

This request looks different, and the call looks to have been made correctly so I'm not sure where the error is coming from. I'm going to move this to DM so I can get some more details from you. If anyone else reading along is having a similar problem, please let me know here.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

tomasheq84
Shopify Partner
1 0 0

Hi,

I've got the same issue,

I've got all the details that match fulfillment_order, but it still doesn't want to fulfill it

not sure what to do next?

Fulfilment looks like this:

{
"fulfillment": {
"message": null,
"location_id": "35193421885",
"notify_customer": true,
"tracking_info": {
"number": "[tracking]",
"company": "Royal Mail",
"url": "https://www.royalmail.com/track-your-item/?trackNumber=[tracking]"
},
"line_items_by_fulfillment_order": [
{
"fulfillment_order_id": "6117640831037",
"fulfillment_order_line_items": [
{
"id": "12213748629565",
"quantity": 3
},
{
"id": "12213748662333",
"quantity": 3
}
]
}
]
}
}