> For the complete documentation index, see [llms.txt](https://docs.tiun.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tiun.io/guides/customer-account/let-customers-manage-their-account.md).

# Let customers manage their account

Every customer who buys through tiun gets a tiun account, and with it the **account portal** at [account.tiun.io](https://account.tiun.io). There they cancel subscriptions, manage saved payment methods, look up past payments, and sign out of devices. This guide shows how to make it part of your product.

***

## What it's for

Billing settings are something every paid product needs and few teams want to build. With the portal, you don't have to:

* **Cancellations** happen in the portal, and access ends on its own at the end of the paid period.
* **Payment methods** are added, removed, and set as default there.
* **Payment history** — every payment, with its status and tax breakdown, is listed there.
* **Sign-outs** — customers can end sessions on any device, in your app or across every app they use tiun with.

That also takes these requests out of your support inbox. For everything customers see there, see [Account portal overview](https://docs.tiun.io/reference/customer-account/overview.md) in Reference.

***

## 1. Point customers to the portal

Add a link to the portal wherever customers look for billing settings in your app — usually the account or profile menu, labelled something like **Manage subscription** or **Billing**. Link to:

* [account.tiun.io](https://account.tiun.io) in production, with `sandbox: false`.
* [account-sandbox.tiun.io](https://account-sandbox.tiun.io) while you test with `sandbox: true`. It only shows sandbox customers and purchases.

Customers sign in with the email they used at checkout and a code sent to their phone, then land on the portal home. Open it in a new tab so your app stays where it was.

You can also mention the portal in your own help pages and emails. For step-by-step help with portal tasks, link to tiun's end-customer help center at [support.tiun.io](https://support.tiun.io/faq).

***

## 2. Add your support email

Each subscription and transaction in the portal has a **Contact business** button, which shows your website and your support email. In the [my.tiun.business dashboard](https://my.tiun.business/), go to **Settings → General information** and add a **Support email**, so questions about what customers bought come to you.

***

## 3. Check how your app reacts

What customers do in the portal shows up in the user state your app already reads, so there's nothing new to build:

| In the portal                                        | In your app                                                                                                                    |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| The customer **cancels** a subscription              | Nothing changes until the end of the paid period, and `expiresAt` is set. Then the product ID is removed from `productAccess`. |
| The customer **removes a payment method**            | Nothing. A method in use by an active subscription can't be removed.                                                           |
| The customer **logs out** of your app or all devices | On the next page load, the session isn't restored and `userChange` fires with `isAuthenticated: false`.                        |

If your app gates on `productAccess` and handles a signed-out user on load, you're covered. If you have a backend, it hears about access changes through the `product_access.remove` [webhook](https://docs.tiun.io/guides/webhooks/receive-webhooks.md) and sees ended sessions through [server-side verification](https://docs.tiun.io/guides/authentication/verify-server-side.md).

For the details, see [Subscriptions and transactions](https://docs.tiun.io/reference/customer-account/subscriptions-and-transactions.md) and [Devices and connected apps](https://docs.tiun.io/reference/customer-account/devices-and-connected-apps.md) in Reference.

***

## 4. Try it in sandbox

1. Buy a test subscription in your app with `sandbox: true`.
2. Open [account-sandbox.tiun.io](https://account-sandbox.tiun.io) and sign in with the same email.
3. Cancel the subscription, then check that your app shows when access ends.
4. Under **Connected apps**, log out of your app, reload your app, and check that it shows the signed-out state.

See [Simulate payments](https://docs.tiun.io/guides/testing/simulate-payments.md#cancellation-and-expiration) for more on testing cancellations, and [Test flows](https://docs.tiun.io/guides/testing/test-flows.md) for a full checklist.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tiun.io/guides/customer-account/let-customers-manage-their-account.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
