Skip to content

Discount a plan for everyone new

POST
/console/plans/{plan}/discount
curl --request POST \
--url https://example.com/console/plans/starter/discount \
--header 'Content-Type: application/json' \
--cookie bottle.session_token=<bottle.session_token> \
--data '{ "percentOff": 1, "months": 1, "reason": "example" }'

Makes a Stripe coupon and puts it on every new checkout for the plan, for the months given or for as long as they pay. Nobody already paying is changed by this: that is a discount for one business.

plan
required
string
Allowed values: starter round
Media typeapplication/json
object
percentOff
required
integer
>= 1 <= 100
months
required
integer | null
>= 1 <= 120
reason
required
string
>= 3 characters <= 500 characters
Examplegenerated
{
"percentOff": 1,
"months": 1,
"reason": "example"
}

The plan afterwards

Media typeapplication/json
object
plan
required
string
Allowed values: starter round depot
monthlyPence
required
integer | null
stripePriceId
required
string | null
discount
required
object
percentOff
required
integer
>= 1 <= 100
months
required
integer | null
> 0
setAt
required
string | null format: date-time
setByName
required
string | null
Example
{
"plan": "starter"
}

Not signed in

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

Not Bottle staff, no two-step sign-in, or a console role too low for this

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

The plan has no price set from the console to carry a discount

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}

Validation failed

Media typeapplication/json
object
error
required
string
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}

Billing is not configured on this deployment

Media typeapplication/json
object
error
required
string
message
required
string
Example
{
"error": "not_found",
"message": "Customer not found"
}