Billing an Amen Product through Core
Use the shared Amen catalogue, checkout, portal and billing projection instead of embedding Stripe in a product.
Amen products do not create Stripe customers or subscriptions directly. Core owns the plan catalogue, provider identifiers, checkout, portal, invoice projection and entitlements for every installed product.
Register product plans
Register the product, plans, prices and feature limits in Core. Product frontends consume the public provider-neutral catalogue:
GET /v1/catalog/products/b2b/plansProvider price identifiers and secrets never reach the browser or product database.
Start checkout through Core
const { url } = await core.createBillingCheckout({
workspaceId,
productKey: "b2b",
planKey: "pro",
interval: "month",
idempotencyKey,
});
window.location.assign(url);Core verifies workspace authorization, catalogue consistency and test/live mode before returning a validated provider URL.
Read the billing projection
The organization settings screen reads Core’s canonical billing DTO. The response contains plan, status, limits, period dates, usage and invoices without exposing Stripe object IDs.
GET /v1/workspaces/:workspaceId/billing
GET /v1/workspaces/:workspaceId/billing/invoicesLet Core reconcile provider events
Core verifies raw webhook signatures, records an idempotence barrier, re-fetches canonical provider objects, serializes updates by customer and projects the resulting entitlements. Products consume those entitlements; they do not implement a second webhook pipeline.
Best Practices
- Use Core catalogue keys rather than provider identifiers.
- Supply an idempotency key for every checkout request.
- Treat the success redirect as navigation, not proof of payment.
- Gate product features from Core entitlements.
- Use the shared billing portal for cancellation and payment-method changes.
Amen Forms