Create a Customer
Create a new customer in the system.
POST https://api.platica.mx/v1/clients Request body
| Field | Type | Description | Required |
|---|---|---|---|
name | string | Customer full name | ✓ |
phoneNumber | string | Phone number in E.164 format without + | ✓ |
firstname | string | Customer first name | — |
lastname | string | Customer last name | — |
email | string | Customer email | — |
birthdate | string | Date of birth. Format: dd/mm/yyyy | — |
gender | enum | Gender: male or female | — |
company | string | Company name | — |
country | enum | Country of residence (ISO 3166-1 alpha-2 code) | — |
state | string | State of residence | — |
city | string | City of residence | — |
address | string | Full address | — |
postalCode | string | Postal code | — |
tags | array | Array of tags | — |
customFields | object | Custom fields (see Custom Fields ) | — |
owners | array | List of emails of users responsible for the customer | — |
Example request
{
"name": "José Pérez",
"phoneNumber": "524491234567",
"email": "jose@platica.mx",
"tags": ["vip"],
"customFields": {
"placas": "ABC123",
"id_recepcion": "REC001"
}
} Select custom-field values (select)
For a select custom field, send in customFields the option id or its label; the API resolves it and stores the option id.
{
"name": "José Pérez",
"phoneNumber": "524491234567",
"customFields": {
"etapa_de_venta": "Contactado"
}
} - If the value does not match any active option of the field, the API returns
400. - To clear a
selectvalue, sendnullor an empty string"".
Response
{
"status": "success",
"message": "Client created successfully",
"data": {
"id": "274fc73cb7d84a17955914fdc1a1f9d0",
"wasUpdated": false
}
} Notes on the response
wasUpdated: falseindicates a new customer was createdwasUpdated: trueindicates a customer with that phone number already existed and was updated instead of creating a new one