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"
}
Liam
January 11, 2024, 2:23pm
2
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 ?
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
January 12, 2024, 11:12am
4
Hi again Siddhant,
If you try to update something else other than the price (eg: image) can you complete this update operation?
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
Hey @Liam , any updates on this ??