Cancel the caller's own subscription for a client app.
Unlike the previous admin-only flip, this handler is a **user self-service** endpoint mounted on the browser-token router. It calls the **payment provider cancel API** (Stripe/Creem) and does **NOT** touch the local subscription row — local status is updated exclusively by the subsequent provider webhook (`customer.subscription.deleted` / `subscription.canceled`). If the provider call fails the error is surfaced to the caller and the local state is left untouched. Apple / Google in-app purchases cannot be canceled via a developer API (only via the App Store / Play Store by the user); this endpoint rejects them with 400.
Unlike the previous admin-only flip, this handler is a user self-service
endpoint mounted on the browser-token router. It calls the payment provider
cancel API (Stripe/Creem) and does NOT touch the local subscription
row — local status is updated exclusively by the subsequent provider webhook
(customer.subscription.deleted / subscription.canceled). If the provider
call fails the error is surfaced to the caller and the local state is left
untouched.
Apple / Google in-app purchases cannot be canceled via a developer API (only via the App Store / Play Store by the user); this endpoint rejects them with 400.
bearer_authAuthorizationBearer <token>clientAppId*stringClient App ID
uuidapplication/json- body
Request to cancel subscription
cancelAtPeriodEnd*booleanCancel request submitted to provider; local status will update via webhook
application/json- response
Response for subscription cancellation
canceledAt*stringmessage*stringsubscriptionId*stringcurl -X POST 'https://example.com/api/bill/client/497f6eca-6276-4993-bfeb-53cbbbba6f08/subscription/cancel' \
-H 'Content-Type: application/json' \
-d '{
"cancelAtPeriodEnd": true
}'{
"canceledAt": "string",
"message": "string",
"subscriptionId": "string"
}