gigstack API
  1. Receipts
gigstack API
  • Welcome to gigstack API
  • gigstack Connect API Guide
  • Migrar de API v1 a v2 de gigstack
  • Clients
    • Clients API Guide
    • List clients
      GET
    • Get client
      GET
    • Update client
      PUT
    • Create client
      POST
    • Validate client fiscal information
      POST
    • Get client customer portal access token
      POST
    • Stamp pending receipts
      POST
    • Delete client
      DELETE
  • Services
    • Services API Guide
    • List services
      GET
    • Get service
      GET
    • Update service
      PUT
    • Create service
      POST
    • Delete service
      DELETE
  • Invoices
    • Invoices API Guide
    • Income
      • List income invoices
      • Get income invoice
      • Create income invoice
    • Egress
      • List egress invoices
      • Get egress invoice
      • Create egress invoice
    • Get invoice files
      GET
    • Cancel invoice
      DELETE
  • Payments
    • Payments API Guide
    • List payments
    • Get payment
    • Request payment
    • Register payment
    • Mark payment as paid
    • Refund payment
    • Cancel payment
  • Receipts
    • Receipts API Guide
    • List receipts
      GET
    • Get receipt
      GET
    • Create receipt
      POST
    • Stamp receipt
      POST
    • Cancel receipt
      DELETE
  • Teams
    • Teams API Guide
    • List teams
    • Get team
    • Get team integrations
    • Get team series
    • Get team onboarding URL
    • Update team
    • Update team series
    • Update team settings
    • Create team
    • Add team member
    • Remove team member
    • Create team series
  • Users
    • Users API Guide
    • List users
    • Get user
    • Update user
    • Create user
    • Reset user password
  • Catalogs
    • Tax Regimes Catalog (Régimen Fiscal)
    • Payment Forms | Formas de pago
    • CFDI Usage Catalog (Uso CFDI)
    • Payment Methods Catalog (Método de Pago)
    • Months and Bimesters Catalog (Meses y Bimestres)
    • Invoice Relationships Catalog (Relación entre Facturas)
  1. Receipts

Receipts API Guide

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.
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
Example Request:
Example Response:
{
    "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.
Key Features:
Automatic amount calculations with taxes
Flexible validity periods
Client auto-creation support
Metadata support for tracking
Custom payment form codes
Request Body:
{
    "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"]
    }
}
Periodicity Options:
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
Payment Form Codes:
01 - Cash
02 - Check
03 - Electronic transfer
04 - Credit card
05 - Electronic money
06 - Digital money
99 - To be defined
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:
{
    "stamp_to": "client",
    "fiscal_information": {
        "legal_name": "Juan Pérez García",
        "tax_id": "PEGJ800101ABC",
        "tax_system": "601",
        "zip": "01000"
    },
    "date": 1677651234000
}
Example Request:

Cancel Receipt#

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

🏗️ Receipt Structure#

Receipt Status#

StatusDescription
pendingReceipt created, awaiting stamping
stampedReceipt converted to CFDI invoice
expiredReceipt validity period expired
canceledReceipt 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"
    }
}

🏷️ 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:
{
    "metadata": {
        "order_id": "ORD-12345",
        "department": "Sales"
    }
}
Advanced Tracking:
{
    "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"
        }
    }
}
Integration Identifiers:
{
    "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

🔗 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#

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"
}

Failed Client Fiscal Information#

{
    "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.

Need help with receipt management? Check our support documentation or contact support@gigstack.io
Modified at 2025-08-26 16:42:28
Previous
Cancel payment
Next
List receipts
Built with