# NewCouponInput

input type

Create-input for a Coupon. The tenant (org group) is derived SERVER-SIDE from the principal — NEVER supplied here; the RAW code is normalized (trim+UPPERCASE) + grammar-gated server-side; flavor⟺payload coherence is the boundary refine (trigger ⟺ promotionId, discount ⟺ effect); a trigger promotion must be same-tenant + ACTIVE + couponGated.

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `caption` | [String](/types/#scalars) | no | Optional: when omitted the per-type default applies — the NORMALIZED code (self-documenting — the code IS the identity); when supplied it must be non-blank. |
| `code` | [String](/types/#scalars) `String!` | yes | The RAW code (1..64 pre-normalization) — normalized + grammar-gated server-side; the org-group ACTIVE-code UNIQ marker mints IN the create transaction (a LIVE holder refuses CONFLICT/COUPON_CODE_TAKEN naming it; a DOOMED holder is taken over). |
| `flavor` | [CouponFlavor](/types/CouponFlavor/) `CouponFlavor!` | yes | No further notes. |
| `promotionId` | [ID](/types/#scalars) | no | REQUIRED iff trigger: the unlocked Promotion (tenant-scoped + ACTIVE + couponGated — REF_STATE / VALIDATION/INVALID otherwise). |
| `effect` | [CouponEffectInput](/types/CouponEffectInput/) | no | REQUIRED iff discount: the carried effect. |
| `startAt` | [String](/types/#scalars) | no | The window start — omitted ⇒ stamped NOW. |
| `endAt` | [String](/types/#scalars) | no | The window end (half-open) — omitted ⇒ evergreen. |
| `totalUsesCap` | [Int](/types/#scalars) | no | No further notes. |

## Used by

- [createCoupon](/reference/coupon/createCoupon/)
