HostBill icon

HostBill

Consume HostBill API (v.0.1.3)

Overview

This n8n node allows you to add a payment to an existing invoice in HostBill via its API. It is useful for automating financial workflows, such as recording payments received through various gateways, updating invoice statuses, or integrating HostBill with other systems (e.g., CRMs, accounting software). For example, you could use this node to automatically log a payment when a transaction is completed in another system.

Properties

Name Type Meaning
Invoice ID Number The unique identifier of the invoice to which the payment will be added.
Transaction amount Number The amount of the payment being recorded.
Payment Gateway ID Number The ID of the payment gateway used for this transaction.
Fee Number Any fees applied to the payment (set to 0 if there are no fees).
Transaction Date DateTime The date and time when the transaction occurred.
Additional Fields Collection Optional extra fields:
  Transaction Number Number The reference number for the transaction (optional).
  Currency ID Number The currency identifier for the payment (optional).
  Currency Rate Number The exchange rate used for the payment (optional).

Output

The node outputs a JSON object (or array of objects) representing the result of the "Add Payment" operation. The exact structure depends on the HostBill API response, but typically includes details about the updated invoice and payment status. If an error occurs and "Continue On Fail" is enabled, the output will include an error field with the error message.

Example output:

[
  {
    "invoice_id": 123,
    "payment_id": 456,
    "status": "success",
    "amount": 100.00,
    "date": "2024-06-01T12:34:56Z"
  }
]

If binary data is returned by the API, it will be included as a binary property, but for this operation, only JSON output is expected.

Dependencies

  • HostBill API: Requires access to a HostBill instance with API enabled.
  • API Credentials: You must configure valid HostBill API credentials in n8n under the name hostBillApi.
  • n8n Configuration: No special environment variables are required beyond standard credential setup.

Troubleshooting

  • Invalid Credentials: If your API credentials are incorrect or missing, the node will throw an authentication error. Ensure your credentials are set up correctly in n8n.
  • Missing Required Fields: If any required property (such as Invoice ID or Transaction amount) is missing, the node will fail with a validation error.
  • API Errors: If the HostBill API returns an error (e.g., invalid invoice ID, payment gateway not found), the node will display the error message from the API. Check that all IDs and values are correct.
  • Error Handling: If "Continue On Fail" is enabled, errors for individual items will be included in the output with an error field.

Links and References

Discussion