Skip to main content
Version: v1.0.0(int)

W168: Delete document

Hard-deletes an attachment. Triggered from the documents section of an order detail page.

Steps

  1. Assert the row exists. Documents.getById — 404 when the id doesn't resolve in the caller's org.
  2. Delete. Documents.delete(documentId) — removes the row, then best-effort deletes the GCS object.

Returns

Nothing (L4 echoes { deletedId }).

Business rules

  • The row is the source of truth: row deletion always wins; a failed GCS delete leaves an orphaned object for the sweeper.

Errors

ConditionError
Document not found in this orgnot_found