---
title: "Create a discount"
method: POST
path: "/api/ecommerce/v1/stores/{store_id}/discounts"
tags: ["Ecommerce: Discounts"]
---

# Create a discount

`POST /api/ecommerce/v1/stores/{store_id}/discounts`

Create a discount for a store. Fixed discounts take an amount in the smallest currency
unit (e.g. $10 is 1000); percentage discounts take a whole-number value between 1 and 100.
Free-shipping discounts ignore value. Returns the created discount.

## Path parameters

- `store_id` string, required

## Request body

- EcommerceV1DiscountCreateDiscountRequest
  - `code` string, required — The discount code customers enter at checkout.
  - `name` string — A human-friendly discount name.
  - `type` 'percentage' | 'fixed' | 'free_shipping', required — The discount type.
  - `value` integer, required — For percentage discounts a whole number 1-100; for fixed discounts an amount in the smallest currency unit (e.g. $10 is 1000). Ignored for free_shipping.
  - `allocation` 'total' | 'item' — Whether the discount applies to the cart total or to each eligible item.
  - `starts_at` string, date-time — When the discount becomes active. A bare date (2026-11-27) anchors to time_zone. Defaults to now when omitted.
  - `ends_at` string, date-time — When the discount expires. A bare date runs to the end of that day in time_zone. Never expires when omitted.
  - `usage_limit` integer — Maximum number of times the discount can be redeemed.
  - `min_cart_value` integer — Minimum cart value in the smallest currency unit required for the discount to apply.
  - `time_zone` string — IANA time zone used to interpret starts_at and ends_at.

## Response `201`

Created response

- EcommerceV1DiscountDiscountResponseResource
  - `data` EcommerceV1DiscountDiscountResource
    - `id` string — The discount ID, required by every other discount endpoint.
    - `code` string — The discount code customers enter at checkout.
    - `name` string, nullable — The discount name, or null.
    - `type` 'percentage' | 'fixed' | 'free_shipping', nullable — The discount type, or null.
    - `value` integer, nullable — The discount value, or null. Percentage is 1-100; fixed is in the smallest currency unit.
    - `allocation` 'total' | 'item', nullable — Whether the discount applies to the cart total or to each item, or null.
    - `is_disabled` boolean — Whether the discount is disabled.
    - `starts_at` string, date-time — When the discount becomes active.
    - `ends_at` string, date-time, nullable — When the discount expires, or null.
    - `usage_limit` integer, nullable — Maximum number of redemptions, or null for unlimited.
    - `usage_count` integer — Number of times the discount has been redeemed.

## Other responses

- `401` — Unauthenticated response
- `422` — Validation error response
- `500` — Error response

## Changes

- **2026-08-20** `b94885e042b8` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/hostinger/apis/hostinger-api/changes/api/ecommerce/v1/stores/:store_id/discounts/post.md)

---

[API](https://skmtc.dev/hostinger/apis/hostinger-api.md) · [All operations](https://skmtc.dev/hostinger/apis/hostinger-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hostinger/hostinger-api/revisions/53ccee45e5eb/schema)
