Create a promo code

POST
/promo-codes

Authorization

bearerAuth
headerAuthorizationBearer <token>

Authorization: Bearer hh_live_.... Create and revoke keys in Organizer → Settings → API. A key carries full access to its partner's data, including refunds and promo codes — treat it as a production credential and keep it server-side.

Request Body

application/json
  1. body
event_id*string
Formatuuid
code*string
Length3 <= length
discount_type*string
Value in"percentage""fixed_amount"
discount_amount*number

For percentage, must not exceed 100.

Range0 < value
max_uses?integer
Range1 <= value
expires_at?string
Formatdate-time

Response Body

The created promo code.

application/json
  1. response
data?
Example Request
curl -X POST 'https://hanghut.com/api/v1/promo-codes' \  -H 'Content-Type: application/json' \  -d '{  "event_id": "a7a26ff2-e851-45b6-9634-d595f45458b7",  "code": "string",  "discount_type": "percentage",  "discount_amount": 1}'
Example Response
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "code": "string",    "discount_type": "percentage",    "discount_amount": 0,    "max_uses": 0,    "times_used": 0,    "is_active": true,    "expires_at": "2019-08-24T14:15:22Z"  }}