> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Charter works for any HTTP API, including the user's own. The packs are examples of the result, not the limit: an API with no pack is declared the same way, following https://raw.githubusercontent.com/r28ai/charter/main/docs/.mintlify/skills/declaring-charter-tools/SKILL.md.
> Charter is for agents that act in customers' accounts: every call is checked field by field before it's sent, the app says whose account each call is for, and the same declarations list what each tool can reach. https://docs.r28.ai/charter/llms.txt says what it is and lists every page.

# events_coupons_create

> Create a coupon that can be applied when a guest is registering for an event. Restrict it to a ticket type with `event_ticket_type_id` — when that ticket type is hidden, this creates an unlock (access) code. You are not able to edit the coupon terms after it has been created.

POST`https://public-api.luma.com/v1/events/coupons/create`

```python luma_events_coupons_create.py theme={null}
import asyncio

from charter.packs import luma

result = asyncio.run(luma.events_coupons_create.ainvoke({"code": ..., "discount": ..., "eventId": ...}))
```

## Body

| Field | Type | Description |
| - | - | - |
| `code` \* | `string` | This is the code that the user will enter on the event page. It is not case sensitive. Maximum 20 characters. min length 1; max length 20 |
| `remainingCount` | `integer` | Number of times the coupon can be used. Set to 1000000 for unlimited uses. ≥ 0; ≤ 1000000 |
| `validStartAt` | `string` | ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z |
| `validEndAt` | `string` | ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z |
| `discount` \* | [DiscountPercent](https://docs.r28.ai/charter/charter/packs/luma/events/objects.md#discountpercent) \| [DiscountAmount](https://docs.r28.ai/charter/charter/packs/luma/events/objects.md#discountamount) | A percentage off (`discount_type: percent`) or a fixed amount off in a currency (`discount_type: amount`). |
| `eventId` \* | `string` | Event ID, this usually starts with evt- |
| `eventTicketTypeId` | `string` | Optional. Restrict the coupon to a single ticket type. If that ticket type is hidden, the coupon acts as an unlock (access) code that reveals the ticket during registration. Pair a hidden ticket type that has Require Approval turned off with an unlock code to let invited guests register and pay directly, skipping the Apply to Attend step. For a code that unlocks the ticket without changing the price, set the discount to 0% (`percent_off: 0`). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.