> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bachs.io/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Money is always a decimal string at the currency's precision (for example "29.00"), paired with an ISO 4217 currency field. Never use minor units.
> Build against the sandbox first: base URL https://sandbox-api.bachs.io with sk_sandbox_ keys. Production is https://api.bachs.io with sk_live_ keys; going live is a key swap.
> Treat webhooks (for example collection.succeeded) as the source of truth for fulfilment, never client-side events or redirects.
> Subscriptions are created by completing a checkout for a recurring product. There is no direct create-subscription endpoint.
> IDs carry resource prefixes (cust_, prod_, sub_, chk_, inv_, ref_) and timestamps are ISO 8601 UTC.

# app.deauthorized

> Occurs when a business's connection to your app ends.

Sent to your app's webhook just before a connection ends. It tells you to stop
showing that business as connected and to throw away its tokens.

Only your app receives it, on the webhook Bachs set up for that business when
you swapped the code. The business's own webhooks never get it, and your app
cannot subscribe to it: it always comes.

```json Event theme={"dark"}
{
  "id": "evt_4f5g6h7i8j9k0l1m",
  "type": "app.deauthorized",
  "created_at": "2026-11-24T09:12:03.118000+00:00",
  "organization_id": "acct_3Wq8ZfT1yHnJ5sVe",
  "data": {
    "object": "app_authorization",
    "id": "cag_7Hq2Lm9Xs4Kd8Pw1Zt6Rv3Nb",
    "account_id": "acct_3Wq8ZfT1yHnJ5sVe",
    "app_id": "app_9Kd2Mw7Qx1Lr5Tn8Vb3Hs6Pz",
    "reason": "merchant"
  }
}
```

## Event fields

**id** `string`

The event's unique identifier, prefixed `evt_`. Use it to deduplicate deliveries.

**type** `string`

Always `app.deauthorized`.

**created\_at** `string`

When the connection ended, in UTC.

**organization\_id** `string`

The business that was connected.

**data.object** `string`

Always `app_authorization`.

**data.id** `string`

The connection's id.

**data.account\_id** `string`

The business that was connected. Matches `organization_id` and the `account_id` you got when you swapped the code.

**data.app\_id** `string`

Your app's `client_id`.

**data.reason** `string`

Why it ended: `merchant` (the business disconnected), `app` (your server revoked it), `expired` (no refresh for 90 days), `deleted` (you deleted the app) or `suspended` (Bachs suspended the app).

## What to do on receipt

Mark the business as disconnected and delete its access and refresh tokens and
its webhook signing secret. Do not retry the old tokens: they already stopped
working. To work with the business again, send it through a new connection.

## Related

* [When a connection ends](https://docs.bachs.io/apps/disconnect.md)
* [Bachs Apps](https://docs.bachs.io/apps/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.