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):
Warnings: a create (and a
search match with update: true) returns a warnings array next to
the client. A warning never blocks the request: the client is saved as sent. It is empty when the
data looks right.
Get Client
Update Client
address changes only the leaves you send. An explicitly sent value is
written, including an empty list such as "bcc": []. Null and empty strings are ignored, so
they do not clear a field.
Behavior change (2026-10): before this change, an update that omittedBody Parameters:bcc,defaults.keep_full_legal_nameordefaults.issue_automatic_invoicesreset them to their create defaults ([],false, automatic invoices on), and every update rewrote the client’sfromorigin. They are now left untouched unless you send them.
The response includes a
pending_receipts summary (attempted, succeeded, failed, skipped, failures) when the check is performed.
It also includes the same warnings array as Create Client, computed from the client as stored after the update.
Example Request:
Delete Client
Validate Client
POST /clients/validate/{id} runs the
same validation but is deprecated.
Example Request:
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 throughPOST /invoices/{id}/cancelif 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
POST /clients/customerportal is deprecated. For one release (a compatibility window) it still
issues a URL to personal sessions and unscoped API keys; scoped API keys get 410 and no URL.
Use portal access preparation to create an operation, read its
status and open the private browser handoff for review. Agents receive safe operation
metadata; the access URL appears only in the first successful private browser response.
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 malformed client_id returns 400. A missing client or a client outside the selected team returns the same 404; ownership is checked before parsing and again before saving.
Existing clients are shared team catalogue records. Updating one from a CSF affects the same client used in both live and sandbox workflows and preserves its stored mode, including older records without a mode. A newly created client uses the credential mode. Review the target client before updating fiscal data.
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