question

robsmitha avatar image
robsmitha asked robsmitha edited

Can you update the price of a line item using the REST API?

I am attempting to update the price of a line item using the following endpoint:
"/v3/merchants/{MerchantId}/orders/{orderId}/line_items/{lineItemId}"

The code sets the new lineItem.price, then the update api call is successful, but the lineItem.price remains the original price it was set at initially and does not update to the new price.

Please let me know if this is the intended behavior.
LineItems
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered robsmitha edited
I looked at the code, and price isn't one of the things that can be updated. The list includes:

bin_name
printed
note
user_data
modified_time

It's a bug that no error is returned. I'll file an internal issue to get that fixed.

If your case though I think you'll need to remove the existing line item and add a new one.
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

robsmitha avatar image robsmitha commented ·

Thanks for your help, a quick follow up question. Are you able to create line items with the userData? Updating the line item with userData works, but i'm not able to create a line item with userData? Please see this question for reference: https://community.clover.com/questions/18633/how-to-save-userdata-on-lineitem-using-the-v3merch.html

0 Likes 0 ·

Welcome to the
Clover Developer Community