HostBill icon

HostBill

Consume HostBill API (v.0.1.3)

Overview

This n8n node allows you to update an existing client in HostBill via its API. It is designed for scenarios where you need to programmatically modify client details or their privileges, such as updating contact information, company data, or access rights. This node is particularly useful for automating customer management workflows, syncing external systems with HostBill, or batch-updating client records.

Example use cases:

  • Automatically update a client's address and phone number when they change in your CRM.
  • Grant or revoke specific billing or support privileges for a client based on business rules.
  • Bulk-update client profiles during data migration or cleanup processes.

Properties

Name Type Meaning
Client ID Number The unique identifier of the client to update.
Additional Fields Collection A set of optional fields to update, such as first name, last name, company name, address, etc.
Privileges Collection A set of boolean flags controlling the client's permissions (e.g., billing, support actions).

Additional Fields (Collection Options)

  • First name (String): Client's first name.
  • Last name (String): Client's last name.
  • Company Name (String): Company name for organization-type clients.
  • Address Line 1 (String): Primary address line.
  • Address Line 2 (String): Secondary address line.
  • City (String): City of residence.
  • State (String): State or region.
  • Post Code (String): Postal code.
  • Country (String): Country.
  • Phone Number (String): Contact phone number.

Privileges (Collection Options)

  • Billing: Receive billing notifications (Boolean)
  • Billing: Allow to view/pay invoices (Boolean)
  • Billing: Place new orders (Boolean)
  • Billing: View current balance (Boolean)
  • Billing: Add funds (Boolean)
  • Billing: Creditcard (Boolean)
  • Support: Open new tickets (Boolean)
  • Support: View current tickets (Boolean)
  • Support: Close tickets (Boolean)
  • Support: Receive email notifications (Boolean)
  • Misc: Modify main profile details (Boolean)
  • Misc: View emails history (Boolean)
  • Misc: Edit security settings (Boolean)
  • Misc: Add / Edit contacts (Boolean)
  • Misc: Access affiliates section (Boolean)

Output

The node returns a JSON object (or array of objects) representing the result of the update operation for each input item. The structure of the output depends on the HostBill API response, but typically includes updated client data or status information.

If an error occurs and "Continue On Fail" is enabled, the output will include an error field with the error message for that item.

Example output:

[
  {
    "id": 123,
    "firstname": "John",
    "lastname": "Doe",
    "companyname": "Acme Corp",
    "address1": "123 Main St",
    "city": "Metropolis",
    "privileges": {
      "billing_emails": true,
      "support_newticket": false
    }
    // ...other updated fields
  }
]

Or, in case of error:

[
  {
    "error": "Client not found"
  }
]

Dependencies

  • HostBill API: Requires valid HostBill API credentials configured in n8n under the credential type hostBillApi.
  • n8n Configuration: No additional configuration required beyond setting up the credentials.

Troubleshooting

  • Invalid Credentials: If the API credentials are incorrect or missing, the node will throw an authentication error. Ensure your HostBill API key and URL are correctly set in n8n credentials.
  • Client Not Found: If the provided Client ID does not exist, the API may return an error such as "Client not found".
  • Missing Required Fields: If required fields (like Client ID) are omitted, the node will fail with a validation error.
  • API Errors: Any errors returned by the HostBill API (such as permission denied, invalid data, etc.) will be surfaced as error messages in the output or as thrown exceptions if "Continue On Fail" is not enabled.

Links and References

Discussion