Skip to main content
POST
/
api
/
v1
/
invoice-deletions
Accept Invoice Deletions
curl --request POST \
  --url https://webhooks.nest.vet/api/v1/invoice-deletions \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "invoices": [
    {
      "invoice_id": "<string>",
      "clinic_id": "<string>",
      "client_id": "<string>"
    }
  ],
  "invoice_lines": [
    {
      "invoice_line_id": "<string>",
      "invoice_id": "<string>",
      "clinic_id": "<string>"
    }
  ]
}
'
{
  "status": "scheduled",
  "task_id": "<string>",
  "scheduled_for": "2023-11-07T05:31:56Z",
  "idempotency_key": "<string>",
  "invoices_count": 123,
  "invoice_lines_count": 123,
  "received_at": "2023-11-07T05:31:56Z"
}

Headers

Idempotency-Key
string
required

Unique key for this webhook delivery used to deduplicate scheduling (max 36 chars).

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

Deterministic Cloud Tasks identifier derived from organization and Idempotency-Key.

scheduled_for
string<date-time>
required

UTC timestamp when the deletion task is scheduled to run.

idempotency_key
string
required

Opaque deduplication key supplied via Idempotency-Key header (max 36 chars).

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.