Skip to main content
PATCH
/
v1
/
discounts
/
{id}
Update discount
curl --request PATCH \
  --url https://api.quentli.com/v1/discounts/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Buen Fin 25%",
  "description": null,
  "codes": [
    "BUEN-FIN-2025"
  ],
  "type": "PERCENTAGE",
  "amountOff": null,
  "percentageOff": 25,
  "active": true,
  "oneOff": false,
  "expiresAt": null,
  "maxApplications": null
}
'
{
  "discount": {
    "id": "disc_1234567890abcdefghij",
    "createdAt": "2025-01-01T00:00:00.000Z",
    "updatedAt": "2025-01-01T00:00:00.000Z",
    "name": "Buen Fin 20%",
    "organizationId": "org_1234567890abcdefghij",
    "type": "PERCENTAGE",
    "active": true,
    "oneOff": false,
    "deletedAt": null,
    "description": null,
    "amountOff": 30000,
    "percentageOff": 20,
    "expiresAt": null,
    "maxApplications": 3
  }
}

Authorizations

Authorization
string
header
required

Organization API key using Authorization: Bearer sk_....

Path Parameters

id
string
required

Identifier of the discount.

Body

application/json

Request body for updating a discount. All fields are optional.

name
string

Display name of the discount.

Minimum string length: 1
Example:

"Buen Fin 25%"

description
string | null

Optional description.

Example:

null

codes
string[]

Replaces all existing codes with this list. Codes are uppercased automatically.

Required string length: 1 - 140
Example:
["BUEN-FIN-2025"]
type
enum<string>

Whether the discount is a fixed amount (FIXED) or a percentage (PERCENTAGE).

Available options:
FIXED,
PERCENTAGE
Example:

"PERCENTAGE"

amountOff
integer | null

Fixed discount amount in minor currency units. Required when type is FIXED.

Required range: 0 <= x <= 99999999999
Example:

null

percentageOff
number | null

Percentage to discount (0-100). Required when type is PERCENTAGE.

Required range: 0 <= x <= 100
Example:

25

active
boolean

Whether the discount is active.

Example:

true

oneOff
boolean

Whether this discount is single-use.

Example:

false

expiresAt
string<date-time> | null

Optional expiration date.

Example:

null

maxApplications
integer | null

Maximum number of times this discount can be applied.

Required range: x >= 1
Example:

null

Response

Discount updated

Updated discount.

discount
object
required

A reusable discount that can be applied to invoices or subscriptions.