Skip to content

Legacy Public Pricing and Payment Links

Show safe pricing data and start anonymous checkout without putting provider logic in your app.

Legacy (v1) API, no v2 equivalent yet. This page describes the Stripe-first legacy API. It is still supported and is not replaced by a v2 route.

Public pricing and payment-link endpoints are for marketing pages and logged-out checkout.

Use a publishable key. Do not expose private API keys in browser code.

Public pricing

curl "https://billing.w3dev.app/api/billstack/teams/{teamId}/projects/{projectId}/tiers/public?pk=<publishable-key>"

The response contains safe tier data only:

{
  "tiers": [
    {
      "tierAlias": "pro",
      "name": "Pro",
      "description": "For growing teams",
      "prices": [
        {
          "interval": "year",
          "billingScheme": "standard",
          "unitAmount": 2388,
          "currency": "usd",
          "seatsLeft": null,
          "soldOut": false,
          "availableUntil": null
        }
      ],
      "lifetimeCampaign": null
    }
  ]
}

No Stripe IDs or internal secret values are returned.

Anonymous public checkout

curl "https://billing.w3dev.app/api/billstack/teams/{teamId}/projects/{projectId}/checkout/public-link?tier=pro&cycle=annual&pk=<publishable-key>"

Response:

{
  "checkoutUrl": "https://buy.stripe.com/...",
  "provider": "stripe",
  "mode": "payment_link",
  "tier": "pro",
  "cycle": "annual"
}

Redirect the browser to checkoutUrl.

Use this flow for:

  • Logged-out pricing pages.
  • Static landing pages.
  • Stripe Payment Links already managed by BillStack.
  • Lifetime deals where the user can complete payment before creating an app session.

Do not use this flow when a referral code must be attached before checkout. In that case, redirect the user through signup/login and start logged-in checkout.

Lifetime deals

For lifetime pricing, use:

tier=lifetime&cycle=once

Do not send tier=growth&cycle=lifetime.

BillStack resolves the active lifetime price and its payment_link_url metadata. If no active lifetime price or payment link exists, the endpoint returns a not-found error instead of silently falling back.

For a tier-stepped variant of lifetime pricing — price rises as units sell, up to a total cap — see Lifetime Deal Campaigns. It plugs into this same tier={alias}&cycle=once flow and the public pricing endpoint's lifetimeCampaign field.