Cart Transformer api failing with "Image Not found"

Solved

Cart Transformer api failing with "Image Not found"

pixobe
Shopify Partner
8 0 2

 

Description:

   Trying to update image on a line item via cart transform api. 

What Image:

 Image that exists and works on  shopify cdn.

  https://cdn.shopify.com/s/files/1/0809/9315/7416/files/media_187dda34-9d36-454b-ad75-995ec87eab48.pn...

Access Scopes:

   write_cart_transofrms,write_products

Output Json

 

 

 

{
  "operations": [
    {
      "update": {
        "cartLineId": "gid://shopify/CartLine/e63a162c-40b0-47a2-b29a-7d3f5dbcc07f",
        "title": "This was updated ",
        "image": {
          "url": "https://cdn.shopify.com/s/files/1/0809/9315/7416/files/media_187dda34-9d36-454b-ad75-995ec87eab48.png"
        }
      }
    }
  ]
}

 

 

 

 

Error Message

 

 

 

 

[
  "operations[0] (update): [{code: image_not_found, message: Image not found for the shop.}]"
]

 

 

 

 

Accepted Solution (1)

tim
Shopify Expert
3628 314 1341

This is an accepted solution.

Could this be a reason? 

https://shopify.dev/docs/api/functions/reference/cart-transform#showing-overrides :

Images that are used for override must first be uploaded to the Shopify CDN and should belong to the store.

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Replies 2 (2)

tim
Shopify Expert
3628 314 1341

This is an accepted solution.

Could this be a reason? 

https://shopify.dev/docs/api/functions/reference/cart-transform#showing-overrides :

Images that are used for override must first be uploaded to the Shopify CDN and should belong to the store.

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
pixobe
Shopify Partner
8 0 2

Hello Tim

 Thank you for helping, I figured out the issue. Image should be uploaded as Media not as file.  I was trying initially with type as File. After changing. it to media, it all worked.  (even though the file upload is shopify cdn, it fails, you cannot use it part of cart transform api)