Integration note: Creating a contact does not establish fiscal validity. Inspect fiscal_validation when returned; contact-only input can produce status skipped. A matching search with update false returns the existing customer with HTTP 200; a new record returns 201. Read shared fields and the Mexico or Colombia guide for country-specific meaning. The linked fiscal recipes and staging issuance results use a Mexican issuer.
Create a new client with fiscal information for Mexican tax compliance.
Duplicate Prevention (Upsert): Use the search parameter to find existing clients before creating:
If a match is found and search.update is false (default): Returns the existing client without modifications.
If a match is found and search.update is true: Updates the existing client with the provided data and returns it.
If no match is found: Creates a new client.
This is useful for integrations that may send the same client multiple times.
gigstack Connect: Create clients for other teams using the team parameter.
Errors: credential failures are answered by the authentication layer with a raw
{ "message": ⦠} body, not the standardized envelope ā 401 for a missing, malformed or
expired token, 403 for a revoked key or a plan without API access. See the Unauthorized
and AuthForbidden responses.
gigstack Connect: Target team ID for multi-team access.
Requires gigstack Connect enabled on your team and shared billing account.
Also requires the multipleIssuerAccounts feature on your plan. Requests targeting a
team other than the one your API key belongs to return 403 without it.
Only API keys can use it: an OAuth access token sent with another team's id is rejected with
403 Team mismatch with OAuth token.
Optional ā omit it entirely unless you are acting on another team. It deliberately
carries no example value so generated snippets do not emit ?team=undefined; when the
parameter is absent, the team is derived from your API key.
Example:?team=team_xyz789
Body
application/json
Creation body for POST /v2/clients. name is required when creating a client.
For PUT /v2/clients/{id}, use ClientUpdateInput: an omitted name is preserved
from the existing client before validation.
Unknown top-level keys are rejected (400 validation_failed / unexpected_key);
metadata is the one object that accepts arbitrary keys. team, livemode and
owner are reserved and injected by the auth middleware.
The document_type, organization_type, tribute_code, fiscal_responsibilities,
dv and municipality_code
fields are the Colombian DIAN identification set. They are accepted for every team
regardless of country; each also accepts the empty string, which means "not set" and is
dropped before the client is stored.
Search for an existing client before creating. If a match is found, the existing client is returned (or updated if update: true).
This enables upsert-like behavior to avoid duplicate clients.
Colombia (DIAN).1 = persona jurĆdica, 2 = persona natural.
Accepted as either a number (1, 2) or a string ("1", "2").
The empty string means "not set".
Only applies to PUT /clients/{id}. When true (default) and the updated client passes fiscal validation, all of the client's pending receipts are automatically invoiced using the new client data. Set to false to skip this behavior.
Example:
true
Response
Existing client found (when using search parameter)