Create a customer
Customers
Create Customer
POST
Create a customer
Creates a new customer (receptor de facturas) for the organization.
Other examples of fiscal validation errors:
Authentication
Requires a valid Bearer token. The authenticated user must be a member of the organization.Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
organizationId | string (UUID) | Yes | Organization ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
legalName | string | Yes | Legal name (Razón Social) |
taxId | string | Yes | RFC del receptor (e.g. ABC101010111) |
taxSystem | string | Yes | SAT tax system code (Régimen Fiscal, e.g. 601) |
email | string | Yes | Customer email |
defaultInvoiceUse | string | Yes | Default CFDI use code (e.g. G01) |
addressStreet | string | Yes | Street name |
addressExterior | string | Yes | Exterior number |
addressNeighborhood | string | Yes | Neighborhood (Colonia) |
addressCity | string | Yes | City |
addressMunicipality | string | Yes | Municipality |
addressZip | string | Yes | 5-digit ZIP code |
addressState | string | Yes | State |
phone | string | No | Phone number |
addressInterior | string | No | Interior number |
addressCountry | string | No | Country code (default: MEX) |
Example Request
Example Response
Common Errors
400 Bad Request
Invalid RFC format, missing required fields, or invalid ZIP code.Fiscal validation error (CFDI 4.0)
WhentaxId, taxSystem, and defaultInvoiceUse are provided, the API validates that the combination is allowed by SAT CFDI 4.0 rules. RFC length determines persona type: 12 characters = persona moral, 13 characters = persona física. The régimen and uso CFDI must both be valid for that persona type, and the (uso, régimen) pair must exist in the SAT compatibility matrix.
"El régimen fiscal \"621\" no aplica para persona moral (RFC de 12 caracteres)""El uso de CFDI \"G01\" no es compatible con el régimen fiscal \"605\""
GET /sat/regimenes-fiscales and GET /sat/usos-cfdi to look up valid codes and compatible combinations before creating a customer.
401 Unauthorized
Authentication required.403 Forbidden
User is not a member of this organization.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Customer legal name (Razón Social)
Example:
"Dunder Mifflin"
Mexican RFC (tax identifier)
Example:
"ABC101010111"
SAT tax system code (Régimen Fiscal)
Example:
"601"
Customer email
Example:
"email@example.com"
Default CFDI use code
Example:
"G01"
Street name
Example:
"Blvd. Atardecer"
Exterior number
Example:
"142"
Neighborhood (Colonia)
Example:
"Centro"
City
Example:
"Huatabampo"
Municipality
Example:
"Huatabampo"
ZIP code
Example:
"86500"
State
Example:
"Sonora"
Customer phone number
Example:
"6474010101"
Interior number
Example:
"4"
Country code
Example:
"MEX"
Response
201 - application/json
Example:
"590ce6c56d04f840aa8438af"
Example:
"org-uuid"
Example:
"Dunder Mifflin"
Example:
"ABC101010111"
Example:
"601"
Example:
"email@example.com"
Example:
"G01"
Example:
"6474010101"