Agent skills
Discover task-oriented instructions for integrating and managing billing with BillStack APIs.
Two API generations
BillStack has two API generations. Pick by what the application already calls, and load only the matching skills.
- v2 is the default for every new integration. Its routes are
/api/billstack/v2/..., its SDK client isBillStackV2Client(@billstack/sdk/v2, 0.7.0 or later; use plain HTTP if that version is not on the registry), and its dashboard is/v2/{team}. - Legacy (v1) is only for apps that already call legacy routes,
/api/billstack/teams/{teamId}/projects/{projectId}/...(no/v2), withBillStackClient(@billstack/sdk, or@billstack/sdk/legacyfrom 0.7.0). Legacy is maintenance-only: it stays supported but gets no new features. - Decide from the code. Read the URLs or the SDK client already in the application's code. Skills named
legacy-*cover legacy only; every other skill covers v2 only.
Start at billing.w3dev.app/skill.md. It is one plain Markdown file that introduces BillStack, lists every skill below with its URL and when to use it, and says which one to load first. Give this URL to an agent that can fetch web content, or read it yourself.
BillStack publishes the machine-readable catalog at /.well-known/agent-skills. Give this URL to an agent that can fetch web content, then ask it to load the skill matching your task. Discovery support varies by agent; loading the URL explicitly works without automatic discovery.
v2 skills:
| Skill | Task |
|---|---|
| Integrate BillStack | Add checkout, entitlement checks, and a supported customer portal to an application, and test it end to end with the native sandbox (simulate API and test clocks). |
| Configure billing | Connect existing Stripe accounts to v2, configure canonical plans/prices and signed readiness, activate routing, and add a second payment provider as a country region. |
| Synchronize workspace entitlements | Reconcile workspace plans after purchase, renewal, cancellation, and payment failure; understand notification support. |
| Manage customers | Inspect customer billing, open provider portals, and change, cancel or resume subscriptions through the v2 routes. |
| Inspect billing | Investigate financials through v2 reads or authenticated MCP tools. |
| Integrate referrals | Add a referral program with referrer credits to an app that keeps its own Stripe checkout and subscriptions: program, customers, link capture, attribution, checkout discount, signed webhooks and the referrer view. |
| Operate referrals | Approve and reject referrer credits, review partner payout requests, recover failed payouts, issue manual credits, read reports and CSV exports, and import an existing referral system. |
| Run lifetime deals | Sell a plan as a stepped-price lifetime deal on a one-time Catalog price: create a draft with an idempotency key, launch it to the project's provider, show its live price with a publishable key, edit unsold steps safely, end it, list its sales and the payments to refund, and revoke a buyer, through the v2 lifetime-deals routes, BillStackV2Client or MCP tools. |
Legacy (v1) skills, only for apps that already call legacy routes and never for new work:
| Skill | Task |
|---|---|
| Legacy integration | Maintain an app that uses legacy find-or-create, checkout/start, entitlements/by-external-id, the BillStack-hosted portal, legacy subscription cancellation, BillingQL or BillStackClient. |
| Legacy referrals | Maintain an app that uses the legacy by-external-id referral routes in a project where BillStack runs checkout. |
| Legacy lifetime deals | Maintain a lifetime deal campaign that already exists on legacy Stripe tier prices through the legacy campaign routes. New lifetime deals use the v2 Run lifetime deals skill above. |
The JSON index contains each skill's name, description, Markdown URL, and SHA-256 digest of its exact UTF-8 bytes. Fetch the selected file and verify its digest before loading. If a deployment briefly causes a mismatch, refetch the index and file with cache revalidation; stop if the mismatch persists. Hashes establish consistency, not independent authorship.
These are public instructions, not credentials or permission grants. Your application still needs a team, a project, and two credentials with different jobs: a project API key (bs_) in your app's server for runtime calls, and a personal access token (bsu_) for setup, meaning projects, products and prices. A key created since 2026-12-01 cannot write the catalog and gets 403 USER_TOKEN_REQUIRED if it tries. Never paste keys or tokens into a public prompt or commit them. See API keys and v2 integration.
Use v2. Skills label legacy operations separately and only for existing integrations. They explain test/live modes, provider limitations, and verification; reading a skill does not prove that a provider or deployment is ready.
For compatible MCP clients, BillStack also exposes an authenticated billing server at https://billing.w3dev.app/mcp. The skill catalog is independent of MCP authentication and does not install tools or expose billing data.