Cart transform Extension giving InvalidOutputError error

Cart transform Extension giving InvalidOutputError error

siddhant_sankhe
Shopify Partner
4 0 0

Following the cart transform documentation https://shopify.dev/docs/api/functions/reference/cart-transform
I was trying to have update operation get going, but I am getting error for adding "price" parameter in Input 
As per documentation, update operation does accept price,title,image etc kind of data https://shopify.dev/docs/api/functions/reference/cart-transform#example-update-operation
But to me its giving me error 

Any idea why that is ?

 

{
    "path": [
      "operations",
      0,
      "update",
      "price"
    ],
    "explanation": "Field is not defined on UpdateOperation"
  }

 


 

Replies 5 (5)

Liam
Community Manager
3108 341 879

Hi Siddhant,

 

Just to confirm - are you attempting this of a dev store or Plus store? Is your operation the same as the one in this example?

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

siddhant_sankhe
Shopify Partner
4 0 0

Hi @Liam , Yes I can confirm that I have tried to do this on Dev store and Plus store

posting the output details and error 

{
  "operations": [
    {
      "update": {
        "cartLineId": "gid://shopify/CartLine/af289e2f-bf8f-4313-a83e-2edc0876ef69",
        "title": "blue sunset from extension",
        "price": {
          "adjustment": {
            "fixedPricePerUnit": {
              "amount": "0"
            }
          }
        }
      }
    },
    {
      "update": {
        "cartLineId": "gid://shopify/CartLine/d0f5bffd-5911-4c11-b399-adacbe5331ed",
        "title": "The Summer And Frost Bundle from extension",
        "price": {
          "adjustment": {
            "fixedPricePerUnit": {
              "amount": "0"
            }
          }
        }
      }
    }
  ]
}

Error

[
  {
    "path": [
      "operations",
      0,
      "update",
      "price"
    ],
    "explanation": "Field is not defined on UpdateOperation"
  },
  {
    "path": [
      "operations",
      1,
      "update",
      "price"
    ],
    "explanation": "Field is not defined on UpdateOperation"
  }
]

  

Liam
Community Manager
3108 341 879

Hi again Siddhant,

 

If you try to update something else other than the price (eg: image) can you complete this update operation? 

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

siddhant_sankhe
Shopify Partner
4 0 0

Hey @Liam , yes I did try to run update operation with just title , it seems to be working with only title, but when I add price, it gives error

siddhant_sankhe
Shopify Partner
4 0 0

Hey @Liam , any updates on this ??