Skip to main content
POST
Create coupon

Авторизации

Authorization
string
header
обязательно

API token from the Zenedu dashboard

Параметры пути

bot
integer
обязательно

Bot ID

Тело

application/json
code
string
обязательно

Coupon code

Maximum string length: 250
discount_type
enum<string>
обязательно
Доступные опции:
percent,
amount
discount_amount
number
обязательно

Percent for percent type, amount in offer currency for amount type

Требуемый диапазон: x >= 0.01
duration_type
enum<string>
обязательно

How long the discount applies to a subscription

Доступные опции:
once,
forever,
repeating
offer_ids
integer[]
обязательно

Offers the coupon applies to

Minimum array length: 1
active
boolean

Whether the coupon is active

duration_amount
integer | null

Number of billing periods; required when duration_type is repeating

Требуемый диапазон: x >= 1
expired_at
string<date-time> | null

Expiration date (UTC)

usage_limit
integer | null

Maximum number of uses

Требуемый диапазон: x >= 1

Ответ

Coupon created

data
object