Skip to main content
POST
/
events
/
{event}
/
coupons
Criar cupom
curl --request POST \
  --url http://localhost/api/v1/events/{event}/coupons \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>",
  "value": 50000000,
  "max_uses_per_person": 2,
  "min_order_cents": 1,
  "max_uses": 2,
  "starts_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "is_active": true,
  "description": "<string>"
}
'
{
  "data": {
    "id": 123,
    "event_id": 123,
    "code": "<string>",
    "type": "<string>",
    "value": 123,
    "min_order_cents": 123,
    "max_uses": 123,
    "max_uses_per_person": 123,
    "starts_at": "<string>",
    "expires_at": "<string>",
    "is_active": true,
    "description": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>"
  }
}

Authorizations

Authorization
string
header
required

API key do hub com escopo manage. Header: Authorization: Bearer <api_key>.

Path Parameters

event
string
required

Body

application/json

POST /api/v1/events/{event}/coupons — cria cupom. Espelha EventSales::saveCoupon. value: percent (1-100) quando type=percent; centavos quando type=fixed. Unicidade case-insensitive do código por evento é checada no controller.

code
string
required
Maximum string length: 50
type
enum<string>
required
Available options:
percent,
fixed
value
integer
required
Required range: 0 <= x <= 100000000
max_uses_per_person
integer
required
Required range: x >= 1
min_order_cents
integer | null
Required range: x >= 0
max_uses
integer | null
Required range: x >= 1
starts_at
string<date-time> | null
expires_at
string<date-time> | null
is_active
boolean
description
string | null
Maximum string length: 255

Response

JsonResource

data
CouponResource · object
required