Open source · TypeScript

New: agentkit

Subscriptions and shop in your app – zahls.ch built in.

agentkit is the open-source billing framework for Swiss software. Subscriptions, invoices, and online shop run as a TypeScript library inside your own app – with TWINT, cards, and PostFinance via zahls.ch, QR-bill, Swiss VAT, and texts in four languages.

Early version: both kits are previews. APIs can still change between minor versions; database changes stay backwards compatible.

billing.ts@agentkit.ch/subkit
import { createSubscriptions } from '@agentkit.ch/subkit'import { zahlsProvider } from '@agentkit.ch/subkit/zahls' export const subscriptions = createSubscriptions({  database: drizzleAdapter(db),  provider: zahlsProvider({    instance: 'acme',    apiKey: process.env.ZAHLS_API_KEY,  }),  plans,  tax: { rateBps: 810 }, // 8.1 % MWST})

Two kits, one zahls.ch account

Install only what you need. Both kits use the same zahls.ch provider – one API key covers subscriptions and shop.

Subscriptions and invoices

subkit

@agentkit.ch/subkit
  • Plans, trials, and proration when plans change
  • Payment by card, TWINT, or on invoice with QR-bill
  • Dunning, lifecycle emails, and printable invoices
  • Entitlements in code: hasFeature() and getLimit()
  • Bank reconciliation with camt.053 / camt.054 and <BillingPortal /> for React

Install

npm i @agentkit.ch/subkit

Online shop

shopkit

@agentkit.ch/shopkit
  • Products and variants with stock, cart, and checkout
  • TWINT and card online, or pay on invoice with QR-bill
  • VAT per rate, discount codes, gift cards, and shipping rates
  • Orders, fulfillment, partial refunds, and the <ShopAdmin /> back office
  • Ordering through your customers' AI agent (MCP)

Install

npm i @agentkit.ch/shopkit

Connect agentkit to zahls.ch

1. Account and API key

Create your zahls.ch account and generate an API key in the dashboard – with no setup fees.

2. Add zahlsProvider

Pass your instance and API key to zahlsProvider() – agentkit creates payment pages and charges saved payment methods on its own.

3. Add the webhook

Add a JSON webhook in the zahls.ch dashboard pointing to the kit's handler. Payments and subscription status stay in sync automatically.

Why agentkit

Your database

Adapters write to your own tables (Drizzle for Postgres). No hosted service in between.

Configuration in code

One call to createSubscriptions() or createShop() – versioned and reviewable in a pull request.

Swiss first

QR-bill, TWINT, Swiss VAT, amounts in Rappen, and texts in German, French, Italian, and English.

Ready for AI agents

llms.txt, a docs MCP server, and an MCP handler per kit – for your team and, in the shop, for your customers.

Ready for your first payment?

With a free zahls.ch account you can try agentkit right away with real Swiss payment methods.