Actions3
- Payment Actions
- Invoice Actions
Overview
This node integrates with the Gigstack API to create electronic invoices. It is designed for businesses that need to generate and manage invoices programmatically, especially in contexts where compliance with specific tax and payment regulations is required (e.g., Mexican CFDI invoicing). The node supports detailed invoice creation including client information, invoice items, taxes, metadata, and sending invoice emails.
Typical use cases include:
- Automating invoice generation after a sale or service completion.
- Creating invoices with detailed tax and product information.
- Sending invoices directly to clients via email.
- Managing invoices with different payment forms, methods, and currencies.
Example: A company can use this node to automatically create an invoice for a client after a purchase, specifying the client's tax details, invoice items with taxes, and send the invoice by email.
Properties
Name | Meaning |
---|---|
Return Files URLs | Whether to return URLs for the generated invoice files. |
Use | Use code for the invoice (a classification code relevant to the invoice context). |
Series | Series identifier for the invoice (used for invoice numbering or categorization). |
Payment Form | Payment form code indicating how the payment was or will be made. Options include various payment types such as cash, check, electronic transfer, credit card, etc. |
Invoice Type | Type of invoice, e.g., Income (Ingreso), Expense (Egreso), Transfer (Traslado), Payroll (Nómina), or Payment (Pago). |
Currency | Currency code for the invoice amounts. Supported options are MXN (Mexican Peso), USD (US Dollar), and EUR (Euro). |
Payment Method | Payment method code indicating if payment is single (PUE) or in installments/deferred (PPD). |
Emails | List of email addresses to which the invoice should be sent. |
Client ID | ID of an existing client to associate with the invoice. Ignored if specifying client details directly. |
Use Client Object | Boolean flag indicating whether to specify client details manually instead of using a client ID. |
Client RFC | RFC (tax identification number) of the client. Required if specifying client details manually. |
Client Legal Name | Legal name of the client. Required if specifying client details manually. |
Client Tax System | Tax system code of the client, describing their fiscal regime. Options include various Mexican tax regimes like General Law for Corporations, Non-Profit Entities, Salaries, Leasing, Foreign Residents, etc. |
Client ZIP Code | ZIP code of the client. Optional when specifying client details manually. |
Client Country | Country code of the client (e.g., "MEX" for Mexico). Required when specifying client details manually. |
Metadata | Key-value pairs of additional metadata to attach to the invoice. |
Invoice Items | Collection of invoice items, each with properties: Name, Description, Quantity, Total amount, Product Key, Unit Key, Unit Name, and Taxes. Taxes include factor type, inclusivity, rate, type, and withholding flag. |
Output
The node outputs JSON data representing the response from the Gigstack API after creating the invoice. This typically includes details about the created invoice such as its unique identifiers, status, and possibly URLs to the generated invoice files if requested.
If the "Return Files URLs" property is enabled, the output will contain URLs pointing to the generated invoice documents (e.g., PDF or XML files).
No binary data output is indicated by the source code.
Dependencies
- Requires an API key credential for authenticating with the Gigstack API.
- The node makes HTTP requests to the Gigstack API endpoints:
https://gigstack-cfdi-bjekv7t4.uc.gateway.dev/v1/invoices/create
for invoice creation.
- Proper configuration of the API key credential in n8n is necessary.
Troubleshooting
Common issues:
- Missing or invalid API key: The node will fail to authenticate with the Gigstack API.
- Invalid or incomplete client information: If specifying client details manually, missing required fields like RFC or legal name will cause errors.
- Incorrect invoice item data or tax configurations may lead to validation errors from the API.
- Network connectivity issues to the Gigstack API endpoint.
Error messages:
- Authentication errors usually indicate problems with the API key; verify the credential setup.
- Validation errors from the API will include messages about missing or invalid fields; review input properties accordingly.
- If the node is set to continue on failure, error details will be returned in the output JSON under an "error" field.
Links and References
- Gigstack API Documentation (Note: hypothetical link, replace with actual if available)
- Mexican CFDI invoicing standards and codes (for understanding invoice types, payment forms, tax systems):
This summary is based solely on static analysis of the provided source code and property definitions.