Documentation · API reference
POST
/api/v1/billing/providerFor a payment provider's relay
This page as Markdown, or in an AI chatMore ways to read this page
For a payment provider's relay: an account's plan as it now is, signed. `x-tidekeeper-signature` is the HMAC-SHA256 of the body in hex.
# For a payment provider's relay
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-billing-provider
`POST /api/v1/billing/provider`
For a payment provider's relay: an account's plan as it now is, signed. `x-tidekeeper-signature` is the HMAC-SHA256 of the body in hex.
## What to send
`PlanEvent`: What a payment provider's relay tells tidekeeper: an account's plan as it now is. Signed with the deployment's secret.
- `account` (string, needed)
- `cancelled` (integer or null)
- `plan` (string, needed)
- `renews` (integer or null)
## The answer
204
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/billing/provider \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"account": "…", "plan": "…"}'
```
What to send
PlanEvent What a payment provider's relay tells tidekeeper: an account's plan as it now is. Signed with the deployment's secret.
- account
- stringneeded
- cancelled
- integer or null
- plan
- stringneeded
- renews
- integer or null
The answer
Status 204
Asking
curl -X POST https://tidekeeper.eu/api/v1/billing/provider \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"account": "…", "plan": "…"}'
const answer = await fetch("https://tidekeeper.eu/api/v1/billing/provider", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({"account": "…", "plan": "…"}), }).then((r) => r.json());