Events

Create an invitation code

POST/events/:eventId/entries/:entryId/invitation-code

Create a referral invitation code from the authenticated user's own entry. Each entry has one code; if it already exists, that code is returned (after syncing its target ticket and redemption limit with the ticket's current invitation settings). No request body is required.

AuthLogin required

Path parameters

eventIdstringrequired

Event ID.

entryIdstringrequired

The authenticated user's own entry ID.

Notes

Returns 201 when a new code is created and 200 when an existing code is returned.

Codes can only be created for a published (PUBLISHED / PRIVATE) event from your own entry in the CONFIRMED or CHECKED_IN state. Specifying someone else's entry returns 403; a ticket without the invitation feature, or an entry at the generation limit, returns 400. Check canCreateInvitationCode on GET /events/:eventId/entries beforehand.

Response

FieldTypeDescription
codestringThe invitation code (8 characters); pass it as invitationCode when registering.
maxRedemptionsnumberMaximum number of people who can be invited with this code.
redeemedCountnumberNumber of people already invited with this code.
invitationLimitConfiguredbooleanWhether the ticket sets an invitation limit; when false the default of 1 applies.
targetTicketTicketThe ticket invitees register with, including the invitation discount discountPercent / discountAmount (null when not set).
Request
curl https://api.4s.link/events/EVENT_ID/entries/ENTRY_ID/invitation-code \
-X POST \
-H "Authorization: Bearer 4s_at_..."
Example response
{
"code": "AB12CD34",
"maxRedemptions": 10,
"redeemedCount": 0,
"invitationLimitConfigured": true,
"targetTicket": {
"id": "t2b3c4d5-...",
"name": "招待参加",
"price": 3000,
"paymentType": "PREPAID_STRIPE",
"discountPercent": 20,
"discountAmount": null
}
}