Create Discount
Create a discount.
Scopes: discounts:write
Authorizations
You can generate an Organization Access Token from your organization's settings.
Body
Schema to create a fixed amount discount that is applied once or forever.
once
, forever
, repeating
Type of the discount.
fixed
, percentage
Fixed amount to discount from the invoice total.
x >= 0
Name of the discount. Will be displayed to the customer when the discount is applied.
1
The currency. Currently, only usd
is supported.
Key-value object allowing you to store additional information.
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.
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.
Optional timestamp after which the discount is redeemable.
Optional timestamp after which the discount is no longer redeemable.
Optional maximum number of times the discount can be redeemed.
x >= 1
List of product IDs the discount can be applied to.
The ID of the organization owning the discount. Required unless you use an organization token. The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Schema to create a fixed amount discount that is applied once or forever.
once
, forever
, repeating
Type of the discount.
fixed
, percentage
Fixed amount to discount from the invoice total.
x >= 0
Name of the discount. Will be displayed to the customer when the discount is applied.
1
The currency. Currently, only usd
is supported.
Key-value object allowing you to store additional information.
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.
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.
Optional timestamp after which the discount is redeemable.
Optional timestamp after which the discount is no longer redeemable.
Optional maximum number of times the discount can be redeemed.
x >= 1
List of product IDs the discount can be applied to.
The ID of the organization owning the discount. Required unless you use an organization token. The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Schema to create a fixed amount discount that is applied on every invoice for a certain number of months.
once
, 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.
x >= 1
Type of the discount.
fixed
, percentage
Fixed amount to discount from the invoice total.
x >= 0
Name of the discount. Will be displayed to the customer when the discount is applied.
1
The currency. Currently, only usd
is supported.
Key-value object allowing you to store additional information.
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.
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.
Optional timestamp after which the discount is redeemable.
Optional timestamp after which the discount is no longer redeemable.
Optional maximum number of times the discount can be redeemed.
x >= 1
List of product IDs the discount can be applied to.
The ID of the organization owning the discount. Required unless you use an organization token. The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Schema to create a percentage discount that is applied once or forever.
once
, forever
, repeating
Type of the discount.
fixed
, percentage
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 <= 10000
Name of the discount. Will be displayed to the customer when the discount is applied.
1
Key-value object allowing you to store additional information.
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.
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.
Optional timestamp after which the discount is redeemable.
Optional timestamp after which the discount is no longer redeemable.
Optional maximum number of times the discount can be redeemed.
x >= 1
List of product IDs the discount can be applied to.
The ID of the organization owning the discount. Required unless you use an organization token. The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Schema to create a percentage discount that is applied on every invoice for a certain number of months.
once
, 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.
x >= 1
Type of the discount.
fixed
, percentage
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 <= 10000
Name of the discount. Will be displayed to the customer when the discount is applied.
1
Key-value object allowing you to store additional information.
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.
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.
Optional timestamp after which the discount is redeemable.
Optional timestamp after which the discount is no longer redeemable.
Optional maximum number of times the discount can be redeemed.
x >= 1
List of product IDs the discount can be applied to.
The ID of the organization owning the discount. Required unless you use an organization token. The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Response
Discount created.
Schema for a fixed amount discount that is applied once or forever.
once
, forever
, repeating
fixed
, percentage
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Name of the discount. Will be displayed to the customer when the discount is applied.
Code customers can use to apply the discount during checkout.
Timestamp after which the discount is redeemable.
Timestamp after which the discount is no longer redeemable.
Maximum number of times the discount can be redeemed.
Number of times the discount has been redeemed.
The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Schema for a fixed amount discount that is applied once or forever.
once
, forever
, repeating
fixed
, percentage
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Name of the discount. Will be displayed to the customer when the discount is applied.
Code customers can use to apply the discount during checkout.
Timestamp after which the discount is redeemable.
Timestamp after which the discount is no longer redeemable.
Maximum number of times the discount can be redeemed.
Number of times the discount has been redeemed.
The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Schema for a fixed amount discount that is applied on every invoice for a certain number of months.
once
, forever
, repeating
fixed
, percentage
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Name of the discount. Will be displayed to the customer when the discount is applied.
Code customers can use to apply the discount during checkout.
Timestamp after which the discount is redeemable.
Timestamp after which the discount is no longer redeemable.
Maximum number of times the discount can be redeemed.
Number of times the discount has been redeemed.
The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Schema for a percentage discount that is applied once or forever.
once
, forever
, repeating
fixed
, percentage
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Name of the discount. Will be displayed to the customer when the discount is applied.
Code customers can use to apply the discount during checkout.
Timestamp after which the discount is redeemable.
Timestamp after which the discount is no longer redeemable.
Maximum number of times the discount can be redeemed.
Number of times the discount has been redeemed.
The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Schema for a percentage discount that is applied on every invoice for a certain number of months.
once
, forever
, repeating
fixed
, percentage
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the object.
Name of the discount. Will be displayed to the customer when the discount is applied.
Code customers can use to apply the discount during checkout.
Timestamp after which the discount is redeemable.
Timestamp after which the discount is no longer redeemable.
Maximum number of times the discount can be redeemed.
Number of times the discount has been redeemed.
The organization ID.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"