---
title: "Create a discount — estimate"
method: POST
path: "/v1/messaging/commerce/discounts/estimate"
tags: ["Commerce"]
---

# Create a discount — estimate

`POST /v1/messaging/commerce/discounts/estimate`

## Request

- Base URL: `https://apihub.co.il`
- URL: `https://apihub.co.il/v1/messaging/commerce/discounts/estimate`
- Auth: HTTP bearer

Price the request without executing it. Same body as `POST /v1/messaging/commerce/discounts`.

## Request body

- object
  - `code` string: Required for method code.
  - `type` 'percentage' | 'fixed_amount' | 'free_shipping', required
  - `title` string, required
  - `amount` string: For type fixed_amount, a decimal in the store currency.
  - `endsAt` string, date-time, nullable
  - `method` 'code' | 'automatic', required
  - `startsAt` string, date-time: Defaults to now.
  - `accountId` string, required
  - `percentage` number: For type percentage, e.g. 15 for 15%.
  - `productIds` string[]
  - `usageLimit` integer, nullable: Code discounts only: total uses allowed.
  - `collectionIds` string[]
  - `minimumQuantity` integer, nullable
  - `minimumSubtotal` string, nullable: Minimum order subtotal, a decimal in the store currency.
  - `oncePerCustomer` boolean: Code discounts only.
  - `appliesOnEachItem` boolean: fixed_amount only: take the amount off each item instead of once per order.

## Response `200`

Estimate

- Estimate
  - `operation` string
  - `estimated_credits` number
  - `credits_to_reserve` number
  - `estimated_usage` object
  - `note` string, nullable
  - `balance` object
    - `available` number
  - `sufficient` boolean

---

[API](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai.md) · [All operations](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/revisions/a8caa42835ce?raw)
