Referência da API
Clientes
Gerenciar clientes pessoa física e jurídica
Clientes (Customers)
Gerencie seus clientes pessoa física e jurídica através da API.
Criar Cliente
POST /api/v1/clientsPessoa Física
{
"customer_type": "individual",
"full_name": "João da Silva",
"email": "joao@example.com",
"phone": "(11) 98765-4321",
"cpf": "123.456.789-00",
"date_of_birth": "1985-03-15",
"address": {
"street": "Rua das Flores, 123",
"neighborhood": "Centro",
"city": "São Paulo",
"state": "SP",
"postal_code": "01234-567",
"country": "Brasil"
}
}Pessoa Jurídica
{
"customer_type": "company",
"full_name": "Tech Solutions LTDA",
"email": "contato@techsolutions.com",
"cnpj": "12.345.678/0001-90",
"company_name": "Tech Solutions LTDA",
"phone": "(11) 3456-7890",
"address": {
"street": "Av. Paulista, 1000",
"neighborhood": "Bela Vista",
"city": "São Paulo",
"state": "SP",
"postal_code": "01310-100",
"country": "Brasil"
}
}Campos
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
customer_type | string | Sim | individual ou company |
full_name | string | Sim | Nome completo ou razão social |
email | string | Sim | Email válido |
phone | string | Não | Telefone |
cpf | string | Não | CPF (pessoa física) |
cnpj | string | Não | CNPJ (pessoa jurídica) |
company_name | string | Não | Razão social (pessoa jurídica) |
date_of_birth | string | Não | Data de nascimento (YYYY-MM-DD) |
address | object | Não | Endereço completo |
notes | string | Não | Observações internas |
Exemplo de Requisição
curl -X POST https://app.moblix.co/api/v1/clients \
-H "Authorization: Bearer mbx_live_sua_chave_aqui" \
-H "Content-Type: application/json" \
-d '{
"customer_type": "individual",
"full_name": "João da Silva",
"email": "joao@example.com",
"phone": "(11) 98765-4321"
}'const response = await fetch('https://app.moblix.co/api/v1/clients', {
method: 'POST',
headers: {
'Authorization': 'Bearer mbx_live_sua_chave_aqui',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_type: 'individual',
full_name: 'João da Silva',
email: 'joao@example.com',
phone: '(11) 98765-4321'
})
});
const data = await response.json();
console.log(data.customer);import requests
response = requests.post(
'https://app.moblix.co/api/v1/clients',
headers={
'Authorization': 'Bearer mbx_live_sua_chave_aqui',
'Content-Type': 'application/json'
},
json={
'customer_type': 'individual',
'full_name': 'João da Silva',
'email': 'joao@example.com',
'phone': '(11) 98765-4321'
}
)
data = response.json()
print(data['customer'])Resposta
{
"data": {
"customer": {
"id": "cust_abc123",
"customer_type": "individual",
"full_name": "João da Silva",
"email": "joao@example.com",
"phone": "(11) 98765-4321",
"cpf": null,
"is_active": true,
"created_at": "2026-01-26T10:30:00Z"
}
},
"timestamp": "2026-01-26T10:30:00Z"
}Listar Clientes
GET /api/v1/clientsQuery Parameters
| Parâmetro | Tipo | Descrição |
|---|---|---|
page | number | Número da página (padrão: 1) |
limit | number | Itens por página (padrão: 50, máx: 100) |
customer_type | string | Filtrar por tipo (individual ou company) |
search | string | Buscar por nome, email, CPF ou CNPJ |
is_active | boolean | Filtrar por status ativo |
Exemplo de Requisição
curl -X GET "https://app.moblix.co/api/v1/clients?search=joao&limit=20" \
-H "Authorization: Bearer mbx_live_sua_chave_aqui"Resposta
{
"data": {
"customers": [
{
"id": "cust_abc123",
"customer_type": "individual",
"full_name": "João da Silva",
"email": "joao@example.com",
"phone": "(11) 98765-4321",
"is_active": true,
"created_at": "2026-01-26T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}
},
"timestamp": "2026-01-26T10:30:00Z"
}Buscar Cliente por ID
GET /api/v1/clients/:idRetorna todos os dados do cliente, incluindo endereço e observações.
Exemplo de Requisição
curl -X GET https://app.moblix.co/api/v1/clients/cust_abc123 \
-H "Authorization: Bearer mbx_live_sua_chave_aqui"Resposta
{
"data": {
"id": "cust_abc123",
"customer_type": "individual",
"full_name": "João da Silva",
"email": "joao@example.com",
"phone": "(11) 98765-4321",
"cpf": "123.456.789-00",
"date_of_birth": "1985-03-15",
"address": {
"street": "Rua das Flores, 123",
"neighborhood": "Centro",
"city": "São Paulo",
"state": "SP",
"postal_code": "01234-567",
"country": "Brasil"
},
"notes": "Cliente VIP - preferência por assento janela",
"is_active": true,
"created_at": "2026-01-26T10:30:00Z",
"updated_at": "2026-01-26T10:30:00Z"
},
"timestamp": "2026-01-26T10:30:00Z"
}Atualizar Cliente
PATCH /api/v1/clients/:idEnvie apenas os campos que deseja atualizar.
Exemplo de Requisição
curl -X PATCH https://app.moblix.co/api/v1/clients/cust_abc123 \
-H "Authorization: Bearer mbx_live_sua_chave_aqui" \
-H "Content-Type: application/json" \
-d '{
"phone": "(11) 99999-9999",
"notes": "Cliente VIP - atualizado"
}'Resposta
{
"data": {
"id": "cust_abc123",
"full_name": "João da Silva",
"phone": "(11) 99999-9999",
"notes": "Cliente VIP - atualizado",
"updated_at": "2026-01-26T11:00:00Z"
},
"timestamp": "2026-01-26T11:00:00Z"
}Deletar Cliente
DELETE /api/v1/clients/:idExemplo de Requisição
curl -X DELETE https://app.moblix.co/api/v1/clients/cust_abc123 \
-H "Authorization: Bearer mbx_live_sua_chave_aqui"Se o cliente tiver reservas ou orçamentos vinculados, ele será apenas desativado (is_active: false) ao invés de deletado permanentemente.
Estrutura do Cliente
| Campo | Tipo | Descrição |
|---|---|---|
id | string | ID único do cliente |
customer_type | string | individual ou company |
full_name | string | Nome completo ou razão social |
email | string | |
phone | string | Telefone |
cpf | string | CPF (pessoa física) |
cnpj | string | CNPJ (pessoa jurídica) |
company_name | string | Razão social |
date_of_birth | string | Data de nascimento |
address | object | Endereço completo |
notes | string | Observações internas |
is_active | boolean | Se o cliente está ativo |
created_at | string | Data de criação |
updated_at | string | Data da última atualização |
Notas Importantes
Use customer_type: "individual" para pessoa física e "company" para pessoa jurídica.
Os clientes são isolados por equipe. Você só pode acessar clientes da sua própria equipe.