Discounts
Update a discount
Updates a discount.
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Path Parameters
id*string
Request Body
application/json
Discount payload
name?string
Name of the discount.
type?string
Type of discount.
Value in
"percentage" | "fixed_amount"description?string|null
Description of the discount.
percent_off?number|null
Percentage off. Required when type is percentage.
Range
0 <= value <= 100currency?string|null
Currency. Required when type is fixed_amount.
Match
^[A-Z]{3}$amount_off?integer|null
Amount off in currency subunits. Required when type is fixed_amount.
Range
0 <= valuerecurring?boolean
Whether discount can be applied to multiple billing periods.
max_recurring_intervals?integer|null
Maximum number of billing periods discount can recur (null = forever).
Range
1 <= valuemax_redemptions?integer|null
Maximum number of redemptions across all accounts.
Range
1 <= valuemax_redemptions_per_account?integer|null
Maximum number of redemptions per account.
Range
1 <= valuevalid_from?string|null
Date when the discount becomes valid.
Format
date-timevalid_until?string|null
Date when the discount expires.
Format
date-timemetadata?|null
Additional data related to the discount.
Response Body
application/json
curl -X PUT "https://api.sandbox.billingrails.com/v1/discounts/disc_IhMUl3rrZ3" \ -H "Content-Type: application/json" \ -d '{ "name": "Spring Sale Updated" }'{
"discount": {
"type": "percentage",
"object": "discount",
"id": "disc_IhMUl3rrZ3",
"account_id": null,
"status": "active",
"name": "Spring Sale",
"code": "SPRING2024",
"description": "15% off for spring season.",
"percent_off": 15,
"created_at": "2024-02-14T17:33:40.843Z"
},
"meta": {
"request_id": "req_IhMUl3rrZ3"
}
}