HostBill icon

HostBill

Consume HostBill API (v.0.1.3)

Overview

This n8n node allows you to create new orders in HostBill via its API. It is designed for scenarios where you need to automate the provisioning of products, services, or domain registrations/transfers for clients within your HostBill system. Typical use cases include:

  • Automating client onboarding by creating service orders programmatically.
  • Integrating HostBill order creation into broader business workflows (e.g., after a CRM deal is closed).
  • Batch processing of orders from external systems.

Practical Example:
When a new customer signs up on your website, this node can be used to automatically create an order for their selected hosting package and optionally register a domain name, generate and send invoices, and notify the client.

Properties

Name Type Meaning
Client ID Number The unique identifier of the client for whom the order is being created.
Notify Client Boolean If enabled, the client will be notified about the new order.
Generate Invoice Boolean If enabled, an invoice will be generated for this order.
Send Invoice Boolean If enabled, the generated invoice will be sent to the client.
Payment module ID Number The ID of the payment module to be used for generating the invoice.
Ordering product/service Collection Details of the product or service being ordered. Includes:
- Service ID Number The ID of the service/product to purchase.
- Domain Name String The domain name associated with the service (if applicable).
- Billing cycle Options The billing cycle for the service (e.g., Monthly, Annually, etc.).
- Promocode String A valid promotion code to apply to the order.
Ordering domain action Collection Details for domain registration or transfer. Includes:
- Type of Action Options Whether to register or transfer a domain.
- Domain Name String The domain name to register or transfer.
- Number of Years Number Registration period in years.
- Top-level Domain String The TLD (e.g., .com, .org) for the domain.
- Domain product ID Number Product ID for the domain (used if TLD is not specified).
- Enable DNS Management Boolean Enable DNS management for the domain.
- Email Forwarding Boolean Enable email forwarding for the domain.
- ID Protection Boolean Enable ID protection for the domain.
- Promocode String A valid promotion code for the domain order.

Output

The node returns a JSON array containing the results of the order creation operation(s). Each item in the output array represents the result for one input item and typically includes:

  • Order details as returned by the HostBill API (such as order ID, status, invoice information, etc.).
  • If an error occurs and "Continue On Fail" is enabled, the output will contain an error field with the error message for that item.

Example output:

[
  {
    "order_id": 12345,
    "status": "pending",
    "invoice_id": 67890,
    "client_id": 111,
    // ...other fields as provided by HostBill API
  }
]

If binary data is ever returned (unlikely for this operation), it would represent files or documents related to the order.

Dependencies

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

Troubleshooting

Common Issues:

  • Invalid Credentials: If the API credentials are incorrect or missing, the node will throw an authentication error.
  • Missing Required Fields: If any required property (like Client ID or Payment module ID) is missing, the node will fail with a validation error.
  • API Errors: If the HostBill API returns an error (e.g., invalid product ID, unavailable domain), the node will either throw an error or, if "Continue On Fail" is enabled, return an error message in the output.

Error Messages:

  • "Cannot read property '...' of undefined": Likely due to missing or misconfigured input properties.
  • "Authentication failed": Check your HostBill API credentials.
  • "Order creation failed: ...": Review the error message for specifics; check that all IDs and codes are valid.

Links and References

Discussion