limit (integer, 1-100) - Number of results per page (default: 10)next (string) - Pagination cursor for next pageteam (string) - gigstack Connect: Target team ID{
"message": "Clients retrieved successfully",
"data": [
{
"id": "client_1234567890",
"name": "Juan Pérez García",
"company": "Empresa SA de CV",
"email": "juan.perez@ejemplo.com",
"tax_id": "PEGJ800101ABC",
"tax_system": "601",
"livemode": true,
"created_at": 1677651234,
"efos": {
"is_valid": true
}
}
],
"has_more": false,
"total_results": 1
}search parameter to find existing clients before creating:search.update is false (default): Returns the existing client without modifications (200).search.update is true: Updates the existing client with the provided data and returns it (200).{
"name": "Juan Pérez García",
"company": "Empresa SA de CV",
"email": "juan.perez@ejemplo.com",
"phone": "+52 55 1234 5678",
"tax_id": "PEGJ800101ABC",
"tax_system": "601",
"use": "P01",
"legal_name": "Juan Pérez García",
"address": {
"country": "Mexico",
"street": "Av. Insurgentes Sur",
"exterior": "123",
"interior": "4B",
"neighborhood": "Del Valle",
"municipality": "Benito Juárez",
"city": "Ciudad de México",
"state": "CDMX",
"zip": "03100"
},
"metadata": {
"custom_field": "value"
},
"search": {
"on_key": "tax_id",
"on_value": "PEGJ800101ABC",
"update": false
}
}| Parameter | Type | Description |
|---|---|---|
on_key | string | The field to search on (e.g., tax_id, email, name) |
on_value | string | The value to match against the specified field |
update | boolean | If true and a match is found, update the existing client with the provided data. Default: false |
| Code | Description |
|---|---|
200 | Existing client found (when using search) |
201 | Client created successfully |
409 | Multiple clients match the search criteria |
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 delivery601 - 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 ConfianzaP01 - 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 equiposearch parameter enables upsert-like behavior when creating clients. This is useful for integrations that may send the same client multiple times.{
"name": "Juan Pérez García",
"email": "juan.perez@ejemplo.com",
"tax_id": "PEGJ800101ABC",
"tax_system": "601",
"search": {
"on_key": "tax_id",
"on_value": "PEGJ800101ABC",
"update": false
}
}{
"client": {
"search": {
"on_key": "tax_id",
"on_value": "PEGJ800101ABC",
"update": true
},
"name": "Juan Pérez García",
"email": "juan.perez@ejemplo.com",
"tax_id": "PEGJ800101ABC",
"tax_system": "601"
}
}| Scenario | Result |
|---|---|
Single match found, update: false | Returns existing client unchanged |
Single match found, update: true | Updates client with provided data, returns updated client |
| No match found | Creates new client automatically |
| Multiple matches found | Returns 409 Conflict with list of matching client IDs |
tax_id: PEGJ800101ABC and update their email to nuevo.email@ejemplo.com.{
"message": "Invalid tax_id format",
"error": "RFC must be 12 or 13 characters"
}{
"message": "Client not found",
"error": "The specified client does not exist"
}{
"message": "Client failed EFOS validation",
"error": "Client is on SAT blacklist"
}search parameter and multiple clients match the criteria:{
"success": false,
"error": {
"code": "resource_conflict",
"message": "Multiple clients found matching tax_id=\"PEGJ800101ABC\". Please use a more specific search criteria.",
"details": ["client_1234567890", "client_0987654321"]
}
}email or use the client id directly).