Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
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.
Supported REST HTTP Methods
- URI
- /services/data/XX.X/actions/custom/apex/blng__NegativeInvoiceToCreditNoteAction
- Formats
- JSON, XML
- HTTP Methods
- POST
- Authentication
- Authorization: Bearer token
Parameters
| Parameter | Description |
|---|---|
| invoiceId |
|
Response Body
| Parameter | Description |
|---|---|
| invoiceId |
|
| isSuccess |
|
| errorMessage |
|
Samples
- Sample Request Body
- This payload passes two invoice IDs to the negative invoice line conversion service.
-
1{ 2"inputs":[ 3 { 4 "invoiceId":"a1oS0000001NEixIAG" 5 }, 6 { 7 "invoiceId":"a1oS0000001NEixIAE" 8 } 9 ] 10} - 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.
-
1[ 2 { 3 "actionName" : "blng__NegativeInvoiceToCreditNoteAction", 4 "errors" : null, 5 "isSuccess" : true, 6 "outputValues" : { 7 "errorMessage" : "Null" 8 "invoiceId" : "a1oS0000001NEixIAG" 9 "isSuccess" : "true" 10 } 11 } 12 13 { 14 "actionName" : "blng__NegativeInvoiceToCreditNoteAction", 15 "errors" : null, 16 "isSuccess" : true, 17 "outputValues" : { 18 "errorMessage" : "The invoice does not have any negative invoice lines." 19 "invoiceId" : "a1oS0000001NEixIAE" 20 "isSuccess" : "false" 21 } 22 } 23 24]