activate_coupon

Switch a coupon code on so subscribers can redeem it again, subject to its own dates and cap. Emits coupon.activated.

Purpose

Turn a coupon back on. Switching on does not override the code's own rules: it still honours its starts_at, expires_at and redemption cap, so an activated code can come back with redeemable: false when it is outside its window or exhausted. Read that field, not active, to tell a subscriber whether the code will work.

This is the counterpart of deactivate_coupon and the narrow alternative to update_coupon with active: true: it announces coupon.activated rather than a generic coupon.updated, so an automation that cares about codes going live does not have to diff payloads to notice.

Entitlement is checked on the way back on

Requires the Coupons Addon or a Growth plan on the project owner. A creator whose tier lost coupons is told why the code stays off with TEAM_TIER_REQUIRED; the code is left as it was.

Re-calling on a code that is already on leaves it unchanged. The event emits on every successful call, so key a consumer on the coupon's state rather than on counting events.

Required ability

project-coupon:update

Input schema

{
  "type": "object",
  "required": ["coupon_id"],
  "properties": {
    "coupon_id": {
      "type": "string",
      "description": "UUID of the coupon to switch on."
    }
  }
}

Output shape

{
  "data": {
    "id": "4b9d3e08-a1f6-4275-9c83-7e01d6a2f594",
    "project_id": "7f3d1c92-8b45-4e6a-9d21-5c8e0a4b6f13",
    "code": "BLACKFRIDAY",
    "name": "Black Friday 2026",
    "discount_type": "percentage",
    "discount_value": "25.0000",
    "currency": null,
    "duration": "once",
    "max_redemptions": 500,
    "max_redemptions_per_user": 1,
    "minimum_amount": null,
    "redemptions": {
      "count": 137,
      "remaining": 363,
      "exhausted": false
    },
    "starts_at": "2026-11-27T00:00:00+00:00",
    "expires_at": "2026-12-01T00:00:00+00:00",
    "plan_ids": [],
    "active": true,
    "redeemable": true,
    "created_at": "2026-11-20T09:14:02+00:00"
  }
}

The full get_coupon row, with active: true. redeemable is the field that says whether the code will apply at checkout right now.

Example prompts

"Switch coupon 4b9d3e08-a1f6-4275-9c83-7e01d6a2f594 back on."

"Re-enable the BLACKFRIDAY code — the sale is live again."

"Turn the WELCOME10 code on and tell me whether it's actually redeemable now."

Failure modes

  • TEAM_TIER_REQUIRED — the project owner's tier no longer includes coupons. error.context.reason says what lapsed.
  • VALIDATION_FAILED — the caller is a team member whose role lacks the team's coupon-update permission. error.context.coupon carries the refusal.
  • RESOURCE_NOT_FOUND — unknown coupon_id, a coupon on another team's project, one outside the token's scope:project: allow-list, or a coupon that has been deleted.
  • AUTHENTICATION_REQUIRED — no authenticated user on the request.
  • TOKEN_MISSING_ABILITY — token lacks project-coupon:update.

How is this guide?

On this page

Subscriby is a product designed by you — for you.

No boardroom full of executives deciding what we ships next. Our roadmap always shaped by you with your feedback.

Share feedback or a request