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
📚 Endpoints#
List Receipts#
Retrieve a paginated list of receipts.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
{
"message": "Receipts retrieved successfully",
"data": [
{
"id": "receipt_1234567890",
"client": {
"id": "client_1234567890",
"name": "Juan Pérez García",
"tax_id": "PEGJ800101ABC"
},
"status": "pending",
"total": 1160.0,
"subtotal": 1000.0,
"taxes": 160.0,
"currency": "MXN",
"periodicity": "month",
"payment_form": "03",
"created": 1677651234,
"validUntil": 1680243234,
"url": "https://invoicing.gigstack.pro/autofactura?id=receipt_1234567890"
}
],
"has_more": false,
"total_results": 1
}
Create Receipt#
Create a new receipt with items and client information. Receipts are pre-invoice documents that can be later stamped as CFDI invoices.Automatic amount calculations with taxes
Flexible validity periods
Client auto-creation support
Metadata support for tracking
Custom payment form codes
{
"client": {
"id": "client_1234567890"
},
"currency": "MXN",
"exchange_rate": 1.0,
"items": [
{
"id": "service_1234567890",
"quantity": 2,
"unit_price": 1000.0
}
],
"periodicity": "month",
"payment_form": "03",
"metadata": {
"order_id": "ORD-12345",
"department": "Sales",
"project_code": "PROJ-2024-Q1",
"external_reference": "EXT-ABC-789",
"priority": "high",
"custom_tags": ["recurring", "priority-client"]
}
}
day
- Valid until end of current day
week
- Valid until end of current week
two_weeks
- Valid for 2 weeks from creation
month
- Valid until end of current month (default)
two_months
- Valid until end of next month
Example with Client Auto-Creation:Get Receipt#
Retrieve a specific receipt by ID.Stamp Receipt#
Convert a receipt into a CFDI invoice by stamping it with SAT.client
- Stamp to the associated client
general_public_national
- Stamp to Mexican general public
general_public_foreign
- Stamp to foreign general public
{
"stamp_to": "client",
"fiscal_information": {
"legal_name": "Juan Pérez García",
"tax_id": "PEGJ800101ABC",
"tax_system": "601",
"zip": "01000"
},
"date": 1677651234000
}
Cancel Receipt#
Cancel a receipt. This action cannot be undone.🏗️ Receipt Structure#
Receipt Status#
Status | Description |
---|
pending | Receipt created, awaiting stamping |
stamped | Receipt converted to CFDI invoice |
expired | Receipt validity period expired |
canceled | Receipt canceled |
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_months: Valid until end of the following month
📊 Complex Receipt Examples#
Receipt with Multiple Items#
{
"client": {
"id": "client_1234567890"
},
"currency": "MXN",
"items": [
{
"id": "service_001",
"quantity": 2,
"unit_price": 1000.0
},
{
"description": "Installation service",
"quantity": 1,
"unit_price": 500.0,
"product_key": "72121400",
"unit_key": "E48",
"taxes": [
{
"type": "IVA",
"rate": 0.16
}
]
}
],
"periodicity": "two_weeks",
"payment_form": "04"
}
Receipt with USD Currency and Exchange Rate#
{
"client": {
"id": "client_1234567890"
},
"currency": "USD",
"exchange_rate": 18.5,
"items": [
{
"description": "International consulting",
"quantity": 10,
"unit_price": 100.0,
"product_key": "80141503",
"unit_key": "HUR",
"taxes": [
{
"type": "IVA",
"rate": 0.0,
"factor": "Exento"
}
]
}
],
"periodicity": "month",
"payment_form": "03"
}
Receipt with Custom Invoice Configuration#
{
"client": {
"id": "client_1234567890"
},
"currency": "MXN",
"items": [
{
"id": "service_1234567890",
"quantity": 1
}
],
"periodicity": "month",
"payment_form": "03",
"invoice_config": {
"serie": "B",
"folio": 456
},
"metadata": {
"project_id": "PROJ-2024-001",
"department": "Engineering"
}
}
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": {
"order_id": "ORD-12345",
"department": "Sales"
}
}
{
"metadata": {
"project": {
"code": "PROJ-2024-Q1",
"manager": "Alice Smith",
"budget_category": "consulting"
},
"external_systems": {
"crm_id": "CRM-789",
"erp_reference": "ERP-ABC-123"
},
"tags": ["priority", "recurring", "b2b"],
"workflow_stage": "approved",
"custom_fields": {
"delivery_date": "2024-03-15",
"special_instructions": "Rush order"
}
}
}
{
"metadata": {
"stripe_session_id": "cs_test_123",
"shopify_order_id": "shop_456",
"quickbooks_reference": "QB-789",
"internal_workflow_id": "WF-2024-001"
}
}
🎯 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
🚨 Error Handling#
Invalid Client#
{
"message": "Client not found",
"error": "The specified client does not exist"
}
Invalid Item Configuration#
{
"message": "Invalid item",
"error": "Service service_xyz not found"
}
Receipt Already Stamped#
{
"message": "Receipt already stamped",
"error": "Cannot modify a stamped receipt"
}
Receipt Expired#
{
"message": "Receipt expired",
"error": "Cannot stamp an expired receipt"
}
Stamping Error#
{
"message": "Stamping failed",
"error": "Missing required fiscal information for CFDI generation"
}
{
"message": "Receipt creation failed",
"error": "Client fiscal information validation failed. RFC is invalid or client is in EFOS blacklist."
}
When a client's fiscal information fails validation (invalid RFC or EFOS blacklist), the receipt creation will be rejected. Update the client information before retrying.
Modified at 2025-08-26 16:42:28