Loading...

Knowledge Base

Cancel Customer Invoices and Debit Notes Using the API

When you want to cancel customer invoices or debit notes using the API. This article explains the required parameters, supported transaction IDs, API request details, and response structure for invoice and debit note cancellation.

Cancelling a Customer's Invoice and Debit Note

 

Description

This call allows you to cancel a customer's invoices or debit notes. It requires a minimum of one invoice id or debit note id

Parameters

NameData TypeRequired / OptionalDescription
auth-useridIntegerRequiredAuthentication Parameter
api-keyStringRequiredAuthentication Parameter
invoice-idsArray Of IntegerRequiredInvoice Ids that are to be settled
debit-idsArray Of IntegerOptionalDebit Note Ids that are to be settled

HTTP Method

POST

Example Test URL Request

https://test.httpapi.com/api/billing/customer-transactions/cancel.xml?auth-userid=0&api-key=key&invoice-ids=0&invoice-ids=1&debit-ids=0&debit-ids=1

Response

Returns a hash map of the specified Transactions (invoices and / or debit notes) containing the below details:

  • Status (Success or Failed)

  • Error (only when the status is failed)

Returns the below details only in case of an invoice

  • Action Type (actiontype)

  • Description of the Action (actiontypedesc)

  • Order ID of the Invoice (entityid)

  • Action Status (actionstatus)

  • Description of the Action Status (actionstatusdesc)

Example

Request

https://test.httpapi.com/api/billing/customer-transactions/cancel.xml?auth-userid=0&api-key=key&invoice-ids=302789&debit-note-ids=25012

Response

{"25012":{"status":"Success"},"302789":{"actiontypedesc":"Addition of EE1 for 34543564564756.com for 1 month","actionstatus":"Failed","entityid":"574694","status":"Success","actiontype":"Add","description":" 34543564564756.com","actionstatusdesc":"Execution Cancelled"}}