Skip to main content
POST
Accept Invoice Deletions

Authorizations

X-API-Key
string
header
required

Service API key. Required on every endpoint except /api/v1/health.

Headers

Idempotency-Key
string
required

Unique key for this webhook delivery, used for request tracing (max 36 chars). Each delivery is scheduled as its own Cloud Task rather than deduplicated by this key -- see the response's task_id for why.

X-Organization-Id
string
required

Identifier of the organization/tenant that owns the invoice data.

Body

application/json
invoices
WebhookInvoiceDeletion · object[]

Collection of invoice-level deletions. When provided, all invoice lines for the invoice will also be marked as deleted.

invoice_lines
WebhookInvoiceLineDeletion · object[]

Collection of individual invoice line deletions. May be supplied without invoice-level deletions or alongside them.

Response

Successful Response

status
enum<string>
required

Scheduling outcome for this deletion webhook delivery; semantics mirror WebhookInvoicesResponse (with 'completed' reserved for future use).

Available options:
scheduled,
duplicate,
completed,
error
task_id
string
required

Cloud Tasks identifier for this delivery. Includes the organization and Idempotency-Key for traceability, but is suffixed with a random value per call -- it is not deterministic, so reusing the same Idempotency-Key across deliveries produces a different task_id each time and does not collide with (or get silently dropped in favor of) an earlier delivery.

scheduled_for
string<date-time>
required

UTC timestamp when the deletion task is scheduled to run.

idempotency_key
string
required

Opaque key supplied via the Idempotency-Key header, echoed back for correlation (max 36 chars). Does not deduplicate deliveries -- see task_id.

Required string length: 1 - 36
invoices_count
integer
required

Number of invoice records included in the deletion payload.

invoice_lines_count
integer
required

Number of invoice-line records included in the deletion payload.

received_at
string<date-time> | null

UTC timestamp when the webhook was received by the service.