---
title: "Activate a coupon"
method: POST
path: "/v1/projects/{project}/coupons/{coupon}/activate"
tags: ["Coupons"]
---

# Activate a coupon

`POST /v1/projects/{project}/coupons/{coupon}/activate`

## Request

- Base URL: `https://api.subscriby.net`
- URL: `https://api.subscriby.net/v1/projects/{project}/coupons/{coupon}/activate`
- Auth: HTTP bearer

Switches the code on so new redemptions are accepted again, within its window and cap. Emits `coupon.activated` rather than `coupon.updated`, so an automation watching availability has one event to subscribe to. Answers `200` with the coupon.

## Path parameters

- `project` string, uuid, required
- `coupon` string, uuid, required

## Headers

- `Idempotency-Key` string, uuid, required

## Response `200`

The coupon after the change.

- object
  - `data` CouponResource, required: A coupon: one code many subscribers can redeem for money off at checkout, with its discount, limits, redemption tally and sales window.
    - `id` string, required: The coupon's id.
    - `project_id` string, required: The project the coupon belongs to; codes are unique within a project, not across projects.
    - `code` string, required: The code subscribers type at checkout, stored and matched in upper case.
    - `name` string, required: A creator-facing label, never shown to subscribers.
    - `discount` object, required: What comes off the price.
      - `type` string, required: `percentage` or `fixed`.
      - `value` string, required: A decimal string with four places: `"25.0000"` for 25% off, `"10.0000"` for ten of the coupon's currency. Parse it as a decimal, never a float.
      - `currency_id` string, nullable, required: The currency a `fixed` discount is denominated in; null on a `percentage` coupon, which applies to a plan in any currency.
      - `currency` string, nullable: That currency's ISO 4217 code, present only when the relation is loaded: on a single read, a create and an update, not on every list row.
    - `duration` string, required: Always `once`: only first-payment discounts exist today.
    - `limits` object, required: How often and on what the code may be used.
      - `max_redemptions` integer, nullable, required: The total cap across everyone; null for unlimited.
      - `max_redemptions_per_user` integer, required: How many times one member may redeem the code.
      - `minimum_amount` string, nullable, required: The order floor, in the plan's own currency; null for none.
    - `redemptions` object, required: How far the cap has been used.
      - `count` integer, required: Settled redemptions so far.
      - `remaining` integer, nullable, required: Derived, not stored: the cap minus settled redemptions and reservations whose hold has not expired, so an in-flight checkout is already counted and an abandoned one gives its slot back. Prefer it over your own subtraction, which will disagree. Null when uncapped.
      - `exhausted` boolean, required: Whether nothing remains under the cap.
    - `window` object, required: When the code can be redeemed.
      - `starts_at` string, nullable, required: When redemption opens, ISO 8601; null for immediately.
      - `expires_at` string, nullable, required: When redemption closes, ISO 8601; null for never.
    - `plan_ids` object, required: The plans the code is restricted to. An empty array means **every** plan in the project, including plans added later, not no plans.
    - `active` boolean, required: The creator's on/off switch. Not the same as redeemable.
    - `redeemable` boolean, required: The combined answer: switched on, inside its window, not exhausted. Read this rather than `active` to know whether the code applies right now.
    - `created_at` string, nullable, required: When the coupon was created, ISO 8601.
    - `updated_at` string, nullable, required: When it last changed, ISO 8601.

## Other responses

- `400`: `IDEMPOTENCY_KEY_MISSING`: every write needs an `Idempotency-Key` header. Send a fresh UUID per distinct operation.
- `401`: `AUTHENTICATION_REQUIRED`: the request carries no bearer token, or one that is revoked, malformed, or minted for another environment (an `sbt_test_` token on production).
- `403`: `TOKEN_MISSING_ABILITY`: the token is valid but does not carry the ability this endpoint requires; `error.context.required_ability` names the one to grant. An endpoint that also checks who owns a row or which tier the account is on answers `FORBIDDEN`, `TEAM_TIER_REQUIRED` or `CONNECTOR_TIER_REQUIRED` with the same status, and says so in its own description. On this endpoint: `TEAM_TIER_REQUIRED`: when the creator has neither the Coupons Addon nor a Growth plan.
- `404`: `RESOURCE_NOT_FOUND`: an id in the path names nothing the token can see. `TENANT_MISMATCH`: the project sits outside the token's `scope:project:` allow-list, or the token carries no team scope. Both answer 404 rather than 403 so that existence outside the token's scope cannot be inferred.
- `409`: `IDEMPOTENCY_KEY_REUSED`: the key was already used in the last 24 hours with a different request body.
- `425`: `IDEMPOTENCY_REPLAY_IN_PROGRESS`: the first request with this key is still running; retry in a few seconds and the original response is replayed.
- `429`: `RATE_LIMITED`: the token has spent its 300 requests a minute or 10,000 an hour; `Retry-After` says when the next one is accepted.

---

[API](https://skmtc.dev/memberpass/apis/subscriby-rest-api.md) · [All operations](https://skmtc.dev/memberpass/apis/subscriby-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/memberpass/apis/subscriby-rest-api/revisions/59c4df91d764?raw)
