curl --request POST \
--url https://api.withorb.com/v1/coupons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"redemption_code": "HALFOFF",
"discount": {
"discount_type": "percentage",
"percentage_discount": 123
},
"duration_in_months": 12,
"max_redemptions": 500000000
}'
{
"id": "7iz2yanVjQoBZhyH",
"redemption_code": "HALFOFF",
"discount": {
"discount_type": "percentage",
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"field": "price_id",
"operator": "includes",
"values": [
"<string>"
]
}
],
"reason": "<string>",
"percentage_discount": 0.15
},
"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": "HALFOFF",
"discount": {
"discount_type": "percentage",
"percentage_discount": 123
},
"duration_in_months": 12,
"max_redemptions": 500000000
}'
{
"id": "7iz2yanVjQoBZhyH",
"redemption_code": "HALFOFF",
"discount": {
"discount_type": "percentage",
"applies_to_price_ids": [
"h74gfhdjvn7ujokd",
"7hfgtgjnbvc3ujkl"
],
"filters": [
{
"field": "price_id",
"operator": "includes",
"values": [
"<string>"
]
}
],
"reason": "<string>",
"percentage_discount": 0.15
},
"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.
Created
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.
Was this page helpful?