Update a sales order line
Update the details of a specific line in a sales order.
Path parameters
-
The unique identifier for the sales order, to which all the sales order lines pertain.
-
The unique identifier of the sales order line.
Body
-
id number
The unique identifier for the sales order line item within 24SevenOffice ERP.
-
type string
A specification for the type of the line item, whether this is a product or a text entry.
Values are
product
ortext
. -
product object
Product details, if the line item type is 'product'. Note that the
product
object for the/salesorders/{id}/lines
endpoint is not the same as the product that can be retrieved from the/products
endpoint, even though both share the same ID reference and their schemas are similar. Theproduct
object in the context of/salesorders/{id}/lines
contains the product details as they were at the time the sales order line item was created. In contrast, the/products
endpoint always provides the latest state values for the product properties.Additional properties are allowed.
-
description string
A description for the line item.
Minimum length is
1
, maximum length is300
. -
quantity number
The quantity of the product in the line item.
-
price number
The price of a single unit of the product in the line item.
-
discountRate number
The discount rate applied to the line item, expressed as a whole number. For example, a discount rate of 10% is represented as 10.
Minimum value is
0
, maximum value is100
. -
tax object
Details for the tax applied to the line item.
Additional properties are allowed.
-
account object
Details for the account to which the sale is posted.
Additional properties are allowed.
curl \
-X PATCH https://rest.api.24sevenoffice.com/v1/salesorders/{id}/lines/{lineId} \
-H "Content-Type: application/json" \
-H "Authorization: string" \
-d '{"id":123456789,"type":"product","product":{"id":101},"description":"Leather handbag with adjustable strap.","quantity":2,"price":49.99,"discountRate":10,"tax":{"id":1,"number":1,"rate":25},"account":{"id":200001,"number":1500,"name":"Accounts Receivable"}}'
# Headers
Authorization: string
# Payload
{
"id": 123456789,
"type": "product",
"product": {
"id": 101
},
"description": "Leather handbag with adjustable strap.",
"quantity": 2,
"price": 49.99,
"discountRate": 10,
"tax": {
"id": 1,
"number": 1,
"rate": 25
},
"account": {
"id": 200001,
"number": 1500,
"name": "Accounts Receivable"
}
}
# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string
# Payload
{
"id": 123456789,
"type": "product",
"product": {
"id": 101
},
"description": "Leather handbag with adjustable strap.",
"quantity": 2,
"price": 49.99,
"discountRate": 10,
"tax": {
"id": 1,
"number": 1,
"rate": 25
},
"account": {
"id": 200001,
"number": 1500,
"name": "Accounts Receivable"
}
}
# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string
# Payload
{
"error": {
"name": "BadRequestError",
"payload": {
"errors": [
{
"type": "NoLines",
"message": "No lines in the sales order",
"arguments": [
"lineItems"
]
}
]
}
},
"trackingId": "ghi789"
}
# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string
# Payload
{
"error": {
"name": "ValidationError",
"payload": {
"validationErrors": [
{
"path": "customer.name",
"keyword": "required"
}
]
}
},
"trackingId": "def456"
}