Skip to main content
Build one complete payment flow at a time with your coding assistant. Each workflow below explains what you need, gives the assistant a specific job, and shows how to check the result. You do not need to install a skill. Choose a workflow and copy its prompt into an assistant that can work with your app’s code. If you build with Bachs regularly, the optional skill keeps the shared guidance available.

Before you start

  • Have an app your assistant can inspect, and decide what customers will buy.
  • Get a sandbox API key. Keep it in your server’s environment; do not paste it into a chat.
  • Let your assistant read the linked docs. If it cannot open them, use Copy page on each guide and paste the content alongside the prompt.
  • Use the Bachs CLI to forward sandbox webhooks to your machine.
Checkout return URLs must be public. For a fully local app, omit checkout redirects and return to the app manually after paying; the CLI still forwards webhooks locally. Use a public deployment or tunnel if you need an automatic return. Every prompt includes its own integration rules. You can use it without creating an AGENTS.md file or installing a skill.

Build with the SDK

For a Node.js or TypeScript server, use the official Bachs SDK. It handles API requests, typed responses, and webhook signature verification. Your app still owns authentication, order state, access, and delivery recovery. The Next.js SaaS starter uses the SDK and includes its tested package while the npm release is being prepared. The current npm 0.0.1 package is a placeholder. Follow the starter’s package instructions instead of installing that version. Connect onboarding, account context, and marketplace splits currently use the documented API because these operations are not yet supported by the SDK.

Choose your workflow

Accept a one-time payment

What you’ll build: a customer chooses an item, pays on Bachs checkout, and your app fulfils the order after confirming payment. Have ready: what you sell, its price and currency, and the action that completes an order. Products can be created in the dashboard or through the Products API.
Prompt

Check the result

  • A successful sandbox checkout pays the correct order and fulfils it once.
  • Opening the success URL before paying leaves the order unpaid.
  • An unsuccessful checkout does not fulfil the order.
  • Redelivery cannot repeat fulfilment; failed handling can recover on redelivery.
  • An unrelated payment or virtual-account deposit cannot pay the order.
After this works, add an overlay checkout, local pricing, or refunds.

Sell subscriptions

What you’ll build: monthly and yearly plans, access that follows subscription state, and a Manage billing button for the customer portal. Have ready: signed-in users, your plans, and a decision about access during a failed renewal. The current subscription guide supports USD card billing; free trials are in beta.
Prompt

Check the result

  • A sandbox payment saves the user’s customer ID and subscription, then grants access.
  • A redirect alone cannot grant access.
  • Duplicate or older events cannot undo a later cancellation.
  • Manage billing opens the signed-in user’s own customer portal.
  • Scheduled cancellation keeps access for the remaining paid period; immediate cancellation removes it.
  • Renewal failure follows your access policy and can recover after a successful retry.
The full walkthrough includes requests, webhook examples, and a go-live checklist. Add trials or plan changes after the basic flow works.

Build a marketplace

What you’ll build: your platform collects a payment, keeps its fee, and the seller’s share reaches the seller’s Bachs balance at settlement. The seller can then pay out to its own approved destination. Have ready: the Connect capability, seller records, your fee, and the collection currency. Start with one seller per order. If each business should own its sale, use Platform for businesses.
Prompt

Check the result

  • The correct seller account ID is saved against each seller.
  • The payment is accounted for across the seller’s share, platform fee, and processing fee.
  • Settlement creates one seller transfer; the app does not send another manually.
  • Blocked capabilities or an unusable destination prevent a payout.
  • The app tracks payout status through delivery or failure.
  • Your team understands the platform’s responsibility for refunds and disputes.
Follow the marketplace walkthrough for the split, Connect payouts for withdrawals, and refunds and disputes before going live.

Set up the Bachs skill (optional)

The public skill source covers all three workflows; it is also copied below for convenience. A skill saves shared Bachs instructions so you do not have to paste them into every task. You still tell the assistant what you want to build. The prompts above work on their own.
  1. In your app’s project, create a folder called .claude/skills/bachs.
  2. Copy the file below and save it as SKILL.md in that folder.
  3. In Claude Code, type /bachs followed by your task, or use a prompt above.
Claude Code can also load the skill when a relevant task matches its description. See Claude Code’s instructions for other installation options.
SKILL.md
For another assistant that supports Agent Skills, install the same SKILL.md using that tool’s instructions. If your assistant does not support skills, use a prompt above and paste the linked docs when needed.

Before you go live

Ask your assistant to report files changed, tests actually run, and remaining setup. A mocked webhook test proves handler behavior; it does not prove checkout, settlement, or payout delivery works in sandbox. Follow Go live, or Take Connect live for a marketplace. Create production resources, use the production key and API URL, and register a webhook endpoint with its own signing secret.