---
title: "Create a Sale"
method: POST
path: "/api/v1/sales"
tags: ["Sales"]
---

# Create a Sale

`POST /api/v1/sales`

Permissions needed: any of (CREATE_CHECKUPS, EDIT_CHECKUPS, CREATE_EDIT_COUNTER_SALE, SELL_SERVICES)

## Request body

- object
  - `discount` number, float, nullable
  - `discount_percentage` number, float, nullable
  - `discount_type` 'fixed' | 'percentage', nullable
  - `discount_reason` object, nullable
    - `reason` string, nullable
    - `is_private` 'public' | 'private'
  - `predefined_discounts` integer[]
  - `sold_products` object[]
    - `id` integer
    - `product_id` integer
    - `vet_id` number, float
    - `unit_id` 'unit' | 'subunit'
    - `unit` string
    - `quantity` number, float
    - `sale_price` number, float
    - `sale_price_with_vat` number, float
    - `vat` number, float — Deprecated for lines referencing a catalog item — use `tax_rate_ids`. Still required on write-in lines (no `product_id` / `service_package_id`).
    - `tax_rate_ids` integer[] — Tax rate ids to apply. Takes precedence over `vat` when present. Send at most the clinic's `max_tax_rates` (1 today).
    - `price` number, float
    - `sub_price` number, float
    - `product_name` string
    - `label` string
    - `recommendations` string
    - `is_checkout_bought` boolean
    - `fixed_fee` number, float
    - `include_fixed_fee` boolean
    - `discount_reason` object, nullable
      - `reason` string, nullable
      - `is_private` 'public' | 'private'
    - `discount` number, float
    - `discount_percentage` number, float
    - `discount_type` 'fixed' | 'percentage'
    - `price_threshold_type` 'minimum' | 'maximum'
    - `purchase_order_items` object[]
      - `id` integer
      - `quantity` number, float
  - `sold_services` object[]
    - `id` integer
    - `service_package_id` integer
    - `quantity` number, float
    - `price` number, float
    - `unit_price` number, float
    - `vat` number, float — Deprecated for lines referencing a catalog item — use `tax_rate_ids`. Still required on write-in lines (no `product_id` / `service_package_id`).
    - `tax_rate_ids` integer[] — Tax rate ids to apply. Takes precedence over `vat` when present. Send at most the clinic's `max_tax_rates` (1 today).
    - `vet_id` number, float
    - `name` string
    - `original_price` number, float
    - `is_checkout_bought` boolean
    - `discount` number, float
    - `discount_percentage` number, float
    - `discount_type` 'fixed' | 'percentage'
    - `discount_reason` object, nullable
      - `reason` string, nullable
      - `is_private` 'public' | 'private'
    - `aaha_code` string
    - `products` object[]
      - `id` integer
      - `product_id` integer
      - `units` unknown[]
        - unknown
      - `formula` number, float
      - `unit_price_with_vat` number, float
      - `subunit_price_with_vat` number, float
      - `unit_id` 'unit' | 'subunit'
      - `quantity` number, float
      - `label` string
      - `recommendations` string
      - `name` string
      - `displayed` boolean
      - `purchase_order_items` object[]
        - `id` integer
        - `quantity` number, float

## Response `200`

- object
  - `data` object
    - `id` integer
    - `clinic_id` string
    - `customer_id` string
    - `type` integer
    - `customer` Data — unresolved $ref
    - `file` Data — unresolved $ref
    - `counter_sale` integer, nullable — Id of the realted counter sale
    - `amount_paid` string
    - `amount_due` string
    - `edit_state_details` EditStateDetails — unresolved $ref
    - `status` 0 | 1 | 2 | 3 — `0` - Pending `1` - Pending `2` - Paid `3` - Partially Paid `4` - Paid (Overdraft)
    - `total` string
    - `global_discount_net` string
    - `global_discount_tax` string
    - `global_discount_gross` string
    - `consolidated` boolean — A consolidated sale is a group of sale. A consolidated sale can't have direct products or services associated with it.
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `400` — unresolved $ref
- `401` — unresolved $ref
- `403` — unresolved $ref
- `422` — unresolved $ref
- `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)
