Create Customer Group
Creates a new customer group.
Request
POST /api/oauth/v2/resource/customers/groups
Header
| Header | Value |
|---|---|
Authorization | Bearer {access_token} |
Content-Type | application/json |
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the customer group (max. 50 characters). Leading and trailing spaces are removed. Emoji and other 4-byte characters are not allowed |
description | string | No | Description of the customer group. Emoji and other 4-byte characters are not allowed |
color | string | No | Color as hex code (format #RRGGBB, default: #74AFAD) |
Note: The name of a customer group is not unique. Every
POSTcall creates a new customer group, even if a customer group with the same name already exists. A sync script that runs repeatedly will create duplicates this way. Check withGET /customers/groupswhether the customer group already exists before creating it.
Response
Success (201 Created)
json
{
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "Stammkunden",
"description": "Kunden mit regelmäßigen Terminen",
"color": "#74AFAD"
}
}Response fields
See Customer Group Details for the full field description.
Beispiele
bash
curl -X POST "https://my.offisy.at/api/oauth/v2/resource/customers/groups" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "Muster GmbH",
"description": "beispiel",
"color": "beispiel"
}'Parameter
Zuerst Token anfordern
Possible errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Invalid request data |
| 401 | invalid_client | Invalid or missing access token |
| 403 | insufficient_scope | Scope customers not present |
| 403 | access_denied | The owning user of your API access does not have permission to create customer groups in the OAuth client's company (error_description: Insufficient permission for this resource.) |
Examples for 400 validation_error:
json
{"error":"validation_error","error_description":"name is required."}json
{"error":"validation_error","error_description":"name must not exceed 50 characters."}json
{"error":"validation_error","error_description":"color must be a hex value in the format #RRGGBB."}json
{"error":"validation_error","error_description":"name must not contain emoji or other 4-byte characters."}