Перейти к основному содержанию
POST
/
v1
/
crm
/
discounts
cURL
curl --request POST \
  --url https://api.example.com/v1/crm/discounts/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "discount": 1073741823,
  "start_at": "2023-11-07T05:31:56Z",
  "end_at": "2023-11-07T05:31:56Z",
  "type": 0,
  "discount_type": 0,
  "promocode": "<string>",
  "usage_limit": 1073741823,
  "extra": "<unknown>",
  "active": true,
  "deleted": true,
  "tenant": 123,
  "created_by": 123
}
'
{
  "id": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "discount": 1073741823,
  "start_at": "2023-11-07T05:31:56Z",
  "end_at": "2023-11-07T05:31:56Z",
  "type": 0,
  "discount_type": 0,
  "promocode": "<string>",
  "usage_limit": 1073741823,
  "extra": "<unknown>",
  "active": true,
  "deleted": true,
  "tenant": 123,
  "created_by": 123
}

Тело

name
string
обязательно
Maximum string length: 255
discount
integer
Требуемый диапазон: 0 <= x <= 2147483647
start_at
string<date-time> | null
end_at
string<date-time> | null
type
enum<integer>
  • 0 - Скидка
  • 1 - Промокод
  • 2 - Сумма
Доступные опции:
0,
1,
2
Требуемый диапазон: -2147483648 <= x <= 2147483647
discount_type
enum<integer>
  • 0 - Процент
  • 1 - Сумма
Доступные опции:
0,
1
Требуемый диапазон: -2147483648 <= x <= 2147483647
promocode
string | null
Maximum string length: 255
usage_limit
integer
Требуемый диапазон: 0 <= x <= 2147483647
extra
any
active
boolean
deleted
boolean
tenant
integer
created_by
integer | null

Ответ

201 - application/json
id
integer
обязательно
created_at
string<date-time>
обязательно
updated_at
string<date-time>
обязательно
name
string
обязательно
Maximum string length: 255
discount
integer
Требуемый диапазон: 0 <= x <= 2147483647
start_at
string<date-time> | null
end_at
string<date-time> | null
type
enum<integer>
  • 0 - Скидка
  • 1 - Промокод
  • 2 - Сумма
Доступные опции:
0,
1,
2
Требуемый диапазон: -2147483648 <= x <= 2147483647
discount_type
enum<integer>
  • 0 - Процент
  • 1 - Сумма
Доступные опции:
0,
1
Требуемый диапазон: -2147483648 <= x <= 2147483647
promocode
string | null
Maximum string length: 255
usage_limit
integer
Требуемый диапазон: 0 <= x <= 2147483647
extra
any
active
boolean
deleted
boolean
tenant
integer
created_by
integer | null