REST API for Converting Invoice Lines with Negative Balances
Use the REST API service blng__NegativeInvoiceToCreditNoteAction to evaluate invoices in bulk and create credit notes for each invoice containing invoice lines with negative balances.
This object is available in API version 48.0 and later.
URI: /services/data/XX.X/actions/custom/apex/blng__NegativeInvoiceToCreditNoteAction
Formats: JSON, XML
HTTP Methods: POST
Authentication: Authorization: Bearer token
Type: ID
Description: The REST service evaluates this invoice for invoice lines with a negative balance. For each invoice, it creates a credit note containing one credit note line for each negative invoice line, unless an error occurs during credit note line creation. If even one of the -ve invoice line conversions errors out, all of them fail. No partial conversion can occur.
Each credit note line has a balance that’s the positive equivalent of the corresponding negative invoice line. The credit note lines are unallocated, so users must manually allocate them as needed.
Type: String
Description: The invoice that the REST service evaluated.
Type: Boolean
Description: Indicates whether the invoice was successfully evaluated (True) or could not be evaluated (False).
Type: String
Description: Error message indicating why the REST service couldn’t convert any negative invoice lines on the provided invoice. For example, the invoice did not have any negative invoice lines.
Sample Request Body
This payload passes two invoice IDs to the negative invoice line conversion service.
Sample Response Body
In this case, we receive a response with one error because the sample payload contained an invoice that didn’t have any negative invoice lines.