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.
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
limit(integer, 1-100) - Number of results per page (default: 10)next(string) - Pagination cursor for next pageteam(string) - gigstack Connect: Target team IDorder_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 IDtax_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:
Create Receipt
- 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
idempotency_key(string) - Stable key for one receipt. A repeated creation returns400 resource_conflictwith 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
The receipts endpoints accept exactly these five values:two_month— singularTeam settings usetwo_months— plural (PUT /v2/teams/{id}/settings, fielddefaults.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. Sendingtwo_monthsto a receipts endpoint fails validation with a400naming the allowed enum values.
Payment Form Codes:two_monthcurrently behaves the same asmonth. 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, setinvoice_config.validUntilexplicitly instead of relying ontwo_month.
01- Cash02- Check03- Electronic transfer04- Credit card05- Electronic money06- Digital money99- To be defined
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
400witherror.code: "resource_conflict"and the existing receipt ID in the details. Retrieve that ID withGET /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
Get Receipt
Stamp Receipt
client- Stamp to the associated clientgeneral_public_national- Stamp to Mexican general publicgeneral_public_foreign- Stamp to foreign general public
Reopen Receipt
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:
200 with the receipt in data, back at status: pending.
Cancel Receipt
Receipt Structure
Receipt Status
Validity Periods
Receipts have configurable validity periods based on theperiodicity 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
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: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
- Set appropriate periodicity - Choose validity periods based on your workflow
- Leverage enhanced metadata - Store any custom data, external references, and business identifiers; all properties are preserved exactly as submitted
- Include complete item information - Ensure accurate calculations
- Validate clients first - Check fiscal data before creating receipts
- Monitor receipt expiration - Stamp receipts before they expire
- Handle exchange rates - Set proper rates for foreign currency receipts
- Test stamping process - Validate CFDI generation in staging
- Structure metadata thoughtfully - Use consistent naming conventions and organize data logically for easy retrieval and filtering
- Use idempotency keys - Always provide an
idempotency_keywhen creating receipts to prevent duplicates, especially when retrying failed requests or processing webhook events
Related Resources
- Clients API - Manage receipt recipients
- Services API - Configure receipt items
- Payments API - Process payments for receipts
- Invoices API - View stamped receipts as invoices
Error Handling
At a glance
429 — Team credit limit reached
POST /v2/receipts consumes a team credit before the receipt is created:
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_creditsat the top level). See Invoices → 429.
400 — Invalid periodicity
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:
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
fiscal_information explicitly, or recreate the client.
400 — Cannot cancel
DELETE /receipts/{id} only accepts receipts that are still open:
DELETE /v2/invoices/{id}).
500 — Stamping failed downstream
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 with400. Update the client (PUT /v2/clients/{id}) and retry.
For additional assistance, contact support@gigstack.io