Skip to content

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"
}
FieldTypeRequiredDescription
namestringYesClient name
emailstringNo*Client email (*email or phone is required)
phonestringNo*Client phone (*email or phone is required)
born_datestringNoBirth date in DD/MM/YYYY format
approvedbooleanYesConsent to receive notifications
search_idstringNoSurvey 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 link field is only returned when search_id is 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"
}
FieldTypeRequiredDescription
namestringYesClient name
emailstringNo*Client email (*email or phone is required)
phonestringNo*Client phone (*email or phone is required)
born_datestringNoBirth date in DD/MM/YYYY format
approvedbooleanYesConsent to receive notifications
order_idstringYesUnique order identifier in the POS system
order_valuenumberYesOrder value in decimal format
order_created_atstringYesOrder creation timestamp (ISO 8601 or 'YYYY-MM-DD HH:mm:ss')
order_typestringYesOrder type (e.g., Delivery, Pickup, Dine-in)
search_idstringNoSurvey 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 link field is only returned when search_id is 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
    }
  ]
}
FieldTypeRequiredDescription
search_idstringNoSurvey ID
page_idstringNoPage ID
dispatchbooleanNoWhether to automatically dispatch the survey
resend_searchnumberNoNumber of survey resends
clientsarrayYesList of clients to register

Client Fields

FieldTypeRequiredDescription
namestringYesClient name
emailstringNo*Email (*email or phone is required)
phonestringNo*Phone (*email or phone is required)
born_datestringNoBirth date (DD/MM/YYYY)
approvedbooleanYesConsent 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

CodeDescription
201Clients registered successfully
400Validation error
403Invalid token or unauthorized user
404Token not found

Integration Documentation