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

# Luma: Post V1 Calendars Coupons Create

> Create a coupon that can be applied to any event that is managed by the calendar. Be careful not to have the same code on an event and on the calendar.

Create a coupon that can be applied to any event that is managed by the calendar.

<Info>
  Tool ID: `luma_post_v1_calendars_coupons_create`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'luma_post_v1_calendars_coupons_create',
  {
    "code": "example",
    "discount": {
      "discount_type": "percent",
      "percent_off": 100
    }
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute luma_post_v1_calendars_coupons_create --input '{
  "code": "example",
  "discount": {
    "discount_type": "percent",
    "percent_off": 100
  }
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "id": "id_123",
    "code": "example",
    "remaining_count": 123,
    "valid_start_at": "2026-01-15T12:00:00Z",
    "valid_end_at": "2026-01-15T12:00:00Z",
    "percent_off": 1,
    "cents_off": 1,
    "currency": "solana_sol"
  }
}
```

Use `deepline tools get luma_post_v1_calendars_coupons_create --json` for the latest machine-readable contract.

## Input reference

Create a coupon that can be applied to any event that is managed by the calendar. Be careful not to have the same code on an event and on the calendar.

| Name                      | Type      | Required | Default | Details                                                                                                                                              |
| ------------------------- | --------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.code`            | `string`  | Yes      | —       | This is the code that the user will enter on the event page. It is not case sensitive. Maximum 20 characters. Minimum length: 1. Maximum length: 20. |
| `payload.remaining_count` | `integer` | No       | —       | Number of times the coupon can be used. Set to 1000000 for unlimited uses. Minimum: 0. Maximum: 1000000.                                             |
| `payload.valid_start_at`  | `string`  | No       | —       | ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z Format: `date-time`.                                                                        |
| `payload.valid_end_at`    | `string`  | No       | —       | ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z Format: `date-time`.                                                                        |
| `payload.discount`        | `object`  | Yes      | —       | —                                                                                                                                                    |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Create a coupon that can be applied to any event that is managed by the calendar. Be careful not to have the same code on an event and on the calendar.",
    "properties": {
      "code": {
        "type": "string",
        "description": "This is the code that the user will enter on the event page. It is not case sensitive. Maximum 20 characters.",
        "minLength": 1,
        "maxLength": 20
      },
      "remaining_count": {
        "type": "integer",
        "description": "Number of times the coupon can be used. Set to 1000000 for unlimited uses.",
        "minimum": 0,
        "maximum": 1000000
      },
      "valid_start_at": {
        "type": [
          "string",
          "null"
        ],
        "description": "ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z",
        "format": "date-time"
      },
      "valid_end_at": {
        "type": [
          "string",
          "null"
        ],
        "description": "ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z",
        "format": "date-time"
      },
      "discount": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "discount_type": {
                "type": "string",
                "const": "percent"
              },
              "percent_off": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              }
            },
            "required": [
              "discount_type",
              "percent_off"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "discount_type": {
                "type": "string",
                "const": "amount"
              },
              "cents_off": {
                "type": "number",
                "minimum": 0
              },
              "currency": {
                "type": "string",
                "enum": [
                  "solana_sol",
                  "solana_usdc",
                  "aed",
                  "afn",
                  "all",
                  "amd",
                  "ang",
                  "aoa",
                  "ars",
                  "aud",
                  "awg",
                  "azn",
                  "bam",
                  "bbd",
                  "bdt",
                  "bgn",
                  "bhd",
                  "bif",
                  "bmd",
                  "bnd",
                  "bob",
                  "brl",
                  "bsd",
                  "bwp",
                  "byn",
                  "bzd",
                  "cad",
                  "cdf",
                  "chf",
                  "clp",
                  "cny",
                  "cop",
                  "crc",
                  "cve",
                  "czk",
                  "djf",
                  "dkk",
                  "dop",
                  "dzd",
                  "egp",
                  "etb",
                  "eur",
                  "fjd",
                  "fkp",
                  "gbp",
                  "gel",
                  "ghs",
                  "gip",
                  "gmd",
                  "gnf",
                  "gtq",
                  "gyd",
                  "hkd",
                  "hnl",
                  "htg",
                  "huf",
                  "idr",
                  "ils",
                  "inr",
                  "isk",
                  "jmd",
                  "jod",
                  "jpy",
                  "kes",
                  "kgs",
                  "khr",
                  "kmf",
                  "krw",
                  "kwd",
                  "kyd",
                  "kzt",
                  "lak",
                  "lbp",
                  "lkr",
                  "lrd",
                  "lsl",
                  "mad",
                  "mdl",
                  "mga",
                  "mkd",
                  "mmk",
                  "mnt",
                  "mop",
                  "mur",
                  "mvr",
                  "mwk",
                  "mxn",
                  "myr",
                  "mzn",
                  "nad",
                  "ngn",
                  "nio",
                  "nok",
                  "npr",
                  "nzd",
                  "omr",
                  "pab",
                  "pen",
                  "pgk",
                  "php",
                  "pkr",
                  "pln",
                  "pyg",
                  "qar",
                  "ron",
                  "rsd",
                  "rub",
                  "rwf",
                  "sar",
                  "sbd",
                  "scr",
                  "sek",
                  "sgd",
                  "shp",
                  "sle",
                  "sos",
                  "srd",
                  "std",
                  "szl",
                  "thb",
                  "tjs",
                  "tnd",
                  "top",
                  "try",
                  "ttd",
                  "twd",
                  "tzs",
                  "uah",
                  "ugx",
                  "usd",
                  "uyu",
                  "uzs",
                  "vnd",
                  "vuv",
                  "wst",
                  "xaf",
                  "xcd",
                  "xof",
                  "xpf",
                  "yer",
                  "zar",
                  "zmw"
                ]
              }
            },
            "required": [
              "discount_type",
              "cents_off",
              "currency"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "required": [
      "code",
      "discount"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name                               | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Required | Default | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `result.data`                      | `object`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Yes      | —       | Provider response payload.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `result.data.id`                   | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Yes      | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `result.data.code`                 | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Yes      | —       | This code is case insensitive.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `result.data.remaining_count`      | `integer`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Yes      | —       | Minimum: -9007199254740991. Maximum: 9007199254740991.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `result.data.valid_start_at`       | `string \| null`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Yes      | —       | ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z Format: `date-time`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `result.data.valid_end_at`         | `string \| null`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Yes      | —       | ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z Format: `date-time`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `result.data.percent_off`          | `number \| null`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Yes      | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `result.data.cents_off`            | `number \| null`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Yes      | —       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `result.data.currency`             | `"solana_sol" \| "solana_usdc" \| "aed" \| "afn" \| "all" \| "amd" \| "ang" \| "aoa" \| "ars" \| "aud" \| "awg" \| "azn" \| "bam" \| "bbd" \| "bdt" \| "bgn" \| "bhd" \| "bif" \| "bmd" \| "bnd" \| "bob" \| "brl" \| "bsd" \| "bwp" \| "byn" \| "bzd" \| "cad" \| "cdf" \| "chf" \| "clp" \| "cny" \| "cop" \| "crc" \| "cve" \| "czk" \| "djf" \| "dkk" \| "dop" \| "dzd" \| "egp" \| "etb" \| "eur" \| "fjd" \| "fkp" \| "gbp" \| "gel" \| "ghs" \| "gip" \| "gmd" \| "gnf" \| "gtq" \| "gyd" \| "hkd" \| "hnl" \| "htg" \| "huf" \| "idr" \| "ils" \| "inr" \| "isk" \| "jmd" \| "jod" \| "jpy" \| "kes" \| "kgs" \| "khr" \| "kmf" \| "krw" \| "kwd" \| "kyd" \| "kzt" \| "lak" \| "lbp" \| "lkr" \| "lrd" \| "lsl" \| "mad" \| "mdl" \| "mga" \| "mkd" \| "mmk" \| "mnt" \| "mop" \| "mur" \| "mvr" \| "mwk" \| "mxn" \| "myr" \| "mzn" \| "nad" \| "ngn" \| "nio" \| "nok" \| "npr" \| "nzd" \| "omr" \| "pab" \| "pen" \| "pgk" \| "php" \| "pkr" \| "pln" \| "pyg" \| "qar" \| "ron" \| "rsd" \| "rub" \| "rwf" \| "sar" \| "sbd" \| "scr" \| "sek" \| "sgd" \| "shp" \| "sle" \| "sos" \| "srd" \| "std" \| "szl" \| "thb" \| "tjs" \| "tnd" \| "top" \| "try" \| "ttd" \| "twd" \| "tzs" \| "uah" \| "ugx" \| "usd" \| "uyu" \| "uzs" \| "vnd" \| "vuv" \| "wst" \| "xaf" \| "xcd" \| "xof" \| "xpf" \| "yer" \| "zar" \| "zmw"` | Yes      | —       | Allowed: `solana_sol`, `solana_usdc`, `aed`, `afn`, `all`, `amd`, `ang`, `aoa`, `ars`, `aud`, `awg`, `azn`, `bam`, `bbd`, `bdt`, `bgn`, `bhd`, `bif`, `bmd`, `bnd`, `bob`, `brl`, `bsd`, `bwp`, `byn`, `bzd`, `cad`, `cdf`, `chf`, `clp`, `cny`, `cop`, `crc`, `cve`, `czk`, `djf`, `dkk`, `dop`, `dzd`, `egp`, `etb`, `eur`, `fjd`, `fkp`, `gbp`, `gel`, `ghs`, `gip`, `gmd`, `gnf`, `gtq`, `gyd`, `hkd`, `hnl`, `htg`, `huf`, `idr`, `ils`, `inr`, `isk`, `jmd`, `jod`, `jpy`, `kes`, `kgs`, `khr`, `kmf`, `krw`, See the live schema for the complete constraint. |
| `result.data.event_ticket_type_id` | `string \| null`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | No       | —       | The ticket type this coupon is restricted to, if any. Set for unlock (access) codes that reveal a hidden ticket type.                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `result.meta`                      | `object`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | Additional response metadata (status, paging).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "This code is case insensitive."
          },
          "remaining_count": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "valid_start_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z",
            "format": "date-time"
          },
          "valid_end_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 8601 Datetime. For example, 2022-10-19T03:27:13.673Z",
            "format": "date-time"
          },
          "percent_off": {
            "type": [
              "number",
              "null"
            ]
          },
          "cents_off": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "solana_sol",
              "solana_usdc",
              "aed",
              "afn",
              "all",
              "amd",
              "ang",
              "aoa",
              "ars",
              "aud",
              "awg",
              "azn",
              "bam",
              "bbd",
              "bdt",
              "bgn",
              "bhd",
              "bif",
              "bmd",
              "bnd",
              "bob",
              "brl",
              "bsd",
              "bwp",
              "byn",
              "bzd",
              "cad",
              "cdf",
              "chf",
              "clp",
              "cny",
              "cop",
              "crc",
              "cve",
              "czk",
              "djf",
              "dkk",
              "dop",
              "dzd",
              "egp",
              "etb",
              "eur",
              "fjd",
              "fkp",
              "gbp",
              "gel",
              "ghs",
              "gip",
              "gmd",
              "gnf",
              "gtq",
              "gyd",
              "hkd",
              "hnl",
              "htg",
              "huf",
              "idr",
              "ils",
              "inr",
              "isk",
              "jmd",
              "jod",
              "jpy",
              "kes",
              "kgs",
              "khr",
              "kmf",
              "krw",
              "kwd",
              "kyd",
              "kzt",
              "lak",
              "lbp",
              "lkr",
              "lrd",
              "lsl",
              "mad",
              "mdl",
              "mga",
              "mkd",
              "mmk",
              "mnt",
              "mop",
              "mur",
              "mvr",
              "mwk",
              "mxn",
              "myr",
              "mzn",
              "nad",
              "ngn",
              "nio",
              "nok",
              "npr",
              "nzd",
              "omr",
              "pab",
              "pen",
              "pgk",
              "php",
              "pkr",
              "pln",
              "pyg",
              "qar",
              "ron",
              "rsd",
              "rub",
              "rwf",
              "sar",
              "sbd",
              "scr",
              "sek",
              "sgd",
              "shp",
              "sle",
              "sos",
              "srd",
              "std",
              "szl",
              "thb",
              "tjs",
              "tnd",
              "top",
              "try",
              "ttd",
              "twd",
              "tzs",
              "uah",
              "ugx",
              "usd",
              "uyu",
              "uzs",
              "vnd",
              "vuv",
              "wst",
              "xaf",
              "xcd",
              "xof",
              "xpf",
              "yer",
              "zar",
              "zmw"
            ]
          },
          "event_ticket_type_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ticket type this coupon is restricted to, if any. Set for unlock (access) codes that reveal a hidden ticket type."
          }
        },
        "required": [
          "id",
          "code",
          "remaining_count",
          "valid_start_at",
          "valid_end_at",
          "percent_off",
          "cents_off",
          "currency"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Luma provider guide](/docs/providers/luma/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
