---
title: "Runs the price rule engine over a proposed set of line items without
persisting. Used by the invoice grid to show rule discounts (BOGO,
spend thresholds, etc.) live as the user edits, while keeping the
server as the single source of truth for the math — no client-side
evaluator to drift."
method: POST
path: "/Invoices/preview-rules"
tags: ["Invoices"]
---

# Runs the price rule engine over a proposed set of line items without
persisting. Used by the invoice grid to show rule discounts (BOGO,
spend thresholds, etc.) live as the user edits, while keeping the
server as the single source of truth for the math — no client-side
evaluator to drift.

`POST /Invoices/preview-rules`

## Request body

- PreviewPriceRulesRequestDto — Request body for `POST /invoices/preview-rules`. The client sends its proposed line items; the server runs the engine over them without persisting and returns the per-line + order-level rule discounts.
  - `items` PreviewLineItemDto[]
    - `localId` string — Caller-supplied id used to map results back. Not persisted.
    - `unitPrice` union
      - number, double
      - string, double
    - `quantity` union
      - number, double
      - string, double
    - `discount` union
      - number, double
      - string, double
    - `dispenseFee` union
      - number, double
      - string, double
    - `groupCodeId` string, nullable
    - `serviceCatalogItemId` string, nullable
    - `retailItemId` string, nullable
    - `inventoryItemId` string, nullable
  - `clientId` string, nullable — Estimate's client, used to resolve customer-tag rule gating in preview. Optional — when absent, client-tag-gated rules are simply not previewed.

## Response `200`

OK

- PreviewPriceRulesResponseDto
  - `lineRuleDiscounts` LineRuleDiscountDto[]
    - `localId` string
    - `amount` union
      - number, double
      - string, double
  - `ruleOrderDiscountAmount` union
    - number, double
    - string, double

---

[API](https://skmtc.net/clinicos/apis/pawthosx-business-api-v1.md) · [All operations](https://skmtc.net/clinicos/apis/pawthosx-business-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clinicos/pawthosx-business-api-v1/versions/a905bde4e796/schema)
