v1

latestOpenAPI 3.0.12026-07-141671231.8 MB
Customers

Categorize a customer

Update the categories of a customer. You can pass categories that don't belong to the same category group. The sum of categories of a same group must equal 1. In the following example, the two first categories belong to the same category group A, the sum of the weights is 1. The third category belongs to a category group B, its weight is 1.

[
  { "id": 59, "weight": "0.5" }, // category group A
  { "id": 33, "weight": "0.5" }, // category group A
  { "id": 65, "weight": "1" }    // category group B
]

ℹ️ This endpoint requires the following scope: customers:all

put/api/external/v2/customers/{customer_id}/categories

Path parameters

customer_idinteger required

Request body

idinteger required
weightstring required

A number between 0 and 1, including 1. It must have a maximum of 7 decimals. 0.85 means 85%.

Example request

[
  {
    "id": 426,
    "weight": "0.6575"
  }
]

Response

The list of categories of the customer

idinteger required
labelstring required
weightstring required
analytical_codestring nullable required
created_atstring date-time required
updated_atstring date-time required

Example response

[
  {
    "id": 421,
    "label": "HR - Salaries",
    "weight": "0.25",
    "category_group": {
      "id": 229
    },
    "analytical_code": "CODE123",
    "created_at": "2023-08-30T10:08:08.146343Z",
    "updated_at": "2023-08-30T10:08:08.146343Z"
  }
]