Skip to main content
PATCH
/
discounts
/
{discount_id}
Update a discount
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    code: 'SPRINGSALE',
    restrict_to: ['pro_01gsz4t5hdjse780zja8vvr7jg', 'pro_01gsz4s0w61y0pp88528f1wvvb']
  })
};

fetch('https://api.paddle.com/discounts/{discount_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "data": {
    "id": "dsc_01hv6scyf7qdnzcdq01t2y8dx4",
    "status": "active",
    "description": "Seasonal sale",
    "enabled_for_checkout": true,
    "code": "SPRINGSALE",
    "type": "percentage",
    "mode": "standard",
    "amount": "10",
    "currency_code": null,
    "recur": true,
    "maximum_recurring_intervals": 3,
    "usage_limit": null,
    "restrict_to": [
      "pro_01gsz4t5hdjse780zja8vvr7jg",
      "pro_01gsz4s0w61y0pp88528f1wvvb"
    ],
    "expires_at": "2024-12-03T00:00:00Z",
    "times_used": 0,
    "custom_data": null,
    "import_meta": null,
    "created_at": "2024-04-11T14:36:14.695Z",
    "updated_at": "2024-04-11T14:41:22.343Z"
  },
  "meta": {
    "request_id": "dd850364-99f7-4e27-bb1e-0a477bdb320b"
  }
}

Authorizations

Authorization
string
header
required

Requests are authenticated with API keys. Provide your API key as a Bearer token in the Authorization header.

API keys are assigned permissions, granting them access to entities and operations. Each endpoint may require one or more permissions, defined with the x-permissions extension. Values for include parameters may require specific permissions as defined in the x-enum-permissions extension. See all available permissions in the permission schema or documentation.

Get an API key and select the permissions you need from the Paddle dashboard under Paddle > Developer Tools > Authentication.

Path Parameters

discount_id
string
required

Paddle ID of the discount entity to work with.

Example:

"dsc_01gt218xfk7yztpvgmcazkes83"

Body

application/json

Represents a discount entity.

status
enum<string>
default:active

Whether this entity can be used in Paddle.

Available options:
active,
archived
description
string

Short description for this discount for your reference. Not shown to customers.

Required string length: 1 - 500
enabled_for_checkout
boolean
default:true

Whether this discount can be redeemed by customers at checkout (true) or not (false).

code
string | null

Unique code that customers can use to redeem this discount at checkout. Not case-sensitive.

Required string length: 1 - 32
type
enum<string>

Type of discount. Determines how this discount impacts the checkout or transaction total.

Available options:
flat,
flat_per_seat,
percentage
mode
enum<string>
default:standard

Discount mode. Standard discounts are considered part of your catalog and are shown in the Paddle dashboard.

Available options:
standard,
custom
amount
string

Amount to discount by. For percentage discounts, must be an amount between 0.01 and 100. For flat and flat_per_seat discounts, amount in the lowest denomination for a currency.

currency_code
enum<string> | null

Supported three-letter ISO 4217 currency code. Required where discount type is flat or flat_per_seat.

Available options:
USD,
EUR,
GBP,
JPY,
AUD,
CAD,
CHF,
HKD,
SGD,
SEK,
ARS,
BRL,
CNY,
COP,
CZK,
DKK,
HUF,
ILS,
INR,
KRW,
MXN,
NOK,
NZD,
PLN,
RUB,
THB,
TRY,
TWD,
UAH,
VND,
ZAR
Required string length: 3
recur
boolean
default:false

Whether this discount applies for multiple subscription billing periods (true) or not (false).

maximum_recurring_intervals
integer | null

Number of subscription billing periods that this discount recurs for. Requires recur. null if this discount recurs forever.

Subscription renewals, midcycle changes, and one-time charges billed to a subscription aren't considered a redemption. times_used is not incremented in these cases.

Required range: x >= 1
usage_limit
integer | null

Maximum number of times this discount can be redeemed. This is an overall limit for this discount, rather than a per-customer limit. null if this discount can be redeemed an unlimited amount of times.

Paddle counts a usage as a redemption on a checkout, transaction, or the initial application against a subscription. Transactions created for subscription renewals, midcycle changes, and one-time charges aren't considered a redemption.

Required range: x >= 1
restrict_to
string[] | null

Product or price IDs that this discount is for. When including a product ID, all prices for that product can be discounted. null if this discount applies to all products and prices.

expires_at
string<date-time> | null

RFC 3339 datetime string of when this discount expires. Discount can no longer be redeemed after this date has elapsed. null if this discount can be redeemed forever.

Expired discounts can't be redeemed against transactions or checkouts, but can be applied when updating subscriptions.

Example:

"2024-10-12T07:20:50.52Z"

custom_data
Custom data · object

Your own structured key-value data.

Example:
{ "customer_reference_id": "abcd1234" }

Response

OK

data
Discount · object
required

Represents a discount entity.

meta
Meta · object
required

Information about this response.