# Timbrix - [Documentación de Timbrix](https://docs.timbrix.mx/index.md): API REST y guía para emitir, timbrar y cancelar CFDI 4.0. - [Quickstart](https://docs.timbrix.mx/quickstart.md): Crea tu cuenta, usa tu API key de sandbox y timbra tu primer CFDI de prueba - [SDK de TypeScript](https://docs.timbrix.mx/sdk.md): Instala @timbrix/sdk y timbra tu primer CFDI de prueba - [SDK de PHP](https://docs.timbrix.mx/sdk-php.md): Instala timbrix/sdk-php, timbra tu primer CFDI de prueba y verifica webhooks - [Facturas a crédito (PPD)](https://docs.timbrix.mx/facturas-a-credito.md): Cuándo emitir un complemento de pago y cómo registrarlo en Timbrix - [Lista 69-B del SAT](https://docs.timbrix.mx/lista-69b.md): Qué pasa cuando el RFC de tu cliente (o el tuyo) aparece en la lista de operaciones presuntamente inexistentes, y qué hace Timbrix al respecto - [Series y folios](https://docs.timbrix.mx/series-y-folios.md): Cómo Timbrix numera tus facturas: series por tipo de comprobante, folio automático o manual, y qué esperar cuando algo falla - [Glosario fiscal](https://docs.timbrix.mx/glossary.md): CFDI, RFC, PAC, CSD y los demás términos fiscales que verás en la documentación y el dashboard de Timbrix. - [Glosario de errores SAT](https://docs.timbrix.mx/errors.md): Causas y soluciones de los errores CFDI##### más comunes al timbrar con Timbrix, y cómo se ven en cada canal (API REST, SDK, MCP). - [Depurar tu integración](https://docs.timbrix.mx/debugging.md): Encuentra por qué falló una request a la API de Timbrix usando el request log y el header X-Request-Id. - [Auditoría](https://docs.timbrix.mx/audit-log.md): Quién hizo qué y cuándo en tu organización: qué se registra, qué guarda cada entrada, por qué no se puede alterar y cómo consultarla o exportarla. - [Changelog](https://docs.timbrix.mx/changelog.md): Novedades, correcciones y cambios importantes de la API, SDK, CLI y MCP de Timbrix. - [Roadmap](https://docs.timbrix.mx/roadmap.md): Lo que estamos construyendo en Timbrix: próximas funciones de CFDI 4.0, integraciones y cumplimiento fiscal. - [Agentes de IA (MCP)](https://docs.timbrix.mx/ai-agents.md): Cómo timbrar, cancelar y consultar CFDI 4.0 desde un agente de IA (Claude, Cursor, LangChain) usando el servidor MCP oficial de Timbrix. Tiempo estimado: 20 minutos. - [API Reference](https://docs.timbrix.mx/api-reference/introduction.md): Integrate CFDI 4.0 electronic invoicing into your applications with the Timbrix REST API - [Create Organization](https://docs.timbrix.mx/api-reference/organizations/create.md): Creates a new organization with the authenticated user as the owner. All authenticated users can create organizations. - [Get Organization](https://docs.timbrix.mx/api-reference/organizations/get.md): Retrieves organization details with normalized structure. User must be a member (owner, admin, or member) to access. - [Update Organization](https://docs.timbrix.mx/api-reference/organizations/update.md): ⚠️ SECURITY: Only the organization OWNER can update organization details. Admins and members cannot perform this action. - [Update Legal Data](https://docs.timbrix.mx/api-reference/organizations/update-legal-data.md): Update the legal and fiscal information of an organization - [Upload Certificates](https://docs.timbrix.mx/api-reference/organizations/upload-certificates.md): Upload CSD certificate and private key for invoice signing - [Delete Certificates](https://docs.timbrix.mx/api-reference/organizations/delete-certificates.md): Delete CSD certificate and private key from an organization - [Close Preview](https://docs.timbrix.mx/api-reference/organizations/close-preview.md): Tells whether `DELETE /organizations/:id` would delete the organization (no production CFDI) or close it (production CFDI retained until `retainedUntil`), and how many stamps or cancellations are still in progress (which block both). - [Delete Organization](https://docs.timbrix.mx/api-reference/organizations/delete.md): ⚠️ SECURITY: Only the organization OWNER can perform this action. If the organization has never stamped a production CFDI, it is deleted PERMANENTLY (sandbox invoices included). If it has production CFDI, it is CLOSED instead: it becomes read-only, its CFDI are retained and downloadable until `retai… - [Reopen Organization](https://docs.timbrix.mx/api-reference/organizations/reopen.md): Reopens a closed organization whose Stripe subscription is still alive (scheduled to cancel at period end): the scheduled cancellation is removed and the organization becomes writable again. API keys and webhooks stay deactivated until the owner reactivates them. If there is no live subscription, re… - [Transfer Ownership](https://docs.timbrix.mx/api-reference/organizations/transfer-ownership.md): The owner hands the organization to another member (by user id). The new owner gets the owner role and the previous owner becomes an admin. Emits member.role_updated for both users. - [List Members](https://docs.timbrix.mx/api-reference/members/list.md): Lists all members of the organization with their roles. User must be a member to view. - [Invite Member](https://docs.timbrix.mx/api-reference/members/invite.md): ⚠️ SECURITY: Only organization OWNERS and ADMINS can invite new members. Members cannot invite others. - [Update Member Role](https://docs.timbrix.mx/api-reference/members/update-role.md): ⚠️ SECURITY: Only OWNERS and ADMINS can change member roles. The OWNER role cannot be changed or transferred. - [Remove Member](https://docs.timbrix.mx/api-reference/members/remove.md): ⚠️ SECURITY: Only OWNERS and ADMINS can remove members. The organization OWNER cannot be removed. - [List Invites](https://docs.timbrix.mx/api-reference/invites/list.md): Lists all pending invitations for the organization. User must be a member to view. - [Cancel Invite](https://docs.timbrix.mx/api-reference/invites/cancel.md): ⚠️ SECURITY: Only OWNERS and ADMINS can cancel pending invitations. - [Login](https://docs.timbrix.mx/api-reference/auth/login.md): Autentica a un usuario contra Supabase Auth y devuelve un access token (JWT) y un refresh token. El access token se usa como Bearer token en el resto de endpoints autenticados por sesión de usuario. - [Logout](https://docs.timbrix.mx/api-reference/auth/logout.md): Revoca el access token actual en Supabase Auth. Idempotente: si no se envía un header Authorization, responde éxito sin efecto. - [Create OAuth Application](https://docs.timbrix.mx/api-reference/oauth/create-app.md): ⚠️ SECURITY: Creates an OAuth2 application. Only OWNERS and ADMINS can create OAuth apps. Returns client secret ONCE - store it securely! - [List OAuth Applications](https://docs.timbrix.mx/api-reference/oauth/list-apps.md): ⚠️ SECURITY: Only OWNERS and ADMINS can list OAuth applications. Returns all OAuth apps created for the organization. - [Get OAuth Application](https://docs.timbrix.mx/api-reference/oauth/get-app.md): ⚠️ SECURITY: Only OWNERS and ADMINS can view OAuth application details. Returns application configuration without exposing the client secret. - [Update OAuth Application](https://docs.timbrix.mx/api-reference/oauth/update-app.md): ⚠️ SECURITY: Only OWNERS and ADMINS can update OAuth applications. Allows updating name, scopes, redirect URIs, and status. Client ID and secret cannot be changed. - [Delete OAuth Application](https://docs.timbrix.mx/api-reference/oauth/delete-app.md): ⚠️ SECURITY: Only OWNERS and ADMINS can delete OAuth applications. This action is PERMANENT. All tokens associated with this application will be revoked. - [Authorization Endpoint](https://docs.timbrix.mx/api-reference/oauth/authorize.md): 🔓 PUBLIC ENDPOINT: Standard OAuth2 authorization endpoint. Validates request parameters and redirects to the consent screen. Supports PKCE for enhanced security. This is the entry point for Authorization Code Flow - compatible with standard OAuth2 clients. - [Generate OAuth Access Token](https://docs.timbrix.mx/api-reference/oauth/token.md): 🔓 PUBLIC ENDPOINT: Generates an OAuth2 access token using client credentials flow. Requires valid client_id and client_secret. Token scopes are validated against application configuration. Rate limit: 10 requests per minute. - [Exchange Authorization Code](https://docs.timbrix.mx/api-reference/oauth/exchange.md): 🔓 PUBLIC ENDPOINT: Exchanges an authorization code for access and refresh tokens (Authorization Code Flow). Requires valid code, client_id, client_secret, and redirect_uri. Rate limit: 15 requests per minute. - [Refresh OAuth Token](https://docs.timbrix.mx/api-reference/oauth/refresh.md): 🔓 PUBLIC ENDPOINT: Exchanges a refresh token for a new access token and refresh token pair. The old refresh token is automatically revoked. Rate limit: 20 requests per minute. - [List OAuth Tokens](https://docs.timbrix.mx/api-reference/oauth/list-tokens.md): ⚠️ SECURITY: Lists all active tokens for an OAuth application. Only OWNERS and ADMINS can view tokens. Useful for auditing and token management. - [Revoke OAuth Token](https://docs.timbrix.mx/api-reference/oauth/revoke.md): ⚠️ SECURITY: Revokes an OAuth access token. Requires OAuth authentication with scope "write:oauth-apps". Revoked tokens cannot be used for API access. - [List Customers](https://docs.timbrix.mx/api-reference/customers/list.md): Sin parámetros devuelve todos los clientes. `q` busca en razón social, RFC y correo; `limit` acota el resultado. - [Create Customer](https://docs.timbrix.mx/api-reference/customers/create.md) - [Get Customer](https://docs.timbrix.mx/api-reference/customers/get.md) - [Update Customer](https://docs.timbrix.mx/api-reference/customers/update.md) - [Delete Customer](https://docs.timbrix.mx/api-reference/customers/delete.md) - [SAT Catalogs](https://docs.timbrix.mx/api-reference/sat-catalogs.md): Public endpoints to query SAT CFDI 4.0 catalog data — tax systems (regímenes fiscales), CFDI uses (usos CFDI), product/service keys (claves de producto o servicio), and units of measure (claves de unidad) - [List Invoices](https://docs.timbrix.mx/api-reference/invoices/list.md): Authenticate with either a Supabase session (send the `X-Organization-Id` header, must be a member of that organization) or an API key (external integrations, requires the `read:invoices` scope). Results are ordered by creation date, newest first. - [Get Invoice](https://docs.timbrix.mx/api-reference/invoices/get.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. Returns the same shape as the `POST /invoices` response — use this to recover an invoice's metadata/XML if the original create response was lost. - [Download Invoice XML](https://docs.timbrix.mx/api-reference/invoices/download-xml.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. Streams back the exact XML returned by the PAC at stamping time, as stored in `invoices.xml`. - [Download Cancellation Receipt](https://docs.timbrix.mx/api-reference/invoices/download-cancellation-receipt.md) - [Download Invoice PDF](https://docs.timbrix.mx/api-reference/invoices/download-pdf.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. The PDF is generated on demand from the stamped XML — nothing is persisted. - [Create Invoice](https://docs.timbrix.mx/api-reference/invoices/create.md): Authenticate with either a Supabase session (send the `X-Organization-Id` header, must be a member of that organization) or an API key (external integrations, requires the `write:invoices` scope — the organization is resolved from the key). The customer can be sent inline (`customer`) or referenced… - [Register Payment (Complemento de Pago)](https://docs.timbrix.mx/api-reference/invoices/register-payment.md): Send the paid invoices (`documents: [{ invoiceUuid, amount }]`, 1 to 50, same customer and currency). Timbrix computes the installment number, previous and remaining balances and proportional taxes, and stamps one Complemento de Pago 2.0. Each one counts as a CFDI of your plan. - [Get Payments](https://docs.timbrix.mx/api-reference/invoices/get-payments.md): Lists every Complemento de Pago of the invoice (vigente, cancelado or en_proceso). `paid` and `balance` count only vigente and en_proceso. - [Preview Invoice PDF](https://docs.timbrix.mx/api-reference/invoices/preview-pdf.md): Accepts the exact same request body as `POST /invoices`, runs the exact same catalog/CFDI 4.0 validations, but never timbra (no PAC call) and never persists anything — no invoice, no cuota consumida, no idempotencyKey handling. Returns a PDF clearly marked as 'VISTA PREVIA — NO VÁLIDO FISCALMENTE' s… - [Cancel Invoice](https://docs.timbrix.mx/api-reference/invoices/cancel.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. Determines automatically whether the cancellation is direct or requires receptor approval per SAT rules — Timbrix cannot confirm receptor approval in real time, so a… - [Resolve Cancellation](https://docs.timbrix.mx/api-reference/invoices/resolve-cancellation.md): Timbrix cannot query SAT in real time for the receptor's response — call this once you've confirmed the outcome via the SAT portal. - [List Invoice Cancellations](https://docs.timbrix.mx/api-reference/invoices/list-cancellations.md) - [Email Invoice](https://docs.timbrix.mx/api-reference/invoices/email.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. `to` is optional — if omitted, the recipient is resolved from the Customer registered for the invoice's RFC receptor (if it has an email on file). Retries automatical… - [Get CFDI Usage](https://docs.timbrix.mx/api-reference/invoices/usage.md): Authenticate with either a Supabase session (send the `X-Organization-Id` header) or an API key (external integrations, requires the `read:invoices` scope). Returns how many CFDI the organization has stamped this calendar month (Mexico City time) against its plan's included quota. `cfdiIncluded`/`cf… - [Get Invoice Report Summary](https://docs.timbrix.mx/api-reference/invoices/report-summary.md): Subtotal/total are summed via SQL (unbounded). IVA is computed by parsing each matching invoice's stamped XML — capped at 2000 matching invoices per request; beyond that, `iva` is `null` and `ivaCapped` is `true`, and the caller should narrow the date range. - [Export Invoices as CSV](https://docs.timbrix.mx/api-reference/invoices/export-csv.md): Capped at 500 matching invoices per request — narrow the date range if you hit the limit. - [Export Invoices as XML ZIP](https://docs.timbrix.mx/api-reference/invoices/export-xml.md): Capped at 500 matching invoices per request. - [Export Invoices as PDF ZIP](https://docs.timbrix.mx/api-reference/invoices/export-pdf.md): Capped at 500 matching invoices per request — PDF generation for many invoices in one request can be slow, this is a known limit for this first version. - [List Request Logs](https://docs.timbrix.mx/api-reference/request-logs/list.md): Requests made with your API keys in the last 30 days, newest first. API key needs `read:request-logs`; a session must be owner or admin. - [Request stats](https://docs.timbrix.mx/api-reference/request-logs/stats.md): Counts per time bucket (2xx, 4xx, 5xx, total) for the same filters as the list. Empty buckets are returned as zeros. - [Get Request Log](https://docs.timbrix.mx/api-reference/request-logs/get.md) - [List Audit Log Entries](https://docs.timbrix.mx/api-reference/audit-logs/list.md) - [Get Audit Log Entry](https://docs.timbrix.mx/api-reference/audit-logs/get.md) - [Export Audit Log as CSV](https://docs.timbrix.mx/api-reference/audit-logs/export.md) - [Verify Audit Log Integrity](https://docs.timbrix.mx/api-reference/audit-logs/verify.md) - [List Products](https://docs.timbrix.mx/api-reference/products/list.md) - [Create Product](https://docs.timbrix.mx/api-reference/products/create.md) - [Import Products from CSV](https://docs.timbrix.mx/api-reference/products/import.md): Uploads a CSV file (multipart/form-data, field name "file") and creates one product per data row. Required columns: description, productKey, price. Optional columns: unitKey (default H87), unitName, sku, taxIncluded, taxability, livemode — same field names as the JSON create endpoint. Each row is va… - [Get Product](https://docs.timbrix.mx/api-reference/products/get.md) - [Update Product](https://docs.timbrix.mx/api-reference/products/update.md) - [Delete Product](https://docs.timbrix.mx/api-reference/products/delete.md) - [Get Current User](https://docs.timbrix.mx/api-reference/users/me.md): Returns the profile information of the currently authenticated user. Requires Supabase authentication token. - [Get User by ID](https://docs.timbrix.mx/api-reference/users/get.md): ⚠️ SECURITY: Retrieves user profile by ID. Requires authentication with scope "read:user". Supports both OAuth tokens and API keys. - [Get User by Email](https://docs.timbrix.mx/api-reference/users/get-by-email.md): ⚠️ SECURITY: Retrieves user profile by email address. Requires authentication with scope "read:user". Supports both OAuth tokens and API keys. Useful for user lookups and invitations. - [Get User Organizations](https://docs.timbrix.mx/api-reference/users/organizations.md): ⚠️ SECURITY: Lists all organizations a user belongs to. Requires authentication with scope "read:organization". Supports both OAuth tokens and API keys. Returns organizations with membership details. - [Delete My Account](https://docs.timbrix.mx/api-reference/users/delete-me.md): Permanently deletes the authenticated user's identity (ARCO cancellation). Only a user session token is accepted, never an API key. Fails with 409 SOLE_OWNER_OF_ACTIVE_ORGANIZATION if the user still owns active organizations. - [List Organization Webhooks](https://docs.timbrix.mx/api-reference/webhooks/list.md): Lists all webhooks for an organization. Only OWNERS and ADMINS can view webhooks. - [Create Webhook](https://docs.timbrix.mx/api-reference/webhooks/create.md): Creates a webhook endpoint for receiving events. Only OWNERS and ADMINS can create webhooks. - [Get Webhook by ID](https://docs.timbrix.mx/api-reference/webhooks/get.md): Retrieves webhook configuration. Returns webhook details including URL, events, and status. - [Update Webhook](https://docs.timbrix.mx/api-reference/webhooks/update.md): Updates webhook configuration. Allows updating URL, events, and active status. - [Delete Webhook](https://docs.timbrix.mx/api-reference/webhooks/delete.md): Deletes a webhook endpoint. This action is PERMANENT. The webhook will stop receiving events immediately. - [Get Webhook Delivery History](https://docs.timbrix.mx/api-reference/webhooks/deliveries.md): Retrieves delivery history for a webhook. Returns up to 100 recent deliveries with status, response codes, and retry info. - [Send Test Webhook](https://docs.timbrix.mx/api-reference/webhooks/test.md): Sends a test webhook event to verify configuration. Useful for testing webhook endpoint and HMAC signature verification. - [List Series](https://docs.timbrix.mx/api-reference/series/list.md) - [Create Series](https://docs.timbrix.mx/api-reference/series/create.md): Only owners and admins can create series. - [Update Series](https://docs.timbrix.mx/api-reference/series/update.md): Only owners and admins. The series name cannot be changed. - [Delete Series](https://docs.timbrix.mx/api-reference/series/delete.md): Only owners and admins. A default series cannot be deleted (SERIES_IS_DEFAULT). - [Set Default Series](https://docs.timbrix.mx/api-reference/series/set-default.md): Only owners and admins. Returns the updated series list. - [List API Keys](https://docs.timbrix.mx/api-reference/api-keys/list.md): List all API keys for an organization (requires authentication) - [Create API Key](https://docs.timbrix.mx/api-reference/api-keys/create.md): Create a new API key for an organization. Plain key is returned only once! - [Get API Key](https://docs.timbrix.mx/api-reference/api-keys/get.md): Retrieve details of a specific API key - [Update API Key](https://docs.timbrix.mx/api-reference/api-keys/update.md): Update API key settings (name, scopes, rate limits, etc.) - [Delete API Key](https://docs.timbrix.mx/api-reference/api-keys/delete.md): Permanently delete an API key - [Get API Key Statistics](https://docs.timbrix.mx/api-reference/api-keys/stats.md): Get usage statistics for all API keys in an organization - [Validate API Key](https://docs.timbrix.mx/api-reference/api-keys/validate.md): Test endpoint to validate API key authentication and scopes. Use X-API-Key header. - [Create a new organization](https://docs.timbrix.mx/api-reference/organizations/create-a-new-organization.md): Creates a new organization with the authenticated user as the owner. All authenticated users can create organizations. - [Validate CSD certificate and optionally verify private key password](https://docs.timbrix.mx/api-reference/organizations/validate-csd-certificate-and-optionally-verify-private-key-password.md): Validates a CSD certificate file and extracts metadata (RFC, serial number, expiration). Optionally validates the private key password. Does not store the certificate. Useful for pre-validation during onboarding. - [Get organization by ID](https://docs.timbrix.mx/api-reference/organizations/get-organization-by-id.md): Retrieves organization details with normalized structure. User must be a member (owner, admin, or member) to access. - [Update organization (owner only)](https://docs.timbrix.mx/api-reference/organizations/update-organization-owner-only.md): ⚠️ SECURITY: Only the organization OWNER can update organization details. Admins and members cannot perform this action. - [Delete or close organization (owner only)](https://docs.timbrix.mx/api-reference/organizations/delete-or-close-organization-owner-only.md): ⚠️ SECURITY: Only the organization OWNER can perform this action. If the organization has never stamped a production CFDI, it is deleted PERMANENTLY (sandbox invoices included). If it has production CFDI, it is CLOSED instead: it becomes read-only, its CFDI are retained and downloadable until `retai… - [Update organization legal/fiscal data (owner only)](https://docs.timbrix.mx/api-reference/organizations/update-organization-legalfiscal-data-owner-only.md): ⚠️ SECURITY: Only the organization OWNER can update legal and fiscal information. This includes tax system, legal name, address, and contact details. - [Upload CSD certificate (owner only)](https://docs.timbrix.mx/api-reference/organizations/upload-csd-certificate-owner-only.md): ⚠️ SECURITY: Only the organization OWNER can upload CSD certificates. Files are encrypted with AWS KMS and stored in S3. - [Delete CSD certificates (owner only)](https://docs.timbrix.mx/api-reference/organizations/delete-csd-certificates-owner-only.md): ⚠️ SECURITY: Only the organization OWNER can delete CSD certificates. This removes the certificate files from S3 and clears all certificate metadata. - [Preview deleting or closing the organization (owner only)](https://docs.timbrix.mx/api-reference/organizations/preview-deleting-or-closing-the-organization-owner-only.md): Tells whether `DELETE /organizations/:id` would delete the organization (no production CFDI) or close it (production CFDI retained until `retainedUntil`), and how many stamps or cancellations are still in progress (which block both). - [Reopen a closed organization (owner only)](https://docs.timbrix.mx/api-reference/organizations/reopen-a-closed-organization-owner-only.md): Reopens a closed organization whose Stripe subscription is still alive (scheduled to cancel at period end): the scheduled cancellation is removed and the organization becomes writable again. API keys and webhooks stay deactivated until the owner reactivates them. If there is no live subscription, re… - [Transfer organization ownership (owner only)](https://docs.timbrix.mx/api-reference/organizations/transfer-organization-ownership-owner-only.md): The owner hands the organization to another member (by user id). The new owner gets the owner role and the previous owner becomes an admin. Emits member.role_updated for both users. - [Get organization members](https://docs.timbrix.mx/api-reference/organizations/get-organization-members.md): Lists all members of the organization with their roles. User must be a member to view. - [Invite a member (owner/admin only)](https://docs.timbrix.mx/api-reference/organizations/invite-a-member-owneradmin-only.md): ⚠️ SECURITY: Only organization OWNERS and ADMINS can invite new members. Members cannot invite others. - [Remove a member (owner/admin only)](https://docs.timbrix.mx/api-reference/organizations/remove-a-member-owneradmin-only.md): ⚠️ SECURITY: Only OWNERS and ADMINS can remove members. The organization OWNER cannot be removed. - [Update member role (owner/admin only)](https://docs.timbrix.mx/api-reference/organizations/update-member-role-owneradmin-only.md): ⚠️ SECURITY: Only OWNERS and ADMINS can change member roles. The OWNER role cannot be changed or transferred. - [Get pending invitations](https://docs.timbrix.mx/api-reference/organizations/get-pending-invitations.md): Lists all pending invitations for the organization. User must be a member to view. - [Cancel an invitation (owner/admin only)](https://docs.timbrix.mx/api-reference/organizations/cancel-an-invitation-owneradmin-only.md): ⚠️ SECURITY: Only OWNERS and ADMINS can cancel pending invitations. - [Get current authenticated user](https://docs.timbrix.mx/api-reference/users/get-current-authenticated-user.md): Returns the profile information of the currently authenticated user. Requires Supabase authentication token. - [Delete my account](https://docs.timbrix.mx/api-reference/users/delete-my-account.md): Permanently deletes the authenticated user's identity (ARCO cancellation). Only a user session token is accepted, never an API key. Fails with 409 SOLE_OWNER_OF_ACTIVE_ORGANIZATION if the user still owns active organizations. - [Get user by ID](https://docs.timbrix.mx/api-reference/users/get-user-by-id.md): ⚠️ SECURITY: Retrieves user profile by ID. Requires authentication with scope "read:user". Supports both OAuth tokens and API keys. - [Get user organizations](https://docs.timbrix.mx/api-reference/users/get-user-organizations.md): ⚠️ SECURITY: Lists all organizations a user belongs to. Requires authentication with scope "read:organization". Supports both OAuth tokens and API keys. Returns organizations with membership details. - [Get user by email](https://docs.timbrix.mx/api-reference/users/get-user-by-email.md): ⚠️ SECURITY: Retrieves user profile by email address. Requires authentication with scope "read:user". Supports both OAuth tokens and API keys. Useful for user lookups and invitations. - [List organization API keys](https://docs.timbrix.mx/api-reference/api-keys/list-organization-api-keys.md): List the API keys of an organization (requires authentication). Owners and admins see every key; members only see the keys they created. - [Create API key](https://docs.timbrix.mx/api-reference/api-keys/create-api-key.md): Create a new API key for an organization. Plain key is returned only once! Owners and admins can create sandbox or production keys (default production). Members can only create sandbox keys with a limited set of scopes and must send environment: 'sandbox'. - [Get API key statistics](https://docs.timbrix.mx/api-reference/api-keys/get-api-key-statistics.md): Get usage statistics for the API keys of an organization. Members only get the statistics of the keys they created. - [Get API key by ID](https://docs.timbrix.mx/api-reference/api-keys/get-api-key-by-id.md): Retrieve details of a specific API key - [Update API key](https://docs.timbrix.mx/api-reference/api-keys/update-api-key.md): Update API key settings (name, scopes, rate limits, etc.) - [Delete API key](https://docs.timbrix.mx/api-reference/api-keys/delete-api-key.md): Permanently delete an API key - [Validate API key](https://docs.timbrix.mx/api-reference/api-keys/validate-api-key.md): Test endpoint to validate API key authentication and scopes. Use X-API-Key header. - [List the organization's series and folios](https://docs.timbrix.mx/api-reference/series/list-the-organizations-series-and-folios.md) - [Create a series](https://docs.timbrix.mx/api-reference/series/create-a-series.md): Only owners and admins can create series. - [Set the default series of a voucher type](https://docs.timbrix.mx/api-reference/series/set-the-default-series-of-a-voucher-type.md): Only owners and admins. Returns the updated series list. - [Update the next folio of a series](https://docs.timbrix.mx/api-reference/series/update-the-next-folio-of-a-series.md): Only owners and admins. The series name cannot be changed. - [Delete a series](https://docs.timbrix.mx/api-reference/series/delete-a-series.md): Only owners and admins. A default series cannot be deleted (SERIES_IS_DEFAULT). - [Create a new OAuth application](https://docs.timbrix.mx/api-reference/oauth/create-a-new-oauth-application.md): ⚠️ SECURITY: Creates an OAuth2 application. Only OWNERS and ADMINS can create OAuth apps. Returns client secret ONCE - store it securely! - [Get OAuth application by client ID](https://docs.timbrix.mx/api-reference/oauth/get-oauth-application-by-client-id.md): ⚠️ SECURITY: Only OWNERS and ADMINS can view OAuth application details. Returns application configuration without exposing the client secret. - [Update OAuth application](https://docs.timbrix.mx/api-reference/oauth/update-oauth-application.md): ⚠️ SECURITY: Only OWNERS and ADMINS can update OAuth applications. Allows updating name, scopes, redirect URIs, and status. Client ID and secret cannot be changed. - [Delete OAuth application](https://docs.timbrix.mx/api-reference/oauth/delete-oauth-application.md): ⚠️ SECURITY: Only OWNERS and ADMINS can delete OAuth applications. This action is PERMANENT. All tokens associated with this application will be revoked. - [List OAuth applications for organization](https://docs.timbrix.mx/api-reference/oauth/list-oauth-applications-for-organization.md): ⚠️ SECURITY: Only OWNERS and ADMINS can list OAuth applications. Returns all OAuth apps created for the organization. - [Generate OAuth access token](https://docs.timbrix.mx/api-reference/oauth/generate-oauth-access-token.md): 🔓 PUBLIC ENDPOINT: Generates an OAuth2 access token using client credentials flow. Requires valid client_id and client_secret. Token scopes are validated against application configuration. Rate limit: 10 requests per minute. - [OAuth2 Authorization Endpoint (redirects to consent screen)](https://docs.timbrix.mx/api-reference/oauth/oauth2-authorization-endpoint-redirects-to-consent-screen.md): 🔓 PUBLIC ENDPOINT: Standard OAuth2 authorization endpoint. Validates request parameters and redirects to the consent screen. Supports PKCE for enhanced security. This is the entry point for Authorization Code Flow - compatible with standard OAuth2 clients. - [Get authorization details for consent screen](https://docs.timbrix.mx/api-reference/oauth/get-authorization-details-for-consent-screen.md): ⚠️ SECURITY: Returns OAuth application details and requested scopes for displaying a consent screen. User must be authenticated. Validates client_id, redirect_uri, and scopes. - [Approve authorization and generate code](https://docs.timbrix.mx/api-reference/oauth/approve-authorization-and-generate-code.md): ⚠️ SECURITY: User approves OAuth authorization request. Generates an authorization code for the client application. Rate limit: 20 requests per minute. - [Deny authorization request](https://docs.timbrix.mx/api-reference/oauth/deny-authorization-request.md): ⚠️ SECURITY: User denies OAuth authorization request. Returns error information for client redirect. - [Exchange authorization code for access token](https://docs.timbrix.mx/api-reference/oauth/exchange-authorization-code-for-access-token.md): 🔓 PUBLIC ENDPOINT: Exchanges an authorization code for access and refresh tokens (Authorization Code Flow). Requires valid code, client_id, client_secret, and redirect_uri. Rate limit: 15 requests per minute. - [Refresh OAuth access token](https://docs.timbrix.mx/api-reference/oauth/refresh-oauth-access-token.md): 🔓 PUBLIC ENDPOINT: Exchanges a refresh token for a new access token and refresh token pair. The old refresh token is automatically revoked. Rate limit: 20 requests per minute. - [Revoke access token](https://docs.timbrix.mx/api-reference/oauth/revoke-access-token.md): ⚠️ SECURITY: Revokes an OAuth access token. Requires OAuth authentication with scope "write:oauth-apps". Revoked tokens cannot be used for API access. - [List tokens for OAuth application](https://docs.timbrix.mx/api-reference/oauth/list-tokens-for-oauth-application.md): ⚠️ SECURITY: Lists all active tokens for an OAuth application. Only OWNERS and ADMINS can view tokens. Useful for auditing and token management. - [Health check endpoint](https://docs.timbrix.mx/api-reference/monitoring/health-check-endpoint.md): Returns the health status of the API and its dependencies (database, external services) - [Readiness check](https://docs.timbrix.mx/api-reference/monitoring/readiness-check.md): Kubernetes readiness probe - checks if the service is ready to accept traffic - [Liveness check](https://docs.timbrix.mx/api-reference/monitoring/liveness-check.md): Kubernetes liveness probe - checks if the service is alive and should not be restarted - [Sandbox PAC reachability](https://docs.timbrix.mx/api-reference/monitoring/sandbox-pac-reachability.md): Lightweight reachability probe for the sandbox PAC (TIM-42). Not a full uptime/availability check — see TIM-28. - [Iniciar sesión con email y contraseña](https://docs.timbrix.mx/api-reference/auth/iniciar-sesión-con-email-y-contraseña.md): Autentica a un usuario contra Supabase Auth y devuelve un access token (JWT) y un refresh token. El access token se usa como Bearer token en el resto de endpoints autenticados por sesión de usuario. - [Cerrar sesión](https://docs.timbrix.mx/api-reference/auth/cerrar-sesión.md): Revoca el access token actual en Supabase Auth. Idempotente: si no se envía un header Authorization, responde éxito sin efecto. - [List customers for an organization](https://docs.timbrix.mx/api-reference/customers/list-customers-for-an-organization.md): Sin parámetros devuelve todos los clientes. `q` busca en razón social, RFC y correo; `limit` acota el resultado. - [Create a customer](https://docs.timbrix.mx/api-reference/customers/create-a-customer.md) - [Get a customer by ID](https://docs.timbrix.mx/api-reference/customers/get-a-customer-by-id.md) - [Update a customer](https://docs.timbrix.mx/api-reference/customers/update-a-customer.md) - [Delete a customer](https://docs.timbrix.mx/api-reference/customers/delete-a-customer.md) - [List products for an organization](https://docs.timbrix.mx/api-reference/products/list-products-for-an-organization.md) - [Create a product or service](https://docs.timbrix.mx/api-reference/products/create-a-product-or-service.md) - [Bulk import products/services from a CSV file](https://docs.timbrix.mx/api-reference/products/bulk-import-productsservices-from-a-csv-file.md): Uploads a CSV file (multipart/form-data, field name "file") and creates one product per data row. Required columns: description, productKey, price. Optional columns: unitKey (default H87), unitName, sku, taxIncluded, taxability, livemode — same field names as the JSON create endpoint. Each row is va… - [Get a product by ID](https://docs.timbrix.mx/api-reference/products/get-a-product-by-id.md) - [Update a product](https://docs.timbrix.mx/api-reference/products/update-a-product.md) - [Delete a product](https://docs.timbrix.mx/api-reference/products/delete-a-product.md) - [Listar regímenes fiscales SAT (c_RegimenFiscal)](https://docs.timbrix.mx/api-reference/sat/listar-regímenes-fiscales-sat-c_regimenfiscal.md): Retorna los regímenes fiscales activos del catálogo SAT. Opcionalmente filtra por tipo de persona (fisica, moral, ambas). - [Listar usos de CFDI SAT (c_UsoCFDI)](https://docs.timbrix.mx/api-reference/sat/listar-usos-de-cfdi-sat-c_usocfdi.md): Retorna los usos de CFDI activos del catálogo SAT. Opcionalmente filtra por tipo de persona y/o por compatibilidad con un régimen fiscal. - [Buscar claves de producto o servicio SAT (c_ClaveProdServ)](https://docs.timbrix.mx/api-reference/sat/buscar-claves-de-producto-o-servicio-sat-c_claveprodserv.md): Busca en el catálogo SAT de claves de producto o servicio por texto parcial (descripción o código). Devuelve hasta `limit` resultados ordenados por relevancia, junto con el total de coincidencias. - [Buscar claves de unidad de medida SAT (c_ClaveUnidad)](https://docs.timbrix.mx/api-reference/sat/buscar-claves-de-unidad-de-medida-sat-c_claveunidad.md): Busca en el catálogo SAT de unidades de medida por texto parcial (nombre, descripción o código). Devuelve hasta `limit` resultados, junto con el total de coincidencias. - [List organization webhooks](https://docs.timbrix.mx/api-reference/webhooks/list-organization-webhooks.md): Lists all webhooks for an organization. Only OWNERS and ADMINS can view webhooks. - [Create a new webhook](https://docs.timbrix.mx/api-reference/webhooks/create-a-new-webhook.md): Creates a webhook endpoint for receiving events. Only OWNERS and ADMINS can create webhooks. - [Get webhook by ID](https://docs.timbrix.mx/api-reference/webhooks/get-webhook-by-id.md): Retrieves webhook configuration. Returns webhook details including URL, events, and status. - [Update webhook](https://docs.timbrix.mx/api-reference/webhooks/update-webhook.md): Updates webhook configuration. Allows updating URL, events, and active status. - [Delete webhook](https://docs.timbrix.mx/api-reference/webhooks/delete-webhook.md): Deletes a webhook endpoint. This action is PERMANENT. The webhook will stop receiving events immediately. - [Get webhook delivery history](https://docs.timbrix.mx/api-reference/webhooks/get-webhook-delivery-history.md): Retrieves delivery history for a webhook. Returns up to 100 recent deliveries with status, response codes, and retry info. - [Send test webhook](https://docs.timbrix.mx/api-reference/webhooks/send-test-webhook.md): Sends a test webhook event to verify configuration. Useful for testing webhook endpoint and HMAC signature verification. - [List invoices for the organization](https://docs.timbrix.mx/api-reference/invoices/list-invoices-for-the-organization.md): Authenticate with either a Supabase session (send the `X-Organization-Id` header, must be a member of that organization) or an API key (external integrations, requires the `read:invoices` scope). Results are ordered by creation date, newest first. - [Create and stamp a CFDI 4.0 invoice via the configured PAC](https://docs.timbrix.mx/api-reference/invoices/create-and-stamp-a-cfdi-40-invoice-via-the-configured-pac.md): Authenticate with either a Supabase session (send the `X-Organization-Id` header, must be a member of that organization) or an API key (external integrations, requires the `write:invoices` scope — the organization is resolved from the key). The customer can be sent inline (`customer`) or referenced… - [Register a payment of PPD invoices and stamp its Complemento de Pago (CFDI tipo P)](https://docs.timbrix.mx/api-reference/invoices/register-a-payment-of-ppd-invoices-and-stamp-its-complemento-de-pago-cfdi-tipo-p.md): Send the paid invoices (`documents: [{ invoiceUuid, amount }]`, 1 to 50, same customer and currency). Timbrix computes the installment number, previous and remaining balances and proportional taxes, and stamps one Complemento de Pago 2.0. Each one counts as a CFDI of your plan. - [Preview a CFDI 4.0 invoice as an unstamped PDF](https://docs.timbrix.mx/api-reference/invoices/preview-a-cfdi-40-invoice-as-an-unstamped-pdf.md): Accepts the exact same request body as `POST /invoices`, runs the exact same catalog/CFDI 4.0 validations, but never timbra (no PAC call) and never persists anything — no invoice, no cuota consumida, no idempotencyKey handling. Returns a PDF clearly marked as 'VISTA PREVIA — NO VÁLIDO FISCALMENTE' s… - [Get CFDI usage/quota for the current billing month](https://docs.timbrix.mx/api-reference/invoices/get-cfdi-usagequota-for-the-current-billing-month.md): Authenticate with either a Supabase session (send the `X-Organization-Id` header) or an API key (external integrations, requires the `read:invoices` scope). Returns how many production CFDI the organization's billing account has stamped this calendar month (Mexico City time) across all its organizat… - [Get a fiscal totals summary for a filtered set of invoices](https://docs.timbrix.mx/api-reference/invoices/get-a-fiscal-totals-summary-for-a-filtered-set-of-invoices.md): Subtotal/total are summed via SQL (unbounded). IVA is computed by parsing each matching invoice's stamped XML — capped at 2000 matching invoices per request; beyond that, `iva` is `null` and `ivaCapped` is `true`, and the caller should narrow the date range. - [Export a filtered set of invoices as CSV](https://docs.timbrix.mx/api-reference/invoices/export-a-filtered-set-of-invoices-as-csv.md): Capped at 500 matching invoices per request — narrow the date range if you hit the limit. - [Export a filtered set of invoices as a ZIP of their stamped XML](https://docs.timbrix.mx/api-reference/invoices/export-a-filtered-set-of-invoices-as-a-zip-of-their-stamped-xml.md): Capped at 500 matching invoices per request. - [Export a filtered set of invoices as a ZIP of their PDF representation](https://docs.timbrix.mx/api-reference/invoices/export-a-filtered-set-of-invoices-as-a-zip-of-their-pdf-representation.md): Capped at 500 matching invoices per request — PDF generation for many invoices in one request can be slow, this is a known limit for this first version. - [Request cancellation of a stamped CFDI](https://docs.timbrix.mx/api-reference/invoices/request-cancellation-of-a-stamped-cfdi.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. Determines automatically whether the cancellation is direct or requires receptor approval per SAT rules — Timbrix cannot confirm receptor approval in real time, so a… - [Manually confirm the outcome of a pending cancellation](https://docs.timbrix.mx/api-reference/invoices/manually-confirm-the-outcome-of-a-pending-cancellation.md): Timbrix cannot query SAT in real time for the receptor's response — call this once you've confirmed the outcome via the SAT portal. - [List the cancellation history for an invoice](https://docs.timbrix.mx/api-reference/invoices/list-the-cancellation-history-for-an-invoice.md) - [Get the installments and balance of a PPD invoice](https://docs.timbrix.mx/api-reference/invoices/get-the-installments-and-balance-of-a-ppd-invoice.md): Lists every Complemento de Pago of the invoice (vigente, cancelado or en_proceso). `paid` and `balance` count only vigente and en_proceso. - [Get a single stamped CFDI by its folio fiscal UUID](https://docs.timbrix.mx/api-reference/invoices/get-a-single-stamped-cfdi-by-its-folio-fiscal-uuid.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. Returns the same shape as the `POST /invoices` response — use this to recover an invoice's metadata/XML if the original create response was lost. - [Download the stamped CFDI XML](https://docs.timbrix.mx/api-reference/invoices/download-the-stamped-cfdi-xml.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. Streams back the exact XML returned by the PAC at stamping time, as stored in `invoices.xml`. - [Download the SAT cancellation receipt (acuse) XML](https://docs.timbrix.mx/api-reference/invoices/download-the-sat-cancellation-receipt-acuse-xml.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. Returns the acuse the SAT issued when it received the cancellation request (decoded XML). For cancellations that required the receptor's acceptance, it does not prove… - [Download the CFDI's representación impresa (PDF)](https://docs.timbrix.mx/api-reference/invoices/download-the-cfdis-representación-impresa-pdf.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. The PDF is generated on demand from the stamped XML — nothing is persisted. - [Send the CFDI (XML + PDF) by email to the receptor](https://docs.timbrix.mx/api-reference/invoices/send-the-cfdi-xml-+-pdf-by-email-to-the-receptor.md): Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. `to` is optional — if omitted, the recipient is resolved from the Customer registered for the invoice's RFC receptor (if it has an email on file). Retries automatical… - [Get the current organization's partner enrollment](https://docs.timbrix.mx/api-reference/partners/get-the-current-organizations-partner-enrollment.md): Returns null if the organization has not enrolled as a referral partner yet. - [Enroll the current organization as a referral partner](https://docs.timbrix.mx/api-reference/partners/enroll-the-current-organization-as-a-referral-partner.md) - [List referred client organizations for this partner](https://docs.timbrix.mx/api-reference/partners/list-referred-client-organizations-for-this-partner.md): Business metadata only (name, plan, status, dates) — never fiscal data. - [List this partner's monthly commission ledger](https://docs.timbrix.mx/api-reference/partners/list-this-partners-monthly-commission-ledger.md) - [Check whether a referral code is valid and active](https://docs.timbrix.mx/api-reference/partners/check-whether-a-referral-code-is-valid-and-active.md) - [Mark a set of accrued commissions as paid](https://docs.timbrix.mx/api-reference/partners-admin/mark-a-set-of-accrued-commissions-as-paid.md) - [List API requests](https://docs.timbrix.mx/api-reference/request-logs/list-api-requests.md): Requests made with your API keys in the last 30 days, newest first. API key needs `read:request-logs`; a session must be owner or admin. - [Request counts over time](https://docs.timbrix.mx/api-reference/request-logs/request-counts-over-time.md): Counts per time bucket (2xx, 4xx, 5xx, total) for the same filters as the list. Empty buckets are returned as zeros. - [Get one API request, including its error body](https://docs.timbrix.mx/api-reference/request-logs/get-one-api-request-including-its-error-body.md) - [List audit log entries](https://docs.timbrix.mx/api-reference/audit-logs/list-audit-log-entries.md): Who did what and when in the organization, newest first, paginated by cursor. API key needs `read:audit-logs`; a session must be owner or admin. - [Export audit log entries as CSV](https://docs.timbrix.mx/api-reference/audit-logs/export-audit-log-entries-as-csv.md): Same filters as the list. Dates in Mexico City time. Up to 50000 rows; narrow the filters if you hit the limit. - [Verify the audit log hash chain](https://docs.timbrix.mx/api-reference/audit-logs/verify-the-audit-log-hash-chain.md): Recomputes the organization's hash chain. `valid: false` and `firstBrokenSeq` point at the first altered, removed or inserted entry. - [Get one audit log entry](https://docs.timbrix.mx/api-reference/audit-logs/get-one-audit-log-entry.md) ## OpenAPI Specs - [openapi](https://api.timbrix.mx/api/openapi.json) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.