Skip to main content
Start with shared fields, then the Mexico or Colombia guide. The CFDI, RFC, SAT catalog, and payment-complement examples below describe Mexico; they are not universal country requirements.
Create, manage, and stamp receipts that can be converted into CFDI invoices. The Receipts API handles pre-invoice document creation with flexible validity periods and SAT compliance for later stamping.

Overview

The Receipts API provides comprehensive receipt management for pre-invoice documents. Create receipts with automatic calculations, flexible validity periods, and stamp them as CFDI invoices when needed.

Key Features

  • Receipt Creation - Create pre-invoice receipts with automatic calculations
  • Flexible Validity - Set custom validity periods (day, week, month, etc.)
  • CFDI Stamping - Convert receipts to compliant CFDI invoices
  • Client Integration - Full client management and auto-creation support
  • Enhanced Metadata Support - Track custom data, references, and business identifiers with full flexibility
  • Periodicity Control - Manage receipt lifecycle and validity
  • Idempotency - Prevent duplicate receipt creation

Endpoints

List Receipts

Retrieve a paginated list of receipts. Query Parameters:
  • limit (integer, 1-100) - Number of results per page (default: 10)
  • next (string) - Pagination cursor for next page
  • team (string) - gigstack Connect: Target team ID
  • order_by (string) - Field to sort by (default: timestamp)
  • sort (string) - Sort direction (asc, desc)
  • created[gte] / created[gt] / created[lte] / created[lt] - Filter by creation date (epoch ms, seconds, or ISO date)
  • client_id (string) - Filter by the gigstack client ID
  • tax_id (string) - Filter by the client’s tax ID / RFC (e.g., tax_id=PEGJ800101ABC)
status, valid_until and metadata are accepted but ignored by this endpoint — they do not narrow the results. Filter on them client-side. Example Request:
Example Response:

Create Receipt

Create a new receipt with items and client information. Receipts are pre-invoice documents that can be later stamped as CFDI invoices. Key Features:
  • Automatic amount calculations with taxes
  • Flexible validity periods
  • Client auto-creation support
  • Metadata support for tracking
  • Custom payment form codes
  • Idempotency support to prevent duplicate receipts
Request Body:
Optional Fields:
  • idempotency_key (string) - Stable key for one receipt. A repeated creation returns 400 resource_conflict with the existing receipt ID in the details. Retrieve the receipt rather than creating a new key for the same sale.
  • exchange_rate (number) - Exchange rate for currency conversion. If not provided, the latest rate from our rates collection will be used automatically.

Periodicity Options

⚠️ On receipts the value is two_month — singular

The receipts endpoints accept exactly these five values:
Team settings use two_months — plural (PUT /v2/teams/{id}/settings, field defaults.periodicity). The two endpoints genuinely disagree, and neither one accepts the other’s spelling. This is not a typo in the docs; it is the current state of the API, kept as-is because normalizing it would break live integrations. Do not copy a periodicity value from one endpoint’s payload into the other’s — look it up. Sending two_months to a receipts endpoint fails validation with a 400 naming the allowed enum values.
two_month currently behaves the same as month. The validity calculation is keyed on the plural spelling, so the singular value the schema accepts falls through to the default branch and yields end-of-current-month rather than end-of-next-month. If you need a receipt to stay valid into the following month, set invoice_config.validUntil explicitly instead of relying on two_month.
Payment Form Codes:
  • 01 - Cash
  • 02 - Check
  • 03 - Electronic transfer
  • 04 - Credit card
  • 05 - Electronic money
  • 06 - Digital money
  • 99 - To be defined
Idempotency: Keep one idempotency_key for the same receipt across retry attempts. This prevents a repeated key from creating another receipt; it is not a success-response replay or a universal exactly-once guarantee.
  • If the key already exists, the verified creation response is 400 with error.code: "resource_conflict" and the existing receipt ID in the details. Retrieve that ID with GET /receipts/{id} and compare it with the intended sale.
  • Use a new key for a different business receipt, never merely to bypass the duplicate error. The receipt recipe shows the observed response and creation flow.
  • Common patterns: use UUIDs, combine order ID with timestamp, or use external system references
Example with Client Auto-Creation:

Get Receipt

Retrieve a specific receipt by ID. Example Request:

Stamp Receipt

Convert a receipt into a CFDI invoice by stamping it with SAT. Stamp Options:
  • client - Stamp to the associated client
  • general_public_national - Stamp to Mexican general public
  • general_public_foreign - Stamp to foreign general public
Request Body:
Example Request:

Reopen Receipt

Return a receipt whose self-invoicing failed to pending, so the client can try again from the self-invoicing portal. Clears automatic_invoice_error. Only a receipt that is not pending and has no entries in invoices[] can be reopened. An already-pending receipt, or one that produced a CFDI, answers 409 — reopening never cancels a CFDI. The optional reason (up to 500 characters) is kept on the receipt for your own audit trail and is not returned by the API. Example Request:
Answers 200 with the receipt in data, back at status: pending.

Cancel Receipt

Cancel a receipt. This action cannot be undone. Example Request:

Receipt Structure

Receipt Status

Validity Periods

Receipts have configurable validity periods based on the periodicity parameter:
  • day: Valid until end of creation day
  • week: Valid until end of creation week
  • two_weeks: Valid for 14 days from creation
  • month: Valid until end of creation month (default)
  • two_month (singular — see the box above): accepted, but currently resolves to end of creation month, same as month
Anything not in that list is rejected. In particular two_months (plural) is a team-settings value, not a receipts value. When the exact expiry matters, set invoice_config.validUntil (epoch ms) rather than deriving it from periodicity.

Complex Receipt Examples

Receipt with Multiple Items

Receipt with USD Currency and Exchange Rate

Receipt with Custom Invoice Configuration

Enhanced Metadata Support

The receipts API now supports flexible metadata storage that preserves all custom properties you provide. This enhancement allows you to:
  • Store Any Custom Properties - Add any key-value pairs relevant to your business
  • Preserve Data Structure - All metadata properties are returned exactly as submitted
  • Track Business References - Store external IDs, project codes, and system identifiers
  • Support Complex Data - Use nested objects, arrays, and mixed data types

Metadata Usage Examples

Basic Tracking:
Advanced Tracking:
Integration Identifiers:

Common Scenarios

1. Create Monthly Receipt (Standard)

2. Create Weekly Receipt

3. Stamp Receipt to Client

4. Stamp to General Public

Receipt Workflows

Standard Receipt Workflow

Receipt with Auto-Client Creation

Receipt Validity Management

Best Practices

  1. Set appropriate periodicity - Choose validity periods based on your workflow
  2. Leverage enhanced metadata - Store any custom data, external references, and business identifiers; all properties are preserved exactly as submitted
  3. Include complete item information - Ensure accurate calculations
  4. Validate clients first - Check fiscal data before creating receipts
  5. Monitor receipt expiration - Stamp receipts before they expire
  6. Handle exchange rates - Set proper rates for foreign currency receipts
  7. Test stamping process - Validate CFDI generation in staging
  8. Structure metadata thoughtfully - Use consistent naming conventions and organize data logically for easy retrieval and filtering
  9. Use idempotency keys - Always provide an idempotency_key when creating receipts to prevent duplicates, especially when retrying failed requests or processing webhook events

Error Handling

At a glance

429 — Team credit limit reached

POST /v2/receipts consumes a team credit before the receipt is created:
Not a rate limit — backing off will not help. Raise credit_limit on the team (PUT /v2/teams/{id}) or contact gigstack. Nothing was created and nothing was charged.
The invoice endpoints report the same condition with a different body (credit_limit / used_credits at the top level). See Invoices → 429.

400 — Invalid periodicity

Almost always caused by sending two_months (plural), which is the team-settings spelling. See the periodicity box.

400 — Invalid stamp_to combination

POST /receipts/{id}/stamp enforces two rules:
Do: for general_public_national / general_public_foreign, omit fiscal_information entirely — gigstack supplies the SAT generic receiver. For stamp_to: "client", either the receipt must already reference a client, or you must pass fiscal_information yourself.

404 — Client not found while stamping

The receipt references a client id that no longer exists. Re-stamp passing fiscal_information explicitly, or recreate the client.

400 — Cannot cancel

DELETE /receipts/{id} only accepts receipts that are still open:
Both are terminal — an already-stamped or already-expired receipt cannot be cancelled through the API. If a stamped receipt produced an invoice you need to void, cancel the invoice instead (DELETE /v2/invoices/{id}).

500 — Stamping failed downstream

The receipt reached the stamping service and it refused. The error field carries the real reason — most often incomplete fiscal data on the resolved receiver (missing tax_system, zip, or an RFC the SAT rejects). Read the receipt again before deciding to stamp: inspect its status, invoices and any error. Fix an identified validation problem, but do not assume a 500 proves the provider did not issue a document. If the outcome is ambiguous, reconcile it with support before another stamp.

Failed Client Fiscal Information

When a client’s fiscal information fails validation (invalid RFC or EFOS blacklist), receipt creation is rejected with 400. Update the client (PUT /v2/clients/{id}) and retry.
For additional assistance, contact support@gigstack.io