Moblix
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/clients

Pessoa 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

CampoTipoObrigatórioDescrição
customer_typestringSimindividual ou company
full_namestringSimNome completo ou razão social
emailstringSimEmail válido
phonestringNãoTelefone
cpfstringNãoCPF (pessoa física)
cnpjstringNãoCNPJ (pessoa jurídica)
company_namestringNãoRazão social (pessoa jurídica)
date_of_birthstringNãoData de nascimento (YYYY-MM-DD)
addressobjectNãoEndereço completo
notesstringNãoObservaçõ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/clients

Query Parameters

ParâmetroTipoDescrição
pagenumberNúmero da página (padrão: 1)
limitnumberItens por página (padrão: 50, máx: 100)
customer_typestringFiltrar por tipo (individual ou company)
searchstringBuscar por nome, email, CPF ou CNPJ
is_activebooleanFiltrar 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/:id

Retorna 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/:id

Envie 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/:id

Exemplo 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

CampoTipoDescrição
idstringID único do cliente
customer_typestringindividual ou company
full_namestringNome completo ou razão social
emailstringEmail
phonestringTelefone
cpfstringCPF (pessoa física)
cnpjstringCNPJ (pessoa jurídica)
company_namestringRazão social
date_of_birthstringData de nascimento
addressobjectEndereço completo
notesstringObservações internas
is_activebooleanSe o cliente está ativo
created_atstringData de criação
updated_atstringData 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.

On this page