Skip to main content

Clients

List All Clients

curl -X GET "${VITE_BASE_URL}/client" \
  -H "Authorization: Bearer <token>"
Retrieves a list of all clients. Authentication Required: Yes

Response

data
array
Array of client objects
id
number
Client unique identifier
name
string
Client name or business name
email
string
Client email address
phone
string
Client phone number
rfc
string
RFC (Tax ID) for Mexican clients
address
string
Client address
created_at
string
Creation timestamp
{
  "data": [
    {
      "id": 1,
      "name": "Empresa XYZ S.A. de C.V.",
      "email": "[email protected]",
      "phone": "+52 55 1234 5678",
      "rfc": "EXY980101ABC",
      "address": "Av. Reforma 123, CDMX",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ]
}

Get Client by ID

curl -X GET "${VITE_BASE_URL}/client/1" \
  -H "Authorization: Bearer <token>"
Retrieves a single client by ID. Authentication Required: Yes

Path Parameters

id
number
required
Client ID

Response

id
number
Client unique identifier
name
string
Client name
email
string
Client email
phone
string
Client phone
rfc
string
RFC (Tax ID)
address
string
Client address
regimen_fiscal_id
number
Tax regime ID
cfdi_id
number
CFDI use ID
client_data
array
Additional client details
{
  "id": 1,
  "name": "Empresa XYZ S.A. de C.V.",
  "email": "[email protected]",
  "phone": "+52 55 1234 5678",
  "rfc": "EXY980101ABC",
  "address": "Av. Reforma 123, CDMX",
  "regimen_fiscal_id": 601,
  "cfdi_id": "G03",
  "client_data": [
    {
      "id": 1,
      "key": "industry",
      "value": "Retail"
    }
  ]
}

Create Client

curl -X POST "${VITE_BASE_URL}/client" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "New Client Company",
    "email": "[email protected]",
    "phone": "+52 55 9876 5432",
    "rfc": "NCO240101XYZ",
    "address": "Calle Principal 456",
    "regimen_fiscal_id": 601,
    "cfdi_id": "G03"
  }'
Creates a new client. Authentication Required: Yes

Request Body

name
string
required
Client name or business name
email
string
required
Client email address
phone
string
Client phone number
rfc
string
RFC (Tax ID) for Mexican clients
address
string
Client address
regimen_fiscal_id
number
Tax regime ID
cfdi_id
string
CFDI use code

Response

id
number
Created client ID
message
string
Success message
{
  "id": 42,
  "message": "Client created successfully"
}

Update Client

curl -X PUT "${VITE_BASE_URL}/client/1" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Client Name",
    "email": "[email protected]"
  }'
Updates an existing client. Authentication Required: Yes

Path Parameters

id
number
required
Client ID to update

Request Body

Same fields as Create Client (all optional for updates)

Delete Client

curl -X DELETE "${VITE_BASE_URL}/client/1" \
  -H "Authorization: Bearer <token>"
Deletes a client. Authentication Required: Yes

Path Parameters

id
number
required
Client ID to delete

Client Details

List All Client Details

curl -X GET "${VITE_BASE_URL}/client_data" \
  -H "Authorization: Bearer <token>"
Retrieves all client detail records (custom key-value pairs). Authentication Required: Yes

Get Client Detail by ID

curl -X GET "${VITE_BASE_URL}/client_data/1" \
  -H "Authorization: Bearer <token>"
Retrieves a specific client detail record. Authentication Required: Yes

Path Parameters

id
number
required
Client detail record ID

Create Client Detail

curl -X POST "${VITE_BASE_URL}/client_data" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": 1,
    "key": "payment_terms",
    "value": "Net 30"
  }'
Creates a new client detail record. Authentication Required: Yes

Request Body

client_id
number
required
Client ID this detail belongs to
key
string
required
Detail key (e.g., “industry”, “payment_terms”)
value
string
required
Detail value

Update Client Detail

curl -X PUT "${VITE_BASE_URL}/client_data/1" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"value": "Net 60"}'
Updates an existing client detail record. Authentication Required: Yes

Path Parameters

id
number
required
Client detail record ID

Delete Client Detail

curl -X DELETE "${VITE_BASE_URL}/client_data/1" \
  -H "Authorization: Bearer <token>"
Deletes a client detail record. Authentication Required: Yes

Path Parameters

id
number
required
Client detail record ID to delete

Build docs developers (and LLMs) love