Shopify has a CARTS api but it is read-only. I am trying to find a way to manipulate the line_item's line_price or price attribute. Shopify support has directed me here for an answer.
Since there is no proper documentation on this any help would be appreciated.
Yes you can!
Dont mess the people, you can do everything you want with your store.
You can do it via JavaScript, this is some related code i have used:
This is just a way to help you go to the right place...
But please, people dont mess if you dont know something, its your store and you can do anything....
I hope this helps to you to find the way.
You can't directly manipulate the price of a line item in a cart. As you mentioned, the Carts API is read-only. That's all there is to it.
Products have variants, and a line item has a product ID and a variant ID. A line item has a price too. And no matter how you access that item (using the Ajax API or the backend API) you cannot manipulate the price. If you want to change a price, you have to change the product's variants price. That you do with the backend API and the product or variant calls.