Create a Customer

Create a new customer in the system.

POST https://api.platica.mx/v1/clients

Request body

FieldTypeDescriptionRequired
namestringCustomer full name
phoneNumberstringPhone number in E.164 format without +
firstnamestringCustomer first name
lastnamestringCustomer last name
emailstringCustomer email
birthdatestringDate of birth. Format: dd/mm/yyyy
genderenumGender: male or female
companystringCompany name
countryenumCountry of residence (ISO 3166-1 alpha-2 code)
statestringState of residence
citystringCity of residence
addressstringFull address
postalCodestringPostal code
tagsarrayArray of tags
customFieldsobjectCustom fields (see Custom Fields )
ownersarrayList 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 select value, send null or an empty string "".

Response

{
  "status": "success",
  "message": "Client created successfully",
  "data": {
    "id": "274fc73cb7d84a17955914fdc1a1f9d0",
    "wasUpdated": false
  }
}

Notes on the response

  • wasUpdated: false indicates a new customer was created
  • wasUpdated: true indicates a customer with that phone number already existed and was updated instead of creating a new one