> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nest.vet/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept Invoice Deletions



## OpenAPI

````yaml post /api/v1/invoice-deletions
openapi: 3.1.0
info:
  title: Nest Data Pipeline - Webhooks
  version: 0.3.0
servers:
  - url: https://webhooks.nest.vet
security: []
paths:
  /api/v1/invoice-deletions:
    post:
      tags:
        - invoice-deletions
      summary: Accept Invoice Deletions
      operationId: accept_invoice_deletions_api_v1_invoice_deletions_post
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            description: >-
              Unique key for this webhook delivery used to deduplicate
              scheduling (max 36 chars).
            title: Idempotency-Key
          description: >-
            Unique key for this webhook delivery used to deduplicate scheduling
            (max 36 chars).
        - name: X-Organization-Id
          in: header
          required: true
          schema:
            type: string
            description: Identifier of the organization/tenant that owns the invoice data.
            title: X-Organization-Id
          description: Identifier of the organization/tenant that owns the invoice data.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookInvoiceDeletionsRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookInvoiceDeletionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WebhookInvoiceDeletionsRequest:
      properties:
        invoices:
          items:
            $ref: '#/components/schemas/WebhookInvoiceDeletion'
          type: array
          title: Invoices
          description: >-
            Collection of invoice-level deletions. When provided, all invoice
            lines for the invoice will also be marked as deleted.
        invoice_lines:
          items:
            $ref: '#/components/schemas/WebhookInvoiceLineDeletion'
          type: array
          title: Invoice Lines
          description: >-
            Collection of individual invoice line deletions. May be supplied
            without invoice-level deletions or alongside them.
      type: object
      title: WebhookInvoiceDeletionsRequest
    WebhookInvoiceDeletionsResponse:
      properties:
        status:
          type: string
          enum:
            - scheduled
            - duplicate
            - completed
            - error
          title: Status
          description: >-
            Scheduling outcome for this deletion webhook delivery; semantics
            mirror WebhookInvoicesResponse (with 'completed' reserved for future
            use).
        task_id:
          type: string
          title: Task Id
          description: >-
            Deterministic Cloud Tasks identifier derived from organization and
            Idempotency-Key.
        scheduled_for:
          type: string
          format: date-time
          title: Scheduled For
          description: UTC timestamp when the deletion task is scheduled to run.
        idempotency_key:
          type: string
          maxLength: 36
          minLength: 1
          title: Idempotency Key
          description: >-
            Opaque deduplication key supplied via Idempotency-Key header (max 36
            chars).
        invoices_count:
          type: integer
          title: Invoices Count
          description: Number of invoice records included in the deletion payload.
        invoice_lines_count:
          type: integer
          title: Invoice Lines Count
          description: Number of invoice-line records included in the deletion payload.
        received_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Received At
          description: UTC timestamp when the webhook was received by the service.
      type: object
      required:
        - status
        - task_id
        - scheduled_for
        - idempotency_key
        - invoices_count
        - invoice_lines_count
      title: WebhookInvoiceDeletionsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WebhookInvoiceDeletion:
      properties:
        invoice_id:
          type: string
          title: Invoice Id
          description: >-
            Stable identifier for the invoice being deleted in the source
            system.
        clinic_id:
          type: string
          title: Clinic Id
          description: Clinic/location identifier for the invoice being deleted.
        client_id:
          type: string
          title: Client Id
          description: >-
            Source-system client identifier used to derive the household_id in
            Spanner.
      type: object
      required:
        - invoice_id
        - clinic_id
        - client_id
      title: WebhookInvoiceDeletion
    WebhookInvoiceLineDeletion:
      properties:
        invoice_line_id:
          type: string
          title: Invoice Line Id
          description: >-
            Stable identifier for the invoice line being deleted in the source
            system.
        invoice_id:
          type: string
          title: Invoice Id
          description: Identifier of the parent invoice for the deleted line.
        clinic_id:
          type: string
          title: Clinic Id
          description: Clinic/location identifier associated with the deleted line.
      type: object
      required:
        - invoice_line_id
        - invoice_id
        - clinic_id
      title: WebhookInvoiceLineDeletion
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````