---
title: "Create ConsolidatedInvoice"
method: POST
path: "/api/v1/sale/consolidate"
tags: ["Sales"]
---

# Create ConsolidatedInvoice

`POST /api/v1/sale/consolidate`

Permissions needed: NONE
This endpoint is used to create the consolidated invoice for selected sales - all sales must belong to same customer.

## Request body

- object
  - `customer_id` integer, required
  - `invoice_date` string, date-time, required
  - `sales_ids` integer[]

## Response `200`

successful operation

- object
  - `consolidatingSaleId` integer — Consolidating sale id
  - `invoice` object — Invoice object details
  - `invoicePreview` string — HTML string of consolidated invoice
  - `selectedSalesDetails` object[] — Contains details of selected sales that has been consolidated.
    - `date` string — Sale date
    - `id` integer — Sale record or counter sale id
    - `number` string — Sale record number, null for counter sale
    - `pet` object — Pet details - if sale is from a pet record
    - `sale` object — Sale details
    - `sale_id` integer — Sale id

## Other responses

- `400` — unresolved $ref
- `401` — unresolved $ref
- `403` — unresolved $ref
- `422` — Bad request
- `429` — unresolved $ref

---

[API](https://skmtc.net/digitail/apis/digitail-api.md) · [All operations](https://skmtc.net/digitail/apis/digitail-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitail/digitail-api/revisions/bd9694db5fce/schema)
