Skip to main content
PATCH
/
cabinet
/
admin
/
promocodes
/
{promocode_id}
Update Promocode Endpoint
curl --request PATCH \
  --url http://localhost:8080/cabinet/admin/promocodes/{promocode_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>",
  "type": "balance",
  "balance_bonus_kopeks": 123,
  "subscription_days": 123,
  "max_uses": 1,
  "valid_from": "2023-11-07T05:31:56Z",
  "valid_until": "2023-11-07T05:31:56Z",
  "is_active": true,
  "first_purchase_only": true,
  "promo_group_id": 123
}
'
{
  "id": 123,
  "code": "<string>",
  "type": "balance",
  "balance_bonus_kopeks": 123,
  "balance_bonus_rubles": 123,
  "subscription_days": 123,
  "max_uses": 123,
  "current_uses": 123,
  "uses_left": 123,
  "is_active": true,
  "is_valid": true,
  "first_purchase_only": true,
  "valid_from": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "valid_until": "2023-11-07T05:31:56Z",
  "promo_group_id": 123,
  "created_by": 123
}

Path Parameters

promocode_id
integer
required

Body

application/json
code
string | null
Required string length: 1 - 50
type
enum<string> | null
Available options:
balance,
subscription_days,
trial_subscription,
promo_group,
discount
balance_bonus_kopeks
integer | null
subscription_days
integer | null
max_uses
integer | null
Required range: x >= 0
valid_from
string<date-time> | null
valid_until
string<date-time> | null
is_active
boolean | null
first_purchase_only
boolean | null
promo_group_id
integer | null

Response

Successful Response

id
integer
required
code
string
required
type
enum<string>
required
Available options:
balance,
subscription_days,
trial_subscription,
promo_group,
discount
balance_bonus_kopeks
integer
required
balance_bonus_rubles
number
required
subscription_days
integer
required
max_uses
integer
required
current_uses
integer
required
uses_left
integer
required
is_active
boolean
required
is_valid
boolean
required
first_purchase_only
boolean
required
valid_from
string<date-time>
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
valid_until
string<date-time> | null
promo_group_id
integer | null
created_by
integer | null