DiscardDocuments
Discard accounting documents by ID using the supplied discard reason. Only documents with status "In Progress" can be discarded; documents in any other status cannot be discarded. Supported document types are cash entry (c2g__codaCashEntry__c), journal (c2g__codaJournal__c), sales invoice (c2g__codaInvoice__c), sales credit note (c2g__codaCreditNote__c), payable invoice (c2g__codaPurchaseInvoice__c) and payable credit note (c2g__codaPurchaseCreditNote__c).
| Property | Value |
| Label | Discard Documents |
| Category | Accounting |
| Since | Summer 2026 |
| Read-only | No |
| Supports Agents | Yes |
| Supports Flows | No |
| Async Action | No |
| Keywords | discard, remove, delete, invoice, journal, document |
Request Parameters
| Field | Type | Label | Description | Required |
documentId | ID | Document to Discard | ID of the accounting document to discard. Supported document types are cash entry (c2g__codaCashEntry__c), journal (c2g__codaJournal__c), sales invoice (c2g__codaInvoice__c), sales credit note (c2g__codaCreditNote__c), payable invoice (c2g__codaPurchaseInvoice__c) and payable credit note (c2g__codaPurchaseCreditNote__c). | Yes |
discardReason | String | Discard Reason | Reason for discarding the document, as provided by the user. Recorded against the discarded document. | No |
Response Parameters
| Field | Type | Label | Description | Required |
errorMessage | String | Error Message | Populated if the document could not be discarded; contains the error detail. Empty on success. | No |
hasErrors | Boolean | Has Errors | 'True' if the document could not be discarded; 'False' if it was discarded successfully. | No |
|