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

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# Code promo

> Un code promo applique une remise à un plan lors du checkout. Les codes promo peuvent être en pourcentage ou à montant fixe, et peuvent avoir des limites d'utilisation et des dates d'expiration.

> [!NOTE]
>
> Cette ressource a un successeur dans l'[API Whop](https://docs.whop.com/fr/api-reference/legacy/promo-codes/list-promo-codes.md), l'API versionnée sur laquelle les nouvelles intégrations doivent s'appuyer. Cette page reste entièrement prise en charge.

```json Example theme={null}
{
	"amount_off": 6.9,
	"churned_users_only": true,
	"code": "<string>",
	"company": {
		"id": "biz_xxxxxxxxxxxxxx",
		"title": "<string>"
	},
	"created_at": "2023-12-01T05:00:00.401Z",
	"currency": "usd",
	"duration": "forever",
	"existing_memberships_only": true,
	"expires_at": "2023-12-01T05:00:00.401Z",
	"id": "promo_xxxxxxxxxxxx",
	"new_users_only": true,
	"one_per_customer": true,
	"product": {
		"id": "prod_xxxxxxxxxxxxx",
		"title": "Pickaxe Analytics"
	},
	"promo_duration_months": 42,
	"promo_type": "percentage",
	"status": "active",
	"stock": 42,
	"unlimited_stock": true,
	"uses": 42
}
```

**amount\_off** `number` *required*

Le montant de la remise. L'interprétation dépend de promo\_type : si 'percentage', il s'agit du pourcentage (par ex. 20 signifie 20 % de réduction) ; si 'flat\_amount', il s'agit d'une réduction en dollars (par ex. 10.00 signifie 10,00 \$ de réduction).

Exemple : `6.9`

**churned\_users\_only** `boolean` *required*

Limite l'utilisation de la promotion aux seuls utilisateurs ayant déjà résilié auprès de l'entreprise.

**code** `string | null` *required*

Le code spécifique utilisé pour appliquer la promotion lors du checkout.

**company** `object` *required*

L'entreprise associée au code promo.

**attributs enfants**

**id** `string` *required*

L'identifiant unique de l'entreprise.

Exemple : `biz_xxxxxxxxxxxxxx`

**title** `string` *required*

Le nom écrit de l'entreprise.

**created\_at** `string\<date-time\>` *required*

La date et l'heure de création du code promo.

Exemple : `2023-12-01T05:00:00.401Z`

**currency** `Currencies` *required*

La devise monétaire du code promo.

Options disponibles : `usd`, `sgd`, `inr`, `aud`, `brl`, `cad`, `dkk`, `eur`, `nok`, `gbp`, `sek`, `chf`, `hkd`, `huf`, `jpy`, `mxn`, `myr`, `pln`, `czk`, `nzd`, `aed`, `eth`, `ape`, `cop`, `ron`, `thb`, `bgn`, `idr`, `dop`, `php`, `try`, `krw`, `twd`, `vnd`, `pkr`, `clp`, `uyu`, `ars`, `zar`, `dzd`, `tnd`, `mad`, `kes`, `kwd`, `jod`, `all`, `xcd`, `amd`, `bsd`, `bhd`, `bob`, `bam`, `khr`, `crc`, `xof`, `egp`, `etb`, `gmd`, `ghs`, `gtq`, `gyd`, `ils`, `jmd`, `mop`, `mga`, `mur`, `mdl`, `mnt`, `nad`, `ngn`, `mkd`, `omr`, `pyg`, `pen`, `qar`, `rwf`, `sar`, `rsd`, `lkr`, `tzs`, `ttd`, `uzs`, `rub`, `btc`, `cny`, `usdt`, `kzt`, `awg`, `whop_usd`, `xau`, `hnl`

**duration** `PromoDurations | null` *required*

La durée de la promotion.

Options disponibles : `forever`, `once`, `repeating`

**existing\_memberships\_only** `boolean` *required*

Limite l'application de la promotion aux seuls abonnements déjà achetés.

**expires\_at** `string\<date-time\> | null` *required*

La date/l'heure d'expiration de la promotion.

Exemple : `2023-12-01T05:00:00.401Z`

**id** `string` *required*

L'identifiant unique du code promo.

Exemple : `promo_xxxxxxxxxxxx`

**new\_users\_only** `boolean` *required*

Limite l'utilisation de la promotion aux seuls utilisateurs n'ayant jamais acheté auprès de l'entreprise.

**one\_per\_customer** `boolean` *required*

Limite l'application de la promotion à une seule fois par client.

**product** `object | null` *required*

Le produit auquel s'applique ce code promo

**attributs enfants**

**id** `string` *required*

L'identifiant unique du produit.

Exemple : `prod_xxxxxxxxxxxxx`

**title** `string` *required*

Le nom d'affichage du produit présenté aux clients sur la page produit et dans les résultats de recherche.

Exemple : `Pickaxe Analytics`

**promo\_duration\_months** `integer | null` *required*

Le nombre de mois pendant lesquels la promotion est appliquée.

Exemple : `42`

**promo\_type** `PromoTypes` *required*

Le type (% ou montant fixe) de la promotion.

Options disponibles : `percentage`, `flat_amount`

**status** `PromoCodeStatus` *required*

Indique si le code promo est actif ou désactivé.

Options disponibles : `active`, `inactive`, `archived`

**stock** `integer` *required*

La limite de quantité sur le nombre d'utilisations.

Exemple : `42`

**unlimited\_stock** `boolean` *required*

Indique si le code promo dispose ou non d'un stock illimité.

**uses** `integer` *required*

Le nombre de fois où le code promo a été utilisé.

Exemple : `42`
