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
}
}Updates editable fields of an existing discount by id.
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
}
}Organization API key using Authorization: Bearer sk_....
Identifier of the discount.
Request body for updating a discount. All fields are optional.
Display name of the discount.
1"Buen Fin 25%"
Optional description.
null
Replaces all existing codes with this list. Codes are uppercased automatically.
1 - 140["BUEN-FIN-2025"]Whether the discount is a fixed amount (FIXED) or a percentage (PERCENTAGE).
FIXED, PERCENTAGE "PERCENTAGE"
Fixed discount amount in minor currency units. Required when type is FIXED.
0 <= x <= 99999999999null
Percentage to discount (0-100). Required when type is PERCENTAGE.
0 <= x <= 10025
Whether the discount is active.
true
Whether this discount is single-use.
false
Optional expiration date.
null
Maximum number of times this discount can be applied.
x >= 1null
Discount updated
Updated discount.
A reusable discount that can be applied to invoices or subscriptions.
Show child attributes
Was this page helpful?