Skip to main content
POST
/
instances
/
{instanceId}
/
coupons
Create coupons
curl --request POST \
  --url https://api.altostrat.io/instances/{instanceId}/coupons \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "minutes_valid": 1440,
  "count": 50
}'
[
  {
    "id": "b1c2d3e4-f5a6-b7c8-d9e0-f1a2b3c4d5e6",
    "code": "8B7W3D",
    "expires_at": "2025-11-01T12:00:00Z",
    "redeemed_at": null,
    "created_at": "2025-10-29T12:00:00Z"
  }
]

Authorizations

Authorization
string
header
required

API Key authentication. Provide your token in the 'Authorization' header. Example: Authorization: Bearer <YOUR_TOKEN>

Path Parameters

instanceId
string<uuid>
required

The unique identifier for the captive portal instance.

Example:

"9a7f1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c"

Body

application/json
minutes_valid
integer
required

The number of minutes from the time of creation that the coupons will be valid for.

Required range: x >= 1
Example:

1440

count
integer
required

The number of coupons to create in this batch.

Required range: 1 <= x <= 200
Example:

50

Response

The coupons were created successfully.

id
string<uuid>

The unique identifier for the coupon.

Example:

"b1c2d3e4-f5a6-b7c8-d9e0-f1a2b3c4d5e6"

code
string

The 6-character alphanumeric code for the coupon.

Example:

"8B7W3D"

expires_at
string<date-time>

The timestamp when the coupon will expire and become invalid.

Example:

"2025-11-01T12:00:00Z"

redeemed_at
string<date-time> | null

The timestamp when the coupon was redeemed. Null if not yet redeemed.

Example:

null

created_at
string<date-time>

The timestamp when the coupon was created.

Example:

"2025-10-29T12:00:00Z"