Add a charge to a plan
A plan holds one or more charges (“Platform fee”, “BVN”, “SMS”),
each with its own prices (create them with chargeId). A
subscription takes every active charge of its plan, one price each,
in one way to pay, and its invoices show one line per charge.
Every plan is created with one unnamed charge. Adding a second names
the first in the same call (firstChargeName), so the two read apart.
Subscriptions made before keep what they have.
Authorizations
Use a Bouclay secret key (sk_test_..., sk_live_...) or restricted key
(rk_test_..., rk_live_...).
A secret key can call every endpoint. A restricted key can only call the
endpoints its scopes cover. A scope is {resource}:{access}, for example
customers:read or refunds:write, and write includes read. GET
requests need read access and everything else needs write, except
POST /subscriptions/{id}/items/{item}/preview, which only needs
subscriptions:read. A request outside the key's scopes gets 403 permission_denied naming the missing scope, and its Idempotency-Key
is not used up.
Publishable keys (pk_...) are rejected by server-side API endpoints. A
key's mode scopes what it can see and charge: a test key can never reach
a live card.
Headers
Required for POST and PATCH requests. Replays identical method + path + body requests and rejects mismatched re-use.
1 - 255Path Parameters
Body
^[A-Za-z0-9_-]+$Names the plan's first charge when it is still unnamed.
standard, zero_rated, exempt, null What one of the charge's quantity is called ("learner"). Empty or null removes it, and its plural with it.
40The plural ("learners"); left out, it is unitLabel with an "s".
40