Re: can't complete order because of error "Product variant not found..."

Solved

can't complete order because of error "Product variant not found..."

sengming
Shopify Partner
52 1 9
 
The response I get is (X-Request-ID: 52202645-301e-4a2b-8a10-c07188d4eba9)
```
{
    "errors": "Product variant not found., Your cart has been updated and the items you added can’t be shipped to your address. Remove the items to complete your order., and Your payment couldn’t be processed because your order total has changed. Check your order total and try again."
 
}
```
 
Note that the product variant exists!
 
What should I do?
 
Request
```
PUT /admin/api/2023-07/draft_orders/1141814067476/complete.json HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 0
Content-Type: application/json
User-Agent: HTTPie/3.2.2
```
 
Response
```
Response
```
HTTP/1.1 422 Unprocessable Entity
X-Request-ID: 52202645-301e-4a2b-8a10-c07188d4eba9
{
 
    "errors": "Product variant not found., Your cart has been updated and the items you added can’t be shipped to your address. Remove the items to complete your order., and Your payment couldn’t be processed because your order total has changed. Check your order total and try again."
 
}
```
Accepted Solution (1)
ranjan-purbey
Shopify Partner
11 1 5

This is an accepted solution.

Looks like shopify has fixed the issue on their end

View solution in original post

Replies 18 (18)

Haven_LM
Tourist
3 0 1

Hi Sengming, I'm experiencing the same issue. Did you find a solution for this? 

sengming
Shopify Partner
52 1 9

Nope! No solution yet unfortunately, just a bunch of angry customers =(

 

I'll keep the thread updated if I find anything.

Liam
Community Manager
3108 340 872

Hi Sengming,

 

Can you check if there is correct shipping rates and options enabled for this order / address as well as that the variants are in available in stock?

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

sengming
Shopify Partner
52 1 9

> Can you check if there is correct shipping rates and options enabled for this order / address

 

I'm not totally sure what this means. The shipping line and shipping address is set correctly for this order. Was there anything else you were looking for?

 

> as well as that the variants are in available in stock?

 

Yes the variants are in stock.

sengming
Shopify Partner
52 1 9

Note that the draft order from the original post has been completed. Here's another example

 

Request

PUT /admin/api/2023-07/draft_orders/1167951200505/complete.json HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 0
Content-Type: application/json
User-Agent: HTTPie/3.2.2

 Response X-Request-ID: 154ce9d2-0a10-47be-abbe-18dd10875d84

HTTP/1.1 422 Unprocessable Entity
X-Request-ID: 154ce9d2-0a10-47be-abbe-18dd10875d84

{
"errors": "Product variant not found., Your cart has been updated and the items you added can’t be shipped to your address. Remove the items to complete your order., and Your payment couldn’t be processed because your order total has changed. Check your order total and try again."
}

This is what the variant looks like

   {
      "id": 40086113714360,
      "title": "6XL",
      "price": "65.00",
      "sku": "1089-01-6XL",
      "position": 6,
      "inventory_policy": "deny",
      "compare_at_price": null,
      "fulfillment_service": "manual",
      "inventory_management": "shopify",
      "option1": "6XL",
      "option2": null,
      "option3": null,
      "created_at": "2021-07-19T17:20:01+08:00",
      "updated_at": "2024-01-04T21:43:10+08:00",
      "taxable": true,
      "barcode": "1089-01-6XL",
      "grams": 400,
      "image_id": 39255650664697,
      "weight": 400,
      "weight_unit": "g",
      "inventory_item_id": 42180516479160,
      "inventory_quantity": 51,
      "requires_shipping": true,
      "admin_graphql_api_id": "gid://shopify/ProductVariant/40086113714360"
    },

 The shipping has also been set on the draft order

Jay_Lim
Shopify Partner
1 0 0

Additional details:

 

- Users of our app have successfully completed the same affected draft orders from their dashboard, it looks like it's not working from the API side only.

- One user was using a different Shopify app that could complete the same draft order as well.

- We're starting to see partial successes on all the affected orders when attempting re-complete the orders, the pattern looks random so far to us.

francis_gutierr
Shopify Partner
1 0 0

Hi Sengming, I'm also experiencing the same issue. Any new ideas?

sengming
Shopify Partner
52 1 9

no new ideas yet! How about you? I'll keep this thread updated as if I learn anything.

nitd24
Shopify Partner
2 0 0

We have also started getting this error via the API. Also it isn't consistent, seems to be happening to few requests intermittently, then those draft orders will keep throwing the same error.

I can confirm that no settings have been changed, this randomly started to pop up.

 

KaiHu
Visitor
1 0 0

We're experiencing same issue, we can't complete any draft order since yesterday because of the error 'Product variant not found'.  

 

There is nothing changed from our side, but Shopify suddenly returns the error since yesterday. 

 

 

@Liam Is there any breaking change introduced by Shopify side recently?

ranjan-purbey
Shopify Partner
11 1 5

Same issue since yesterday. This is the API response:

{
"errors": "Product variant not found. and Product variant not found."
}

x-request-id: d6370096-7df0-4a67-8b21-edced0da6032

 

@LiamI have tested with different api versions but get the same error. No changes have been made on our end recently. It started throwing this error yesterday out of the blue. Also can confirm that all items in the order are available in stock.

 

Liam
Community Manager
3108 340 872

Hi folks - it's possible that this issue is occurring due to variants being missing from a catalogue, can you check that all product variants are part of a catalogue? 

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

ranjan-purbey
Shopify Partner
11 1 5

There is no "catalogs" option under products as mentioned in the link you shared and I don't think we have ever created one.

 

ranjanpurbey_0-1704464361201.png

 

ranjan-purbey
Shopify Partner
11 1 5

I checked the sales channels to which the products in the order were published and sure enough, two of them were not published to the custom app which I was using for calling shopify API. After publishing them to the app channel, the API call succeeded. Thanks for the help! Though I am not sure why this has started cropping up all of a sudden.

sengming
Shopify Partner
52 1 9

Thanks for the tip! And I am glad it is working for you.

 

Unfortunately my app is not a sales channel app so it doesn't work for me.

ranjan-purbey
Shopify Partner
11 1 5

Could it be that some items in your order are not published to the online store channel?

ranjan-purbey
Shopify Partner
11 1 5

This is an accepted solution.

Looks like shopify has fixed the issue on their end

Liam
Community Manager
3108 340 872

Hi Ranjan,

 

Correct - we shipped a fix for this on Friday

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