gigstack API
  1. Catalogs
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 receipt
    • Create receipt
    • Stamp receipt
    • Cancel receipt
  • 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. Catalogs

Invoice Relationships Catalog (Relación entre Facturas)

Overview#

The Invoice Relationships catalog defines the standardized codes that specify how CFDI documents relate to each other. These relationships are crucial for maintaining proper audit trails, tax compliance, and business process documentation. When issuing a CFDI that modifies, references, or relates to previous documents, the appropriate relationship code must be specified along with the UUID(s) of the related document(s).

What We See#

This catalog contains 9 relationship codes organized into four main categories:
Adjustment Documents (01, 02): Credit and debit notes
Substitution and Returns (03, 04): Document replacements and merchandise returns
Goods Movement (05, 06): Transfer and billing relationships
Payment-Related (07, 08, 09): Advance applications and payment processing
Each relationship code establishes a formal connection between documents that must be maintained for tax and legal compliance.

How to Use It#

When creating a CFDI that relates to previous documents, select the appropriate relationship code that accurately describes the business relationship. Always include the UUID(s) of the related documents to maintain the audit trail required by SAT regulations.

Usage Guidelines#

Accurate classification: Choose the code that precisely describes the document relationship
Complete references: Always include UUIDs of all related documents
Maintain chronology: Ensure related documents exist and are properly sequenced
Compliance validation: Verify that relationships comply with SAT regulations

Relationship Types and Codes#

Adjustment Documents#

CodeDescription (English)Descripción (Español)Usage ContextImpact
01Credit note for related documentsNota de crédito de los documentos relacionadosRefunds, discounts, returnsReduces tax liability
02Debit note for related documentsNota de débito de los documentos relacionadosAdditional charges, correctionsIncreases tax liability

Substitution and Returns#

CodeDescription (English)Descripción (Español)Usage ContextImpact
03Merchandise return on previous invoices or transfersDevolución de mercancía sobre facturas o traslados previosProduct returns, exchangesReverses original transaction
04Substitution of previous CFDISustitución de los CFDI previosDocument corrections, replacementsReplaces original document

Goods Movement#

CodeDescription (English)Descripción (Español)Usage ContextImpact
05Transfer of previously invoiced merchandiseTraslados de mercancias facturados previamenteWarehouse transfers, relocationsTracks inventory movement
06Invoice generated from previous transfersFactura generada por los traslados previosConverting transfers to salesCreates billing from movement

Payment-Related#

CodeDescription (English)Descripción (Español)Usage ContextImpact
07CFDI for advance applicationCFDI por aplicación de anticipoApplying customer depositsApplies prepaid amounts
08Invoice generated from installment paymentsFactura generada por pagos en parcialidadesPPD payment processingDocuments payment receipt
09Invoice generated from deferred paymentsFactura generada por pagos diferidosDelayed payment processingDocuments delayed payment

Complete Relationships Table#

CodeDescription (English)Descripción (Español)CategoryBusiness Scenario
01Credit note for related documentsNota de crédito de los documentos relacionadosAdjustmentCustomer refund, price adjustment downward
02Debit note for related documentsNota de débito de los documentos relacionadosAdjustmentAdditional charges, price adjustment upward
03Merchandise return on previous invoices or transfersDevolución de mercancía sobre facturas o traslados previosReturnProduct return, defective merchandise
04Substitution of previous CFDISustitución de los CFDI previosSubstitutionCorrecting errors, document replacement
05Transfer of previously invoiced merchandiseTraslados de mercancias facturados previamenteMovementWarehouse transfer, location change
06Invoice generated from previous transfersFactura generada por los traslados previosBillingConverting transfer to sale
07CFDI for advance applicationCFDI por aplicación de anticipoPaymentApplying customer deposit
08Invoice generated from installment paymentsFactura generada por pagos en parcialidadesPaymentPPD payment complement
09Invoice generated from deferred paymentsFactura generada por pagos diferidosPaymentDeferred payment processing

Implementation Examples#

API Request Examples#

Credit Note (01)#

{
  "credit_note": {
    "type": "I",
    "relationship_type": "01",
    "related_documents": [
      {
        "uuid": "12345678-1234-1234-1234-123456789012",
        "tax_id": "RFC123456789",
        "partial_amount": 1160.00
      }
    ],
    "reason": "Customer return - defective product",
    "total": -1160.00
  }
}

Document Substitution (04)#

{
  "invoice": {
    "relationship_type": "04",
    "related_documents": [
      {
        "uuid": "87654321-4321-4321-4321-210987654321",
        "tax_id": "RFC123456789"
      }
    ],
    "substitution_reason": "Correction of customer tax regime",
    "total": 2500.00
  }
}

Advance Application (07)#

{
  "advance_application": {
    "relationship_type": "07",
    "related_documents": [
      {
        "uuid": "11111111-2222-3333-4444-555555555555",
        "tax_id": "RFC123456789",
        "applied_amount": 5000.00
      }
    ],
    "remaining_balance": 15000.00,
    "total": 20000.00
  }
}

Validation Logic#

Business Logic Examples#

Common Business Scenarios#

E-commerce Returns Process#

B2B Advance Payment Application#

Document Correction Process#

Document Chain Examples#

Credit Note Chain#

Original Invoice (UUID: A123) → Credit Note (01, relates to A123) → Customer Refund

Substitution Chain#

Incorrect Invoice (UUID: B456) → Substitution Invoice (04, relates to B456) → Corrected Document

Advance Payment Chain#

Advance Payment (UUID: C789) → Final Invoice (07, relates to C789) → Balance Due

Transfer to Sale Chain#

Transfer Document (UUID: D012) → Sales Invoice (06, relates to D012) → Customer Billing

Important Considerations#

Tax Implications#

1.
Credit Notes (01): Reduce tax liability for the issuer
2.
Debit Notes (02): Increase tax liability for the issuer
3.
Substitutions (04): Replace original tax obligations
4.
Returns (03): May affect inventory and tax deductions

Compliance Requirements#

1.
UUID References: All related documents must include valid UUIDs
2.
Tax ID Matching: Related documents must include correct tax IDs
3.
Chronological Order: Relationships must respect document chronology
4.
Amount Validation: Partial amounts cannot exceed original totals

System Requirements#

1.
Document Tracking: Maintain complete audit trails
2.
Validation Logic: Implement relationship-specific validations
3.
Status Updates: Update original document status when related
4.
Reporting: Generate relationship reports for compliance

Error Prevention#

Common Mistakes#

Using wrong relationship codes for business scenarios
Missing or invalid UUID references
Incorrect partial amounts in credit notes
Creating circular references between documents
Forgetting to update original document status

Best Practices#

Implement comprehensive validation rules
Maintain clear documentation of business processes
Train staff on proper relationship code usage
Regular audit of document relationships
Automated validation of UUID references

Related Documentation#

Payment Methods Catalog - For payment-related relationships (07, 08, 09)
CFDI Usage Catalog - For compatible usage codes
Invoice Globals - For general invoice configuration
Tax Regimes Catalog - For tax regime considerations
Modified at 2025-08-21 00:44:05
Previous
Months and Bimesters Catalog (Meses y Bimestres)
Built with