Clients
Endpoints for registering and managing clients in the Falaê database.
Create Client
POST /api/clients
Registers a new client on the platform with optional survey link generation.
Use cases:
- Register clients for loyalty program
- Generate personalized survey link
- Integrate client database with Falaê
Request Body
json
{
"name": "John Doe",
"email": "johndoe@example.com",
"phone": "(00) 0 0000-0000",
"born_date": "25/02/1980",
"approved": true,
"search_id": "102a525c-0ce3-4182-a504-aad595425233"
}| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Client name |
email | string | No* | Client email (*email or phone is required) |
phone | string | No* | Client phone (*email or phone is required) |
born_date | string | No | Birth date in DD/MM/YYYY format |
approved | boolean | Yes | Consent to receive notifications |
search_id | string | No | Survey ID to generate link with client ID (UUID) |
Request Example
bash
curl -X POST "https://api-b2s.experienciab2s.com/api/clients" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "johndoe@example.com",
"phone": "(00) 0 0000-0000",
"born_date": "25/02/1980",
"approved": true,
"search_id": "102a525c-0ce3-4182-a504-aad595425233"
}'Success Response (200)
json
{
"message": "Client created with success",
"id": "ef9fa264-3850-4bd2-875e-2b40a4dd432f",
"link": "https://pesquisa.falae.app"
}Note: The
linkfield is only returned whensearch_idis provided.
Create Client with Consumption
POST /api/clients/consumption
Registers a client and links consumption information in the system with optional survey link generation.
Use cases:
- Register purchase and request review
- Link order to client for tracking
- Generate post-purchase survey link
Request Body
json
{
"name": "John Doe",
"email": "johndoe@example.com",
"phone": "(00) 0 0000-0000",
"born_date": "25/02/1980",
"approved": true,
"order_id": "platform-22",
"order_value": 25.5,
"order_created_at": "2025-01-14T10:00:00Z",
"order_type": "Delivery",
"search_id": "102a525c-0ce3-4182-a504-aad595425233"
}| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Client name |
email | string | No* | Client email (*email or phone is required) |
phone | string | No* | Client phone (*email or phone is required) |
born_date | string | No | Birth date in DD/MM/YYYY format |
approved | boolean | Yes | Consent to receive notifications |
order_id | string | Yes | Unique order identifier in the POS system |
order_value | number | Yes | Order value in decimal format |
order_created_at | string | Yes | Order creation timestamp (ISO 8601 or 'YYYY-MM-DD HH:mm:ss') |
order_type | string | Yes | Order type (e.g., Delivery, Pickup, Dine-in) |
search_id | string | No | Survey ID to generate link with client and order ID (UUID) |
Request Example
bash
curl -X POST "https://api-b2s.experienciab2s.com/api/clients/consumption" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "johndoe@example.com",
"phone": "(00) 0 0000-0000",
"born_date": "25/02/1980",
"approved": true,
"order_id": "platform-22",
"order_value": 25.5,
"order_created_at": "2025-01-14T10:00:00Z",
"order_type": "Delivery",
"search_id": "102a525c-0ce3-4182-a504-aad595425233"
}'Success Response (200)
json
{
"message": "Client and consumption successfully registered!",
"client": {
"id": "ef9fa264-3850-4bd2-875e-2b40a4dd432f"
},
"consumption": {
"id": "18d12320-ebbf-4688-a4fa-67481aceb929"
},
"link": "https://pesquisa.falae.app"
}Note: The
linkfield is only returned whensearch_idis provided.
Create Clients in Batch and Dispatch Survey
POST /api/clients/dispatch
Registers a group of clients and automatically dispatches a satisfaction survey.
Use cases:
- Client database import
- Survey dispatch to contact list
- Batch NPS campaign
Request Body
json
{
"search_id": "search_id",
"page_id": "page_id",
"dispatch": true,
"resend_search": 1,
"clients": [
{
"name": "John Doe",
"email": "johndoe@example.com",
"phone": "(00) 0 0000-0000",
"born_date": "25/02/1980",
"approved": true
},
{
"name": "Jane Doe",
"email": "janedoe@example.com",
"phone": "(00) 0 0000-0000",
"born_date": "15/10/1985",
"approved": true
}
]
}| Field | Type | Required | Description |
|---|---|---|---|
search_id | string | No | Survey ID |
page_id | string | No | Page ID |
dispatch | boolean | No | Whether to automatically dispatch the survey |
resend_search | number | No | Number of survey resends |
clients | array | Yes | List of clients to register |
Client Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Client name |
email | string | No* | Email (*email or phone is required) |
phone | string | No* | Phone (*email or phone is required) |
born_date | string | No | Birth date (DD/MM/YYYY) |
approved | boolean | Yes | Consent for notifications |
Request Example
bash
curl -X POST "https://api-b2s.experienciab2s.com/api/clients/dispatch" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"search_id": "search_id",
"page_id": "page_id",
"dispatch": true,
"resend_search": 1,
"clients": [
{
"name": "John Doe",
"email": "johndoe@example.com",
"phone": "(00) 0 0000-0000",
"born_date": "25/02/1980",
"approved": true
}
]
}'Success Response (201)
json
{
"message": "Clients registered and survey sent successfully!"
}Response Codes
| Code | Description |
|---|---|
| 201 | Clients registered successfully |
| 400 | Validation error |
| 403 | Invalid token or unauthorized user |
| 404 | Token not found |
