Skip to main content
POST
Create a customer
Every new customer is ACTIVE. Its document (CPF or CNPJ) can belong to one customer only in the organization. customFields are checked against the organization’s active custom fields for customers: every key must be the slug of one of them and every value must fit its type. A custom field marked as required must have a value, even when you send no customFields at all.

Path Parameters

realmId
string<uuid>
required

ID of your realm.

Format: UUID

organizationId
string<uuid>
required

ID of the organization the customer belongs to.

Format: UUID

Body

application/json
name
string
required

Name of the customer: a person's full name or a company's name.

Required string length: 1 - 100
Example:

"Ana Souza"

email
string<email>
required

E-mail address of the customer.

Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Example:

"ana.souza@example.com"

phoneNumber
string
required

Brazilian phone number in international format: +55, the area code and the number (10 or 11 digits).

Pattern: ^\+55[0-9]{10,11}$
Example:

"+5511999999999"

document
string
required

CPF (11 digits) or CNPJ (14 characters: the first 12 may be letters, the last 2 are digits) of the customer, with no dots, dashes or slashes. The check digits are verified and letters are stored in uppercase. A document can belong to one customer only in the organization.

Minimum string length: 1
Pattern: ^[A-Za-z0-9]+$
Example:

"52998224725"

address
object
required

Postal address of the customer.

trandingName
string

Trade name of a company customer.

Example:

"Souza Studio"

customFields
object

Values of the organization's custom fields for this customer, keyed by each field's slug. Every key must be the slug of an active custom field defined for customers, and every value must fit that field's type; a field marked as required must have a value.


Example: {"cost-center":"CC-1020"}

Example:

Response

Successful response

The customer a create or an update answers with.

id
string<uuid>
required

ID of the customer.

Example:

"7f3b1c52-9e4a-4d1b-8a67-2c5d9f0e4b13"

hash
string<uuid>
required

Token that identifies the customer in the link of their portal page.

Example:

"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"

address
object

Postal address of the customer.

Example:
name
string

Name of the customer: a person's full name or a company's name.

Example:

"Ana Souza"

document
string

Tax ID of the customer, without formatting: a CPF (11 digits) or a CNPJ (14 characters — the first 12 may be uppercase letters, the last 2 are digits).

Example:

"52998224725"

documentType
string

Kind of document: CPF for 11 characters, CNPJ otherwise.

Example:

"CPF"

trandingName
string

Trade name of a company customer.

Example:

"Souza Studio"

email
string

E-mail address of the customer.

Example:

"ana.souza@example.com"

phoneNumber
string

Phone number of the customer, in international format: + followed by digits.

Example:

"+5511999999999"

customFields
object | null

Values of the organization's custom fields for this customer, keyed by the field's slug. Absent, or null, when the customer has none.


Example: {"cost-center":"CC-1020"}

Example: