Cancel subscription

POSThttps://app.speybooks.com/api/v1/admin/orgs/{id}/cancel-subscription

Cancel an organisation's subscription. Two modes:

  • immediate (immediately: true): the subscription is cancelled now and the local status moves to canceled.
  • at period end (immediately: false, the default): the subscription is set to lapse at the end of the current billing period and remains active until 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 subscription
  • 404 { code: "NOT_FOUND" }: organisation not found

Path parameters

idstringrequired
Organisation ID.

Body parameters

reasonstringrequired
Reason for cancellation (audit trail). Min 5 characters.
min length: 5
immediatelybooleanoptional
Cancel immediately (true) or at period end (false). Default false.

Response

200Subscription cancelled (immediately or at period end).
Show response fields
messagestring

Error codes

400No active subscription.
404Organisation not found.