Take payments API
Taking payments on your sites: turn it on or off and read the setting.
Endpoints
/api/v1/balance/getTakePaymentsRead whether the workspace's Take payments add-on is on (what lets its sites start new payments: included in some plans, otherwise $2 a month from the workspace's balance). No params. Returns { state ("included", "active", "grace", "paused" or "off"), paidUntil, renewsOn, graceUntil, priceCents, canSwitch (whether this person may switch it), switchWords (who can, when this person can't), balanceCoversPrice }. Only reads.
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/balance/getTakePayments \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{}'/api/v1/balance/setTakePaymentsSwitch the workspace's Take payments add-on on or off. Param: enabled (true = on, false = off). On costs $2 a month from the workspace's balance (never a card), and from the AI it is never charged at once: only the AI of the person who owns the workspace may ask to switch it on, and the answer is { applied: false, pendingChange }: nothing is charged until that person approves it by hand on the card in the Serenities dashboard; then $2 is taken (nothing if this month is already paid). Tell the person it waits for their approval, never that it is on (pendingChanges_status says what became of it). Off applies at once, for whoever may switch it: it only stops the next renewal, the paid month keeps working and nothing is refunded. A plan that includes it is refused with nothing to switch. Read the state first with balance_getTakePayments. Act only on what the person named or picked.
Parameters
enabled | booleanrequired |
Example Request
curl -X POST https://app.serenitiesai.com/api/v1/balance/setTakePayments \
-H "Authorization: Bearer mk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"enabled": true
}'