Update a sales order
Update details of a specific sales order identified by its uinque sales order ID, and receive the updated details in return. An existing sales order can be invoiced by updating its status
to "Invoice". Before a sales order can be invoiced, it needs to include at least one sales order line.
Path parameters
-
A unique identifier for the sales order within 24SevenOffice ERP.
Body
-
id number
A unique identifier for the sales order within 24SevenOffice ERP.
-
customer object
Customer details for the sales order. Note that the
customer
object for the/salesOrders
endpoint is not the same as the customer that can be retrieved from the/customers
endpoint, even though both share the same ID reference and their schemas are similar. Thecustomer
object in the context of/salesOrders
contains the customer details as they were at the time the sales order was created. In contrast, the/customers
endpoint always provides the latest state values for the customer properties.Additional properties are allowed.
-
status string
Current status of the sales order.
Values are
Draft
,Proposal
,Confirmed
,Invoice
, orAdvanceInvoice
. -
deliveryCustomer object
Delivery details for the sales order.
Additional properties are allowed.
-
invoice object
Details of an invoice associated with a sales order.
Additional properties are allowed.
-
date string(date)
The date when the sales order was issued.
-
internalMemo string
An internal memo for the sales order.
Maximum length is
300
. -
memo string
A memo or comments for the sales order.
-
salesType object
The sales type for the sales order.
Additional properties are allowed.
-
createdAt string(date-time)
A timestamp for when a record was created, in ISO 8601 format.
-
modifiedAt string(date-time)
A timestamp for when one of the properties of a record was last modified, in ISO 8601 format.
curl \
-X PATCH https://rest.api.24sevenoffice.com/v1/salesorders/{id} \
-H "Content-Type: application/json" \
-H "Authorization: string" \
-d '{"id":1234,"customer":{"id":12345,"organizationNumber":"123456789","gln":"1234567890123","name":"ABC Corporation","street":"Hovedgata 1","postalCode":"0123","postalArea":"Fornebu","city":"Fornebu","countrySubdivision":"Viken","countryCode":"NO"},"status":"Invoice","deliveryCustomer":{"id":12345,"name":"ABC Corporation","street":"Hovedgata 1","postalCode":"0123","postalArea":"Fornebu","city":"Fornebu","countrySubdivision":"Viken","countryCode":"NO"},"invoice":{"number":123,"date":"2023-06-01","dueDate":"2023-06-15","remittanceReference":"ABC12345","transaction":{"id":"63293496-884f-4358-b489-f641fe51cdaa"}},"date":"2023-06-01","internalMemo":"Customer requested special packaging.","memo":"Urgent delivery.","salesType":{"id":10},"createdAt":"2023-06-01T12:00:00Z","modifiedAt":"2023-06-02T15:30:00Z"}'
# Headers
Authorization: string
# Payload
{
"id": 1234,
"customer": {
"id": 12345,
"organizationNumber": "123456789",
"gln": "1234567890123",
"name": "ABC Corporation",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"city": "Fornebu",
"countrySubdivision": "Viken",
"countryCode": "NO"
},
"status": "Invoice",
"deliveryCustomer": {
"id": 12345,
"name": "ABC Corporation",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"city": "Fornebu",
"countrySubdivision": "Viken",
"countryCode": "NO"
},
"invoice": {
"number": 123,
"date": "2023-06-01",
"dueDate": "2023-06-15",
"remittanceReference": "ABC12345",
"transaction": {
"id": "63293496-884f-4358-b489-f641fe51cdaa"
}
},
"date": "2023-06-01",
"internalMemo": "Customer requested special packaging.",
"memo": "Urgent delivery.",
"salesType": {
"id": 10
},
"createdAt": "2023-06-01T12:00:00Z",
"modifiedAt": "2023-06-02T15:30:00Z"
}
# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string
# Payload
{
"id": 1234,
"customer": {
"id": 12345,
"organizationNumber": "123456789",
"gln": "1234567890123",
"name": "ABC Corporation",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"city": "Fornebu",
"countrySubdivision": "Viken",
"countryCode": "NO"
},
"status": "Invoice",
"deliveryCustomer": {
"id": 12345,
"name": "ABC Corporation",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"city": "Fornebu",
"countrySubdivision": "Viken",
"countryCode": "NO"
},
"invoice": {
"number": 123,
"date": "2023-06-01",
"dueDate": "2023-06-15",
"remittanceReference": "ABC12345",
"transaction": {
"id": "63293496-884f-4358-b489-f641fe51cdaa"
}
},
"date": "2023-06-01",
"internalMemo": "Customer requested special packaging.",
"memo": "Urgent delivery.",
"salesType": {
"id": 10
},
"createdAt": "2023-06-01T12:00:00Z",
"modifiedAt": "2023-06-02T15:30:00Z"
}
# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string
# Payload
{
"id": 1234,
"customer": {
"id": 12345,
"organizationNumber": "123456789",
"gln": "1234567890123",
"name": "ABC Corporation",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"city": "Fornebu",
"countrySubdivision": "Viken",
"countryCode": "NO"
},
"status": "Invoice",
"deliveryCustomer": {
"id": 12345,
"name": "ABC Corporation",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"city": "Fornebu",
"countrySubdivision": "Viken",
"countryCode": "NO"
},
"invoice": {
"number": 123,
"date": "2023-06-01",
"dueDate": "2023-06-15",
"remittanceReference": "ABC12345",
"transaction": {
"id": "63293496-884f-4358-b489-f641fe51cdaa"
}
},
"date": "2023-06-01",
"internalMemo": "Customer requested special packaging.",
"memo": "Urgent delivery.",
"salesType": {
"id": 10
},
"createdAt": "2023-06-01T12:00:00Z",
"modifiedAt": "2023-06-02T15:30:00Z"
}
# 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"
}