Accountmaker Docs
Features

Subscriptions

Stripe subscription integration with checkout, portal, sync, and webhook handling.

subscriptions stripe payments

Subscriptions

AM manages the Stripe subscription lifecycle for accounts so you can focus on pricing and access control instead of webhook handling.

Create checkout sessions, let customers manage their plans, and keep account access in sync with Stripe.

Subscription Flow

StripeAMUserStripeAMUserStart checkoutCreate checkout sessionRedirect to StripeComplete paymentWebhook: checkout.session.completedSync subscription + features

Endpoints

EndpointPurpose
POST /api/accounts/:account_id/subscriptions/stripe/checkout-sessionStart subscription checkout
POST /api/accounts/:account_id/subscriptions/stripe/portal-sessionOpen customer portal
POST /api/accounts/:account_id/subscriptions/stripe/checkout-session-syncSync checkout session to subscription
POST /api/accounts/:account_id/subscriptions/syncSync subscriptions from Stripe
POST /api/accounts/:account_id/subscriptions/changeChange plan or pricing
POST /api/accounts/:account_id/subscriptions/cancelCancel subscription
GET /api/accounts/:account_id/subscriptionsList subscriptions
GET /api/accounts/:account_id/subscriptions/featuresList active features
GET /api/accounts/:account_id/subscriptions/identityGet Stripe customer identity
POST /api/applications/:application_id/subscriptions/stripe/webhookStripe webhook receiver

Checkout Session

Creates a Stripe Checkout session for new subscriptions:

// Request
{
  price_id: "price_...",
  success_url: "https://app.example.com/success",
  cancel_url: "https://app.example.com/cancel"
}

// Response
{
  url: "https://checkout.stripe.com/..."
}

Redirect users to the returned URL. After payment, Stripe redirects to your success URL.

Customer Portal

Let customers self-manage:

  • Update payment method
  • View invoices
  • Cancel subscription
  • Change plan
// Request
{
  return_url: "https://app.example.com/settings";
}

// Response
{
  url: "https://billing.stripe.com/...";
}

Subscription Identity

Each account has a subscription identity that maps the account to the Stripe customer. This is used to resolve Stripe webhooks and sync billing state.

Webhook Events

AM handles Stripe webhooks and retries on failure:

EventAction
checkout.session.completedLink customer and create subscription
customer.subscription.*Sync subscription data
invoice.paidSync invoice + update access
invoice.payment_failedUpdate access window