Skip to main content
POST
/
api
/
v1
/
invoices
Accept Invoices
curl --request POST \
  --url https://webhooks.nest.vet/api/v1/invoices \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "invoices": [
    {
      "invoice_id": "<string>",
      "created_date": "2023-11-07T05:31:56Z",
      "subtotal": 123,
      "tax": 123,
      "clinic_id": "<string>",
      "client_id": "<string>",
      "invoice_code": "<string>",
      "due_date": "2023-11-07T05:31:56Z",
      "last_modified": "2023-11-07T05:31:56Z",
      "deleted": false,
      "team_member_id": "<string>",
      "invoice_lines": [
        {
          "invoice_line_id": "<string>",
          "date": "2023-11-07T05:31:56Z",
          "product_name": "<string>",
          "product_id": "<string>",
          "product_code": "<string>",
          "quantity": 123,
          "total": 123,
          "total_tax": 123,
          "standard_price": 123,
          "invoice_line_code": "<string>",
          "last_modified": "2023-11-07T05:31:56Z",
          "patient_id": "<string>",
          "team_member_id": "<string>",
          "is_payment": false,
          "deleted": false,
          "finalized": true,
          "voided": false,
          "voided_at": "2023-11-07T05:31:56Z",
          "tip": 0
        }
      ]
    }
  ]
}
'
{
  "status": "scheduled",
  "task_id": "<string>",
  "scheduled_for": "2023-11-07T05:31:56Z",
  "idempotency_key": "<string>",
  "invoices_count": 123,
  "received_at": "2023-11-07T05:31:56Z"
}

Headers

Idempotency-Key
string
required

Unique key for this webhook delivery used to deduplicate scheduling. Recommended to use a UUID. Maximum length 36 characters.

X-Organization-Id
string
required

Identifier of the organization/tenant that owns the invoices. Used for routing, logging, and idempotent task naming.

Body

application/json
invoices
WebhookInvoice · object[]

List of invoice payloads to process. A single request may contain up to 100 invoices; larger payloads will be rejected.

Response

Successful Response

status
enum<string>
required

Scheduling outcome for this webhook: 'scheduled' when a new Task is enqueued, 'duplicate' when a task already exists for the same Idempotency-Key, or 'completed' when the work was previously processed.

Available options:
scheduled,
duplicate,
completed
task_id
string
required

Deterministic Tasks identifier derived from organization and Idempotency-Key.

scheduled_for
string<date-time>
required

UTC timestamp when the Task is scheduled to run.

idempotency_key
string
required

Opaque key supplied by the caller to deduplicate webhook deliveries (max 36 chars).

Required string length: 1 - 36
invoices_count
integer
required

Number of invoices accepted from the request payload.

received_at
string<date-time> | null

UTC timestamp when the webhook was received by the service.