LEDGERS icon

LEDGERS

Interact with LEDGERS API

Overview

This node operation creates a Purchase Invoice within an Indian purchase management system. It is designed to facilitate the recording of purchase invoices with detailed tax, item, and supplier information compliant with Indian GST regulations. This node is beneficial for businesses managing their procurement processes, ensuring accurate invoice creation with tax calculations, billing/shipping addresses, and currency handling.

Practical examples include:

  • Automatically generating purchase invoices from purchase orders in an ERP system.
  • Integrating supplier invoice data into accounting software with correct GST treatment.
  • Managing multi-currency purchase invoices with conversion rates and export details.

Properties

Name Meaning
Purchase Number Unique identifier for the purchase invoice.
Purchase Invoice Date Date when the purchase invoice was issued (date only).
Purchase Order ID Identifier linking this invoice to a specific purchase order.
Purchase Due Date Due date for payment of the purchase invoice (date only).
Tax Type Type of tax applied: No GST, SGST/CGST, or IGST.
Point of Sale State or territory where the sale is considered to have taken place; required if tax type is SGST/CGST or IGST.
Supplier State State or territory of the supplier; required if tax type is SGST/CGST or IGST.
Contact ID Identifier for the contact (supplier) associated with the purchase invoice.
Business Branch ID Identifier for the business branch creating the invoice.
Seller Tax ID Tax identification number of the seller/supplier.
Notes Additional notes related to the purchase invoice.
Same Address for Billing and Shipping Boolean indicating if billing and shipping addresses are the same.
Billing Address Collection of fields specifying billing address details including lines 1 & 2, city, company name, country, pincode, and state.
Shipping Address Collection of fields specifying shipping address details; shown only if billing and shipping addresses differ.
Items Collection of purchase items, each with multiple properties such as cess type/value, description, discount, expense account, GST rate, HSN/SAC code, item ID/name/type, taxable/non-taxable amounts, price type, quantity, rate, SKU, variant ID.
Invoice Currency Currency code for the invoice amount (e.g., INR, USD).
Additional Fields Optional additional fields including bill number, claim ITC (Input Tax Credit), currency info (converted amount, rates, from/to currencies), reverse charge flag, terms and conditions.
Reverse Charge Indicates if reverse charge mechanism applies (Yes/No).
Terms and Conditions Text field for any terms and conditions related to the invoice.
Specialized Supply Specifies special supply types like Import, Input Service Distribution, Composition Taxable Person, or Not Applicable.
Export Bill Number Export bill number; applicable if specialized supply is Import.
Export Bill Date Export bill date (date only); applicable if specialized supply is Import.
Export Port Code Export port code; applicable if specialized supply is Import.

Output

The node outputs JSON data representing the created purchase invoice record as returned by the external API. This includes all submitted invoice details along with any identifiers or status information provided by the backend system.

If binary data output is supported, it would typically represent attachments or documents related to the invoice, but no explicit binary output is indicated here.

Dependencies

  • Requires an API key credential for authentication with the external LEDGERS API service.
  • Needs valid credentials including email, password, API URL, and API key configured in n8n.
  • The node performs login requests to obtain an API token before making further API calls.
  • External API endpoints are used for login and purchase invoice creation.
  • Proper network connectivity to the LEDGERS API service is necessary.

Troubleshooting

  • Authentication Failures: Errors indicating "Authentication failed" usually mean incorrect API key, email, or password. Verify credentials in n8n settings.
  • Missing Required Fields: Ensure all mandatory fields like purchase number, dates, contact ID, items, and tax type are provided.
  • Invalid Tax or State Combinations: If tax type is SGST/CGST or IGST, point of sale and supplier state must be specified correctly.
  • API Token Expiry: The node obtains a fresh API token on each execution; persistent failures may indicate API service issues.
  • Network Issues: Timeouts or connection errors suggest network problems or incorrect API URLs.
  • Data Format Errors: Invalid data types or missing nested fields in items or addresses can cause API rejections.

To resolve errors, check input data validity, confirm credentials, and review API response messages for specific hints.

Links and References

Discussion