---
title: "Create or overwrite discount coupons"
method: PUT
path: "/coupons/import"
tags: ["Discount coupons"]
---

# Create or overwrite discount coupons

`PUT /coupons/import`

## Request

- Base URL: `https://api2.ecomailapp.cz`
- URL: `https://api2.ecomailapp.cz/coupons/import`
- Auth: API key in header `key`

Create new discount coupons and overwrite existing ones in a default or specific folder.

## Request body

- object
  - `folderId` integer: Folder ID. If not provided, coupons are created and overwritten in the default folder.
  - `codes` unknown[], required: Array of coupon code strings, up to 50,000 codes. Each code can have up to 255 characters.
    - unknown
  - `valid_until` string: Expiration date in `YYYY-MM-DD` format.
  - `type` string: Discount type: `percentual` or `fixed`. Required when `value` is set.
  - `value` number: Discount value, greater than `0`. The maximum is `100` for `percentual` and `99999999.99` for `fixed`. Required when `type` is set.
  - `currency` string: Three-letter currency code, for example `CZK`. Required when `type` is `fixed` or when `min_spend` is set.
  - `min_spend` number: Minimum order value, from `0` to `99999999.99`.
  - `shipping_price` string: Shipping rule of the discount: `cart`, `free`, or `beforeDiscount`.

## Response `200`

OK

- object
  - `imported` integer
  - `duplicated` integer
  - `updated` integer
  - `totalCount` integer

## Other responses

- `422`: Unprocessable Entity

## Changes

- **2026-10-26** `99b6cf7fe06b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ecomail/apis/ecomail-api/changes/coupons/import/put.md)

---

[API](https://skmtc.dev/ecomail/apis/ecomail-api.md) - [All operations](https://skmtc.dev/ecomail/apis/ecomail-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ecomail/apis/ecomail-api/revisions/c70ca534a306?raw)
