# deleteAccountPayableDocumentAttachment

## Overview

Deletes an attachment metadata row (`AccountPayableDocumentAttachment`) by `id` and returns the deleted `id`. The delete is idempotent — a missing row is not an error — which lets the frontend also use it as the cleanup step when a metadata row was created but the binary upload to its `file` field failed.

Requires the account-payable `updateAccountPayableDocument` permission.

## Modules Commands Used

- None. Direct TailorDB access — `AccountPayableDocumentAttachment` is an app-side table; no module command exists for attachment metadata.

## Exception Handling

| Error Code | Description |
| --- | --- |
| DomainError | Authentication is required or the caller lacks the update permission. |
