Create Customer
Creates a new customer.
Request
POST /api/oauth/v2/resource/customers
Header
| Header | Value |
|---|---|
Authorization | Bearer {access_token} |
Content-Type | application/json |
Body parameters
Note: At least one of the fields
firstName,lastName, orcompanyNameis required.
| Field | Type | Required | Description |
|---|---|---|---|
firstName | string | No | First name |
lastName | string | No | Last name |
companyName | string | No | Company name |
title | string | No | Title (e.g. Dr., Mag.) |
email | string | No | Email address |
tel | string | No | Phone number |
telCode | string | No | Country dialing code (e.g. +43) |
street | string | No | Street and house number |
zip | string | No | Postal code |
city | string | No | City |
country | string | No | Country code (ISO 3166-1 alpha-2, e.g. AT) |
birthday | string | No | Date of birth (YYYY-MM-DD) |
sex | integer | No | Sex |
notice | string | No | Internal note |
customerNumber | string | No | Customer number |
socialNumber | string | No | Social security number |
Response
Success (201 Created)
json
{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"title": null,
"firstName": "Max",
"lastName": "Mustermann",
"email": "max.mustermann@example.com",
"phone": "+43 676 9876543",
"birthday": "1990-08-23",
"socialNumber": null,
"tenancies": [
{
"id": "f0e1d2c3-b4a5-6789-fedc-ba9876543210",
"name": "Ordination Muster",
"abbreviation": "OM",
"color": "#00adba"
}
]
}
}Response fields
See Customer Details for the full field description.
Beispiele
bash
curl -X POST "https://my.offisy.at/api/oauth/v2/resource/customers" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"firstName": "Max",
"lastName": "Mustermann",
"companyName": "Muster GmbH",
"title": "beispiel",
"email": "anna.muster@example.com",
"tel": "+43 664 1234567",
"telCode": "+43 664 1234567",
"street": "Musterstraße 1",
"zip": "4020",
"city": "Linz",
"country": "AT",
"birthday": "beispiel",
"sex": "1",
"notice": "beispiel",
"customerNumber": "beispiel",
"socialNumber": "1234010190"
}'Parameter
Zuerst Token anfordern
Possible errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Invalid request data (e.g. no name provided) |
| 401 | invalid_client | Invalid or missing access token |
| 403 | insufficient_scope | Scope customers not present |