RCUR

Discount codes

Update discount code

put https://rcur.app/api/v2/discounts/{id}

Customers who already use the code keep the discount they got.

Requires your API key as Authorization: Bearer <key>. See authentication.

Path parameters

  • id string required

Request body

application/json

Discount code data to update; fields left out keep their value

  • code string

    Letters, digits, - and _; stored in capitals

  • name string

    Internal name

  • type string

    One of percentage fixed

  • value number

    A percentage (at most 100) or an amount

  • currency string

    Required for a fixed amount

  • duration string

    One of once repeating forever

  • duration_periods integer

    Required for repeating

  • all_links boolean

    Default true

  • links array of strings

    Payment link ids, required when all_links is false

  • max_redemptions integer
  • once_per_customer boolean
  • starts_at string
  • expires_at string
  • is_active boolean

    Default true

Responses

200 Discount code details Discount object
  • id string required
  • code string required
  • name string nullable
  • type string required

    One of percentage fixed

  • value string required

    A percentage, or an amount in the currency of the code

  • currency string nullable

    Only for a fixed amount

  • duration string required

    How many payments of a subscription get the discount: the first, the first duration_periods, or every payment

    One of once repeating forever

  • duration_periods integer nullable
  • all_links boolean required

    Valid for every payment link, or only for the links in links

  • links array of strings

    Ids of the payment links the code is limited to

  • max_redemptions integer nullable

    How often the code can be used in total, by all customers together

  • times_redeemed integer
  • once_per_customer boolean
  • starts_at string nullable
  • expires_at string nullable
  • is_active boolean required
  • status string required

    One of active inactive scheduled expired used_up

  • created_at string required
404 Resource not found Error object
  • status integer required
  • error string required
422 Validation error ValidationError object
  • status integer required
  • error string required
  • fields object
Try it Send this request with your own API key

Requests run against the live data of the organization that owns the key. This PUT request changes that data.