using the REST api to update a line item on a sale...
# ask-stanley-ai
m
using the REST api to update a line item on a sales order, how do I update a line item field? What query param do I use?
c
AI generated answer (using internal Slack threads):
To update a line item field on a sales order using the REST API, you would need to use the PATCH method. The endpoint would be
/record/v1/salesOrder/{id}
where
{id}
is the internal id of the sales order you want to update. The body of the request would look something like this:
Copy code
json
{
  "sublists": {
    "item": {
      "operation": "update",
      "line": 1,
      "values": {
        "quantity": 2
      }
    }
  }
}
In this example, we are updating the quantity of the line item at line 1. The
operation
field is set to
update
to indicate that we want to update an existing line item. The
line
field is the line number of the line item we want to update. The
values
field is an object that contains the fields we want to update and their new values. Please note that the line number is not the same as the line id. The line number is the sequence number of the line on the sales order, while the line id is a unique identifier for the line. The
line
field in the request body refers to the line number, not the line id. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836157858
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82859844
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.825740159
Please provide your feedback on this answer.