> ## 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.

# Billing

> Sell plans that renew every month or year, recover failed renewals, and let customers manage their own billing.

## Get started

Sell plans that renew every month or year. A subscription starts when a customer completes a checkout for a product with a recurring price, and Bachs charges the saved card on every renewal. Webhooks tell your app when to give or remove access, and your customers manage their plan, card and invoices in a hosted portal.

[Sell SaaS subscriptions →](https://docs.bachs.io/build/use-cases/saas-subscriptions.md)

*Image: The customer portal: a Pro Plan subscription with Update payment and Cancel subscription, and its monthly invoices for 29 dollars, the latest open and the rest paid.*

## Products and pricing

> [card] [Create products](https://docs.bachs.io/guides/products/overview.md)
>
> Define what you sell once, with fixed, free or custom pricing.

> [card] [Sell in local currencies](https://docs.bachs.io/guides/products/local-pricing.md)
>
> Set prices in your customers' own currencies.

> [card] [Set a one-off price](https://docs.bachs.io/guides/checkout/adhoc-pricing.md)
>
> Charge a catalog product at a different price for one checkout.

## Subscriptions

> [card] [How subscriptions work](https://docs.bachs.io/guides/subscriptions/overview.md)
>
> What starts a subscription, its statuses, and the subscription object.

> [card] [Subscription lifecycle and events](https://docs.bachs.io/guides/subscriptions/lifecycle.md)
>
> Each stage from checkout to cancellation, and the webhook that tells you.

> [card] [Offer a free trial](https://docs.bachs.io/guides/subscriptions/trials.md)
>
> A free period before the first charge, with the card saved at checkout.

> [card] [Change or cancel a subscription](https://docs.bachs.io/guides/subscriptions/manage.md)
>
> Change the plan or seat count, move a trial, or cancel.

> [card] [How proration works](https://docs.bachs.io/guides/subscriptions/proration.md)
>
> How Bachs settles the difference when a plan changes mid-cycle.

> [card] [Recover failed payments](https://docs.bachs.io/guides/subscriptions/failed-payments.md)
>
> How Bachs retries a failed renewal and helps the customer update their card.

## Use cases

> [card] [Sell SaaS subscriptions](https://docs.bachs.io/build/use-cases/saas-subscriptions.md)
>
> Plans, webhooks for access, and the customer portal, built end to end.

> [card] [Sell digital products](https://docs.bachs.io/build/use-cases/digital-products.md)
>
> Ebooks, templates, courses or software, at a fixed price or pay what you want.

## Customer management

> [card] [Set up the customer portal](https://docs.bachs.io/guides/customer-portal/overview.md)
>
> A hosted page where customers manage subscriptions, invoices and cards.

> [card] [Create a portal session](https://docs.bachs.io/guides/customer-portal/create-portal-session.md)
>
> Send a signed-in customer straight to their portal.

> [card] [Manage customers](https://docs.bachs.io/guides/customers.md)
>
> Create, find and update the customers you bill.


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