curl --request POST \
--url https://api.withorb.com/v1/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redemption_code": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 123
},
"duration_in_months": 12,
"max_redemptions": 500000000
}
'{
"id": "<string>",
"redemption_code": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"field": "price_id",
"operator": "includes",
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"times_redeemed": 123,
"duration_in_months": 12,
"max_redemptions": 123,
"archived_at": "2023-11-07T05:31:56Z"
}This endpoint allows the creation of coupons, which can then be redeemed at subscription creation or plan change.
curl --request POST \
--url https://api.withorb.com/v1/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redemption_code": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 123
},
"duration_in_months": 12,
"max_redemptions": 500000000
}
'{
"id": "<string>",
"redemption_code": "<string>",
"discount": {
"discount_type": "percentage",
"percentage_discount": 0.5,
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"field": "price_id",
"operator": "includes",
"values": [
"<string>"
]
}
],
"reason": "<string>"
},
"times_redeemed": 123,
"duration_in_months": 12,
"max_redemptions": 123,
"archived_at": "2023-11-07T05:31:56Z"
}API Keys can be issued in the Orb's web application.
This string can be used to redeem this coupon for a given subscription.
"HALFOFF"
Show child attributes
This allows for a coupon's discount to apply for a limited time (determined in months); a null value here means "unlimited time".
1 <= x <= 12012
The maximum number of redemptions allowed for this coupon before it is exhausted;null here means "unlimited".
1 <= x <= 1000000000Created
A coupon represents a reusable discount configuration that can be applied either as a fixed or percentage amount to an invoice or subscription. Coupons are activated using a redemption code, which applies the discount to a subscription or invoice. The duration of a coupon determines how long it remains available for use by end users.
Also referred to as coupon_id in this documentation.
"7iz2yanVjQoBZhyH"
This string can be used to redeem this coupon for a given subscription.
"HALFOFF"
Show child attributes
The number of times this coupon has been redeemed.
This allows for a coupon's discount to apply for a limited time (determined in months); a null value here means "unlimited time".
12
The maximum number of redemptions allowed for this coupon before it is exhausted; null here means "unlimited".
An archived coupon can no longer be redeemed. Active coupons will have a value of null for archived_at; this field will be non-null for archived coupons.
Was this page helpful?