Actions40
- Job Actions
- Account Hierarchy Actions
- Cryptography Actions
- Customer Hierarchy Actions
- File Explorer Actions
- Generic API Actions
- Invoice Actions
- Mediation Actions
- Order Actions
- Quote Actions
- Subscription Actions
Overview
The Delete Canceled Invoices operation for the Invoice resource in this n8n node allows users to delete all invoices that have been canceled within a specific billing run in Opencell. This is useful for cleaning up or managing invoice data after a billing cycle, especially when canceled invoices are no longer needed and should be removed from the system.
Common scenarios:
- Automating the cleanup of canceled invoices after each billing run.
- Integrating with financial workflows where only active or completed invoices should remain.
- Ensuring compliance by removing unnecessary or obsolete invoice records.
Practical example:
After running a billing process, you may want to automatically remove all invoices that were canceled during that run to keep your invoicing database clean and up-to-date.
Properties
| Name | Type | Meaning |
|---|---|---|
| Authentication | options | Selects the authentication method to connect to Opencell (Basic Authentication or OAuth2). |
| Billing Run ID | number | The unique identifier of the billing run whose canceled invoices should be deleted. |
| Body Content Type | hidden | Internal property; always set to "multipart-form-data". Not user-configurable. |
Note:
The "Invoices" property is not used for this operation.
Output
- The output will be a JSON object containing the response from the Opencell API after attempting to delete the canceled invoices for the specified billing run.
- The structure of the output depends on the Opencell API's response for the DELETE request at
/opencell/api/rest/billing/invoicing/billingRun/{billingRunId}/canceledInvoices. - Typically, it may include status information, success/failure messages, or counts of deleted invoices.
Example output:
{
"status": "SUCCESS",
"message": "All canceled invoices deleted for billing run 12345."
}
(Actual fields depend on Opencell API implementation.)
Dependencies
- External Service: Requires access to an Opencell instance with API enabled.
- Authentication: Needs valid credentials for either Basic Authentication or OAuth2, configured in n8n credentials.
- n8n Configuration: The node must be properly configured with the correct Opencell API base URL and credentials.
Troubleshooting
Common issues:
- Invalid Billing Run ID: If the provided Billing Run ID does not exist, the API may return an error such as "Billing run not found".
- Insufficient Permissions: The user account used for authentication must have permission to delete invoices; otherwise, you may see "Unauthorized" or "Forbidden" errors.
- Network/API Errors: Connectivity issues or incorrect API endpoint configuration can result in errors like "Host error" or "Invalid credentials".
Error messages and resolutions:
"Username/password error. Error code : 401": Check your credentials and ensure they are correct."Host error. Error code : ENOTFOUND": Verify the Opencell API URL and network connectivity."Invalid credentials (unknown error)": Double-check authentication settings in n8n.