Documentation · API reference
POST
/api/v1/billing/checkoutStart paying for a plan
This page as Markdown, or in an AI chatMore ways to read this page
Start paying for a plan: answers with the provider's page to go to.
# Start paying for a plan
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-billing-checkout
`POST /api/v1/billing/checkout`
Start paying for a plan: answers with the provider's page to go to.
## What to send
`PlanChoice`
- `plan` (string, needed)
- `yearly` (boolean): Paid by the year, where a provider takes payment.
## The answer
200, `Away`: A page of the payment provider's to go to.
- `url` (string, needed)
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/billing/checkout \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"plan": "…"}'
```
What to send
PlanChoice
- plan
- stringneeded
- yearly
- booleanPaid by the year, where a provider takes payment.
The answer
Status 200
Away A page of the payment provider's to go to.
- url
- stringneeded
Asking
curl -X POST https://tidekeeper.eu/api/v1/billing/checkout \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"plan": "…"}'
const answer = await fetch("https://tidekeeper.eu/api/v1/billing/checkout", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({"plan": "…"}), }).then((r) => r.json());