Change Discount
Intent
Applies the supplied changes to the discount.
When to call it
Call this when the discount already exists and its stored values need to change.
Access boundary
Authorize the request with a token that carries discounts:write.
Successful result
A successful request returns 200. The response schema below defines the body your integration receives.
Authorizations
Path Parameters
Identifier of the discount.
Body
Schema used to update a discount.
Metadata map for information your integration needs to retain.
The key must be a string with a maximum length of 40 characters. The value must be either:
- A string with a maximum length of 500 characters
- An integer
- A floating-point number
- A boolean
You can store up to 50 key-value pairs.
Name: Name of the discount. Will be displayed to the customer when the discount is applied.
1Code: Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API.
Starts At: Optional timestamp after which the discount is redeemable.
Ends At: Optional timestamp after which the discount is no longer redeemable.
Max Redemptions: Optional maximum number of times the discount can be redeemed.
1 <= x <= 2147483647once, forever, repeating Number of months the discount should be applied.
For this to work on yearly pricing, you should multiply this by 12. For example, to apply the discount for 2 years, set this to 24.
1 <= x <= 999fixed, percentage Amount: Fixed amount to discount from the invoice total.
0 <= x <= 999999999999Currency: Currency of the fixed amount discount.
aed, all, amd, aoa, ars, aud, awg, azn, bam, bbd, bdt, bif, bmd, bnd, bob, brl, bsd, bwp, bzd, cad, cdf, chf, clp, cny, cop, crc, cve, czk, djf, dkk, dop, dzd, egp, etb, eur, fjd, fkp, gbp, gel, gip, gmd, gnf, gtq, gyd, hkd, hnl, htg, huf, idr, ils, inr, isk, jmd, jpy, kes, kgs, khr, kmf, krw, kyd, kzt, lak, lkr, lrd, lsl, mad, mdl, mga, mkd, mnt, mop, mur, mvr, mwk, mxn, myr, mzn, nad, ngn, nio, nok, npr, nzd, pab, pen, pgk, php, pkr, pln, pyg, qar, ron, rsd, rwf, sar, sbd, scr, sek, sgd, shp, sos, srd, szl, thb, tjs, top, try, ttd, twd, tzs, uah, ugx, usd, uyu, uzs, vnd, vuv, wst, xaf, xcd, xcg, xof, xpf, yer, zar, zmw Amounts: Map of currency to fixed amount to discount from the total. This allows specifying different discount amounts for different currencies.
Discount percentage in basis points.
A basis point is 1/100th of a percent. For example, to create a 25.5% discount, set this to 2550.
1 <= x <= 10000Collection of product IDs the discount can be applied to.
Response
Response: Discount updated.
- DiscountFixedOnceForeverDuration
- DiscountFixedRepeatDuration
- DiscountPercentageOnceForeverDuration
- DiscountPercentageRepeatDuration
Schema for a fixed amount discount that is applied once or forever.
once, forever, repeating fixed, percentage 1000
"usd"
Amounts: Map of currency to fixed amount to discount from the total.
The time Ruba created this record.
The time this record last changed.
The stable identifier for this record.
Name: Name of the discount. Will be displayed to the customer when the discount is applied.
Code: Code customers can use to apply the discount during checkout.
Starts At: Timestamp after which the discount is redeemable.
Ends At: Timestamp after which the discount is no longer redeemable.
Max Redemptions: Maximum number of times the discount can be redeemed.
Count of times the discount has been redeemed.
Identifier of the organization.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"