Coupons

Update a coupon

Accepts the same fields as create, all optional. Changing terms is not retroactive: subscribers who already redeemed keep exactly what they paid, and the change applies to redemptions from that point on.

Raising max_redemptions on an exhausted coupon makes it redeemable again. Lowering it below the current count does not claw anything back; the coupon simply reports remaining: 0. Answers 200 with the coupon.

patch/v1/projects/{project}/coupons/{coupon}

Request

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

Path parameters

projectstring uuid required

The project, resolved by the route binder.

couponstring uuid required

The coupon, resolved within the project by the route binder.

Headers

Idempotency-Keystring uuid required

A key unique to this operation, such as a fresh UUID. The same key replays the original 2xx response for 24 hours (with Idempotent-Replay: true), so a retry after a timeout never repeats the write; the same key with a different body is refused with 409.

Request body

codestring

A new code, 3 to 64 letters, numbers and dashes, uppercased before the uniqueness check against the project's other live coupons.

namestring

A new creator-facing label, 3 to 255 characters.

discount_type'percentage' | 'fixed'
discount_valuenumber

Greater than 0; at most 100 when the coupon is, or becomes, a percentage.

currency_idstring nullable

Required when the coupon is, or becomes, fixed and it has no currency yet; refused as meaningless on a percentage coupon.

duration'once'

Accepted for forward compatibility but only once is honoured.

max_redemptionsinteger nullable

The new total cap, 1 to 1,000,000, or null for unlimited. Raising it on an exhausted coupon makes it redeemable again; lowering it below the current count claws nothing back, the coupon simply reports remaining: 0.

max_redemptions_per_userinteger

How many times one member may redeem the code, 1 to 1,000.

minimum_amountnumber nullable

The order floor, in the plan's own currency; greater than 0, or null for none.

starts_atstring date-time nullable

When redemption opens, ISO 8601, or null for immediately.

expires_atstring date-time nullable

When redemption closes, ISO 8601, or null for never.

activeboolean

The on/off switch; prefer the activate and deactivate endpoints, which fire their own events.

plan_idsstring[]

The plans to restrict the code to, at most 200; [] opens it to every plan.

Response

The coupon after the change.

Example response

{
  "data": {
    "id": "4b9d3e08-a1f6-4275-9c83-7e01d6a2f594",
    "project_id": "7f3d1c92-8b45-4e6a-9d21-5c8e0a4b6f13",
    "code": "BLACKFRIDAY",
    "name": "Black Friday 2026",
    "discount": {
      "type": "percentage",
      "value": "25.0000"
    },
    "duration": "once",
    "limits": {
      "max_redemptions": 500,
      "max_redemptions_per_user": 1
    },
    "redemptions": {
      "count": 137,
      "remaining": 363
    },
    "window": {
      "starts_at": "2026-11-27T00:00:00+00:00",
      "expires_at": "2026-12-01T00:00:00+00:00"
    },
    "active": true,
    "redeemable": true,
    "created_at": "2026-11-20T09:14:02+00:00",
    "updated_at": "2026-11-24T16:41:11+00:00"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.