Create a sales order
Create a new sales order with customer details and order information.
Body
- 
    
  Customer details for the sales order. Note that the customerobject for the/salesOrdersendpoint is not the same as the customer that can be retrieved from the/customersendpoint, even though both share the same ID reference and their schemas are similar. Thecustomerobject in the context of/salesOrderscontains the customer details as they were at the time the sales order was created. In contrast, the/customersendpoint always provides the latest state values for the customer properties.
- 
    
  Current status of the sales order. Values are Draft,Proposal,Confirmed,Invoice, orAdvanceInvoice.
- 
    
  Delivery details for the sales order. 
- 
    
  Details of an invoice associated with a sales order. 
- 
    
  The date when the sales order was issued. 
- 
    
  An internal memo for the sales order. Maximum length is 300.
- 
    
  A memo or comments for the sales order. 
- 
    
  Details of the contact person at the customer side who is the sales order's point of contact at the customer 
- 
    
  Details of the person at your organization who is the sales order's point of contact within your organization. It should be one of the people provided by /organization/peopleendpoint.
- 
    
  A reference number for the sales order, like a purchase order number provided by the customer. Maximum length is 50.
- 
    
  The sales type for the sales order. 
- 
    
  A timestamp for when a record was created, in ISO 8601 format. 
- 
    
  A timestamp for when one of the properties of a record was last modified, in ISO 8601 format. 
- 
    
  A list of dimensions such as department or project. 
curl \
 --request POST 'https://rest.api.24sevenoffice.com/v1/salesorders' \
 --header "Content-Type: application/json" \
 --header "Authorization: string" \
 --data '{"customer":{"id":12345,"organizationNumber":"123456789","invoiceEmailAddresses":["hello@example.com"],"gln":"1234567890123","name":"ABC Corporation","street":"Hovedgata 1","postalCode":"0123","postalArea":"Fornebu","city":"Fornebu","countrySubdivision":"Viken","countryCode":"NO"},"currency":{"code":"USD","rate":1},"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.","yourReference":{"id":123,"name":"John Doe"},"ourReference":{"id":123},"referenceNumber":"PO12345","salesType":{"id":-100},"createdAt":"2023-06-01T12:00:00Z","modifiedAt":"2023-06-02T15:30:00Z","dimensions":[{"dimensionType":1,"value":"13","name":"Project with ID 13"}]}'# Headers
Authorization: string
# Payload
{
  "customer": {
    "id": 12345,
    "organizationNumber": "123456789",
    "invoiceEmailAddresses": [
      "hello@example.com"
    ],
    "gln": "1234567890123",
    "name": "ABC Corporation",
    "street": "Hovedgata 1",
    "postalCode": "0123",
    "postalArea": "Fornebu",
    "city": "Fornebu",
    "countrySubdivision": "Viken",
    "countryCode": "NO"
  },
  "currency": {
    "code": "USD",
    "rate": 1
  },
  "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.",
  "yourReference": {
    "id": 123,
    "name": "John Doe"
  },
  "ourReference": {
    "id": 123
  },
  "referenceNumber": "PO12345",
  "salesType": {
    "id": -100
  },
  "createdAt": "2023-06-01T12:00:00Z",
  "modifiedAt": "2023-06-02T15:30:00Z",
  "dimensions": [
    {
      "dimensionType": 1,
      "value": "13",
      "name": "Project with ID 13"
    }
  ]
}# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string
# Payload
{
  "id": 1234,
  "customer": {
    "id": 12345,
    "organizationNumber": "123456789",
    "invoiceEmailAddresses": [
      "hello@example.com"
    ],
    "gln": "1234567890123",
    "name": "ABC Corporation",
    "street": "Hovedgata 1",
    "postalCode": "0123",
    "postalArea": "Fornebu",
    "city": "Fornebu",
    "countrySubdivision": "Viken",
    "countryCode": "NO"
  },
  "currency": {
    "code": "USD",
    "rate": 1
  },
  "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.",
  "yourReference": {
    "id": 123,
    "name": "John Doe"
  },
  "ourReference": {
    "id": 123
  },
  "referenceNumber": "PO12345",
  "salesType": {
    "id": -100
  },
  "createdAt": "2023-06-01T12:00:00Z",
  "modifiedAt": "2023-06-02T15:30:00Z",
  "grossAmount": 124.99,
  "netAmount": 99.99,
  "taxAmount": 25,
  "dimensions": [
    {
      "dimensionType": 1,
      "value": "13",
      "name": "Project with ID 13"
    }
  ]
}# 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"
}