Create a customer
Create a new customer record for a company or a person, and get the newly created customer in return.
For a new company customer, define "name" property and set "isCompany" flag to true in the request body. For a new private person customer, define "firstName" and "lastName" under the "person" property, and set "isCompany" flag to false in the request body. These are the minimum required properties that should be defined in the request body for creating a new customer.
All other properties for a customer (see response attributes for each property description) can also be defined in the request body, except for "person" when a new customer is a company, and "organizationNumber" and "name" (this one is generated from "firstName" and "lastName" under the "person" property) when a new customer is a person.
Body object Required
curl \
-X POST https://rest.api.24sevenoffice.com/v1/customers \
-H "Content-Type: application/json" \
-H "Authorization: string" \
-d '["\u003c!-- A payload example for when a new customer is a company --\u003e",{"id":123,"name":"ABC Corporation","email":{"billing":"billing@example.com","contact":"contact@example.com"},"phone":"+47-12345678","address":{"visit":{"street":"Hovedgata 1","postalArea":"Fornebu","postalCode":"0123","countryCode":"NO","countrySubdivision":"Viken"}},"isCompany":true,"isSupplier":false,"organizationNumber":"123456789"},"\u003c!-- A payload example for when a new customer is a private person --\u003e",{"id":321,"email":{"billing":"billing@example.com","contact":"contact@example.com"},"phone":"+47-87654321","person":{"lastName":"Doe","firstName":"John"},"address":{"visit":{"street":"Hovedgata 2","postalArea":"Fornebu","postalCode":"0123","countryCode":"NO","countrySubdivision":"Viken"}},"isCompany":false,"isSupplier":false}]'
[
"<!-- A payload example for when a new customer is a company -->",
{
"id": 123,
"name": "ABC Corporation",
"email": {
"billing": "billing@example.com",
"contact": "contact@example.com"
},
"phone": "+47-12345678",
"address": {
"visit": {
"street": "Hovedgata 1",
"postalArea": "Fornebu",
"postalCode": "0123",
"countryCode": "NO",
"countrySubdivision": "Viken"
}
},
"isCompany": true,
"isSupplier": false,
"organizationNumber": "123456789"
},
"<!-- A payload example for when a new customer is a private person -->",
{
"id": 321,
"email": {
"billing": "billing@example.com",
"contact": "contact@example.com"
},
"phone": "+47-87654321",
"person": {
"lastName": "Doe",
"firstName": "John"
},
"address": {
"visit": {
"street": "Hovedgata 2",
"postalArea": "Fornebu",
"postalCode": "0123",
"countryCode": "NO",
"countrySubdivision": "Viken"
}
},
"isCompany": false,
"isSupplier": false
}
]
# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string
# Payload
{
"id": 12345,
"name": "ABC Corporation",
"person": {
"firstName": "John",
"lastName": "Doe"
},
"isCompany": true,
"isSupplier": false,
"organizationNumber": "123456789",
"address": {
"visit": {
"countryCode": "NO",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"countrySubdivision": "Viken"
},
"postal": {
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"countrySubdivision": "Viken"
},
"billing": {
"name": "ABC Corporation",
"countryCode": "NO",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"countrySubdivision": "Viken"
},
"delivery": {
"name": "ABC Corporation",
"countryCode": "NO",
"street": "Hovedgata 1",
"postalCode": "0123",
"postalArea": "Fornebu",
"countrySubdivision": "Viken"
}
},
"email": {
"contact": "contact@example.com",
"billing": "billing@example.com"
},
"phone": "+47-12345678",
"createdAt": "2022-01-01 18:00:00.000Z",
"modifiedAt": "2023-12-31 18:00:00.000Z"
}