Skip to main content
POST

Overview

Create an invoice from a receipt image in a single call. Provide complete tax info to use an existing member by RFC or automatically create a new member profile. Supports JSON (with base64 image) or multipart/form-data (with file upload).
This operation requires 1 credit. Credits are consumed from the API key owner, not the member profile.

Authentication

Requires a valid API key with:
  • API key owner belongs to an organization
  • api_keys_enabled feature flag enabled for the organization

Request Body

object
required
Tax information object
string
required
Receipt image as a base64 data URL (e.g., data:image/jpeg;base64,/9j/4AAQ...). When using multipart/form-data, send as a file upload instead.
string
Contact email address
string
Phone number (e.g., +525512345678, 4431041040)
string
Short description of the expense (max 50 characters)

Behavior

  1. Validates the API key, organization, feature flag, and input fields
  2. Looks up the RFC in the caller’s organization:
    • Found — uses the existing profile
    • Not found — creates a new member profile with the provided tax data, then submits the invoice
  3. Resolves the tax regime for the invoice:
    • If fiscal_regimen is in the request, uses it (validated against member’s regimes)
    • If the member has a single regime, uses it automatically
    • If the member has multiple regimes and the provided value is not valid, returns 400
  4. Checks credits on the API key owner
  5. Submits the invoice to the invoicing provider
  6. Returns the invoice, member, and whether a new profile was created

Response

boolean
Whether the request was successful
object
Response data object

Error Codes