Documentation

Subscriptions

Plans live in the Console under Subscriptions. People see every app they are connected to in their Bookmer ID account, and can cancel, extend, reactivate, or switch a plan there. Stripe is optional and belongs to the app, not to Bookmer.

1. Define a plan

Each plan has a title, an interval, prices, and an API key (slug). If Stripe is connected, set the Stripe price id on the plan. Bookmer ID uses that price for checkout and plan changes.

2. Optional Stripe

In Console → Subscriptions, turn on Stripe and save the publishable key, secret key, and webhook secret. Point a Stripe webhook at the endpoint shown there. Events: checkout.session.completed, customer.subscription.updated, customer.subscription.deleted, invoice.paid.

3. Backend API

Basic auth, client_id must match appId.

POST /api/applications/:appId/subscriptions
Authorization: Basic base64(client_id:client_secret)

{
  "globalId": "AB1234",
  "plan": "pro-monthly",
  "action": "grant"
}

action is grant, cancel, reactivate, extend, or switch.extend and switch accept an optional periodEnd when Stripe is off. Read one holder with GET /api/applications/:appId/subscriptions/:globalId and the list with GET /api/applications/:appId/subscriptions.

When a subscription changes, Bookmer ID posts subscription_updated to the app webhook URL.