Start with shared fields, then the Mexico or Colombia guide. The CFDI, RFC, SAT catalog, and payment-complement examples below describe Mexico; they are not universal country requirements.
Overview
Clients are the foundation of your invoicing system. Each client contains fiscal information required for Mexican tax compliance, including RFC (tax ID), tax system, and address information.Key Features
- RFC Validation - Automatic tax ID validation against SAT
- EFOS Checking - Blacklist validation for compliance
- Address Management - Mexican address structure support
- Metadata Support - Custom fields for additional data
- Duplicate Prevention - Search for existing clients before creating (upsert-like behavior)
- Auto-creation - Create clients during invoice/payment flow
Endpoints
List Clients
Metadata Filtering:
You can filter clients by any metadata key using either dot notation or underscore notation. Both formats are equivalent and supported:
page parameter instead of the next cursor.
Example Requests:
Create Client
search parameter to find existing clients before creating:
- If a match is found and
search.updateisfalse(default): Returns the existing client without modifications (200). - If a match is found and
search.updateistrue: Updates the existing client with the provided data and returns it (200). - If no match is found: Creates a new client (201).
- If multiple matches are found: Returns a 409 Conflict error with the list of matching client IDs.
Example Request (Simple):
Get Client
Update Client
The response includes a
pending_receipts summary (attempted, succeeded, failed, skipped, failures) when the check is performed.
Example Request:
Delete Client
Validate Client
Stamp Pending Receipts
This issues real CFDIs. Each stamped receipt becomes a live invoice with the SAT, using the client’sPreconditions — the client document must already carry the fiscal data required by the CFDI:rfc,legal_name,address.zipandtax_system. There is no dry-run mode. Cancel throughDELETE /invoices/{id}if you stamp by mistake.
If any of these is missing the call returns
400 with code client_fiscal_data_incomplete and a details string naming the missing field(s). Nothing is stamped in that case.
Scope — only receipts that match all of the following are considered:
teamequals the effective team of the API key (or the?team=Connect target)livemodeequals the mode of the API key (a test key never touches live receipts)statusispendingclient.idequals{id}
remaining field reports how many pending receipts are still left for this client (including any that failed in this batch, since a failed receipt stays pending). Keep calling the endpoint until remaining is 0 to drain a backlog.
Example Request:
200 with { "stamped": 0, "failed": 0, "remaining": 0, "results": [] }.
Drain loop:
Customer Portal Access
id or email (if both are present, id wins). Omitting both returns 400 "Client ID or email is required".
The team must have a customer portal configured (customerPortalId); otherwise the call returns 400 "Team customer portal is not configured".
Request Body:
Example Request:
expires_at, epoch ms). Treat the URL as a credential — anyone holding it can see that client’s documents.
Upload CSF (Constancia de Situación Fiscal)
multipart/form-data in a file field. Add ?client_id= to update that client; omit it to create a new one.
201 (message: "Client created from CSF") or 200 (message: "Client updated with CSF data") with the client in data, in the standardized envelope. An unreadable PDF, missing fiscal data or an unknown client_id returns 400.
Support Documents
multipart/form-data with file (PDF, PNG, JPG or WEBP, up to 10 MB) and documentType; answers 201.
Client Structure
Required Fields
- None - All fields are optional for maximum flexibility
Important Fields
tax_id(string) - RFC for Mexican tax compliancetax_system(string) - SAT tax system code (e.g., “601”, “612”)use(string) - Default CFDI use code (e.g., “P01”, “G03”)email(string) - Email for invoice delivery
Tax System Codes
Common SAT tax system codes:601- General de Ley Personas Morales612- Persona Física con Actividades Empresariales621- Incorporación Fiscal622- Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras623- Opcional para Grupos de Sociedades624- Coordinados625- Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas626- Régimen Simplificado de Confianza
CFDI Use Codes
Common CFDI use codes:P01- Por definirG01- Adquisición de mercancíasG02- Devoluciones, descuentos o bonificacionesG03- Gastos en generalI01- ConstruccionesI02- Mobiliario y equipo de oficina por inversionesI03- Equipo de transporteI04- Equipo de computo y accesoriosI05- Dados, troqueles, moldes, matrices y herramentalI06- Comunicaciones telefónicasI07- Comunicaciones satelitalesI08- Otra maquinaria y equipo
Search and Duplicate Prevention
Thesearch parameter enables upsert-like behavior when creating clients. This is useful for integrations that may send the same client multiple times.
Direct Client Creation (POST /clients)
Within Invoices or Payments
When creating invoices or payments, you can search for existing clients inline:Search Behavior
Example: Update Existing Client on Match
tax_id: PEGJ800101ABC and update their email to nuevo.email@ejemplo.com.
Validation and Compliance
RFC Validation
- Automatic format validation
- SAT registry verification
EFOS Checking
- Blacklist validation against SAT’s EFOS list
- Automatic status updates
- Compliance reporting
Address Validation
- Mexican postal code verification
- Address completeness checking
Best Practices
- Always include tax_id for Mexican clients
- Set appropriate tax_system based on client type
- Use metadata for custom business logic
- Validate clients before important transactions
- Keep addresses updated for compliance
- Use search functionality to avoid duplicates
Related Resources
- Invoices API - Create invoices for clients
- Payments API - Process payments from clients
- Teams API - Manage team settings that affect clients
Error Handling
Common error scenarios:Invalid RFC Format
Client Not Found
EFOS Validation Failed
Multiple Clients Match Search Criteria (409 Conflict)
When using thesearch parameter and multiple clients match the criteria:
email or use the client id directly).
For additional assistance, contact support@gigstack.io