Give one business a discount
POST
/console/businesses/{id}/discount
const url = 'https://example.com/console/businesses/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/discount';const options = { method: 'POST', headers: { cookie: 'bottle.session_token=<bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"percentOff":1,"months":1,"reason":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/console/businesses/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/discount \ --header 'Content-Type: application/json' \ --cookie bottle.session_token=<bottle.session_token> \ --data '{ "percentOff": 1, "months": 1, "reason": "example" }'Makes a Stripe coupon for this business alone. Put on their subscription now when they are paying, from the next invoice; remembered and put on their checkout when they are still on trial. A newer discount replaces the last.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
percentOff
required
integer
months
required
integer | null
reason
required
string
Examplegenerated
{ "percentOff": 1, "months": 1, "reason": "example"}Responses
Section titled “Responses”The business afterwards
Media typeapplication/json
object
id
required
UUID v7
string format: uuid
name
required
string
slug
required
string
createdAt
required
string format: date-time
subscription
required
object
plan
required
string
status
required
string
inGoodStanding
required
boolean
manageable
required
boolean
trialEndsAt
required
string | null format: date-time
currentPeriodEnd
required
string | null format: date-time
cancelAt
required
string | null format: date-time
pendingPlan
required
string | null
pendingPlanAt
required
string | null format: date-time
rateLimits
required
object
requestsPerMinute
required
integer
heavyPerMinute
required
integer
discount
required
object
percentOff
required
integer
until
required
string | null format: date-time
customPrice
required
object
monthlyPence
required
integer
from
required
string | null format: date-time
vehiclesUsed
required
integer
limits
required
object
requestsPerMinute
required
integer
heavyPerMinute
required
integer
vehicleLimit
required
integer | null
vehicles
required
integer
members
required
integer
people
required
Array<object>
object
userId
required
string
name
required
string
email
required
string
role
required
Owner: billing, deleting the tenant, full control of members. admin: all operational work and may manage drivers and admins. driver: their own round only.
string
supportAccess
required
object
level
required
string
until
required
string | null format: date-time
setByName
required
string | null
lockedAt
required
string | null format: date-time
lockedReason
required
string | null
Example
{ "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "subscription": { "plan": "starter", "status": "trialing", "pendingPlan": "starter" }, "people": [ { "role": "owner" } ], "supportAccess": { "level": "none" }}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"}Not found
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
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"}