Herald
OpenapiBilling

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.

POST
/api/bill/client/{clientAppId}/subscription/cancel

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.

Authorization

bearer_auth
headerAuthorizationBearer <token>

Path Parameters

clientAppId*string

Client App ID

Formatuuid

Request Body

application/json
  1. body

Request to cancel subscription

cancelAtPeriodEnd*boolean

Response Body

Cancel request submitted to provider; local status will update via webhook

application/json
  1. response

Response for subscription cancellation

canceledAt*string
message*string
subscriptionId*string
Example Request
curl -X POST 'https://example.com/api/bill/client/497f6eca-6276-4993-bfeb-53cbbbba6f08/subscription/cancel' \
  -H 'Content-Type: application/json' \
  -d '{
  "cancelAtPeriodEnd": true
}'
Example Response
{
  "canceledAt": "string",
  "message": "string",
  "subscriptionId": "string"
}