Cancel subscription
POST
https://app.speybooks.com/api/v1/admin/orgs/{id}/cancel-subscriptionCancel an organisation's subscription. Two modes:
- immediate (
immediately: true): the subscription is cancelled now and the local status moves tocanceled. - at period end (
immediately: false, the default): the subscription is set to lapse at the end of the current billing period and remainsactiveuntil then.
The cancellation is performed at the payment provider. The local status is not written speculatively: it is brought into line from the provider's own confirmation, so the status you read reflects what the provider has actually recorded rather than an optimistic guess.
Request Body
immediately: boolean (default false)reason: minimum 5 characters, required for the audit record
Records a SUBSCRIPTION_CANCELED action in the audit log.
Error responses:
400 { code: "NO_SUBSCRIPTION" }: no active subscription404 { code: "NOT_FOUND" }: organisation not found
Path parameters
idstringrequiredOrganisation ID.
Body parameters
reasonstringrequiredReason for cancellation (audit trail). Min 5 characters.
immediatelybooleanoptionalCancel immediately (true) or at period end (false). Default false.
Response
200Subscription cancelled (immediately or at period end).
Show response fields
messagestringError codes
400No active subscription.
404Organisation not found.