Skip to main content
Hosted Checkout is Alguna’s pre-built payment page. You create a checkout session that says what is being sold — a plan, ad-hoc line items, or a bare amount — and who the buyer is; Alguna renders the page, collects payment details on its own origin, charges the customer, and creates the customer account, the subscription (for plans) and the paid invoice. Use it for self-serve signups, upgrades, one-off purchases, or simply to vault a card for later invoices, without building a payment form or handling card data. To render the same checkout inside your own page instead of redirecting, use Embedded Checkout. What checkout creates — customers, subscriptions, invoices, payments — is described in How Alguna works.

What a session can sell

Provide exactly one of the following: To store a payment method without charging, set "checkout_intent": "vault" and omit all three; the checkout collects and vaults a card for later use, such as invoice autopay. One-off sessions (line_items or amount) are invoiced with zero tax so the invoice total equals what the customer was charged. Plan sessions calculate tax per your tax configuration from the address entered at checkout.

Free trials

When the plan has a trial period, checkout takes no payment until the trial ends. The trial comes from the plan the buyer picks.
  • Nothing is charged at checkout. The session’s amount is 0, and checkout saves the buyer’s card instead of charging it. This works for a new buyer too: the customer account is created when checkout completes.
  • The subscription starts in its trial. No first invoice is issued or paid at checkout.
  • The first invoice is issued when the trial ends. It carries the plan’s charges and tax, and autopay charges the saved payment method.
  • Changing plan updates the trial. If the buyer changes plan or quantity in a self-serve flow, the trial and the amount due follow the new plan.
The buyer sees the trial on the page. A plan card reads “14-day free trial” with a “Start 14-day free trial” button, unless you set your own text. The order summary shows “Free for 14 days”, nothing due today and the date of the first charge, and the pay button reads “Start 14-day free trial” with a note that nothing is charged today. Set the trial on the plan’s Trial period; see Plans. A plan with no trial charges the first invoice at checkout as usual.

Who the buyer is


Creating a session

Via the API

Redirect the customer to the url in the response. Other useful request fields: Reference: Create a checkout session.

Via the dashboard

Create a purchase checkout session through the API above. The dashboard does not offer a Create Checkout Session action. For an existing customer paying an invoice, open Customers, select the customer, and choose Actions → Share Customer Portal. Configure the portal access and copy the link or send it by email. See Customer Portal. To collect payment details for future invoices, choose Actions → Request Billing Information on the customer. This collects billing information; it does not create a purchase checkout or charge the customer.

Session lifecycle

GET /checkout-sessions/{id} returns the session with its status: Sessions are immutable snapshots of what is being sold. To change the price or plan, create a new session. Reference: Get a checkout session.

Checkout flow


Handling completion

Treat the redirect to success_url as a UI signal only — fulfil from the server:
  • Webhook — subscribe to checkout.session.completed. The payload carries the session id, amount, currency, accountId, paymentId, invoiceId, subscriptionId (plan sessions) and your clientReferenceId. See Webhooks.
  • Polling — GET /checkout-sessions/{id} until status is successful and the fulfilment IDs are present.
Fulfilment is asynchronous: the payment, account and subscription or invoice attach within seconds of the customer seeing the success state, not in the same instant. A session reaching successful with a subscriptionId means the subscription exists — not necessarily that it is live. Read it with GET /subscriptions/{id} and check its own status before granting access; if your organization uses approval flows, a new subscription can land in pending_approval rather than active. See Subscription statuses.

Payment methods, tax and branding

  • Payment methods are the ones your connected processor supports and you have enabled under Settings → Workflows → Payments → Payment Methods — cards through Stripe, and ACH where enabled. 3-D Secure and other processor-driven authentication run inside the checkout.
  • Tax on plan checkouts follows your tax configuration and the address entered at checkout.
  • Branding — logo, colors and brand slug — comes from Settings → Organization → Customizations → Branding; see Branding. Serve checkout from your own domain with Custom domains.

Security

  • Card data is entered on Alguna’s origin and passed to the payment processor; it never touches your servers
  • Sessions are single-use, expire automatically, and cannot be reused after completion
  • Only the session url is safe to expose; your API key stays on your server

Best practices

Pass what you know

Send customer_id/customer_alias or a customer object so the buyer is not asked for details you already have.

Keep sessions short

Use expires_in_seconds in the hour range for cart-specific links; mint a new one if it expires.

Fulfil from the webhook

Provision on checkout.session.completed, matched by clientReferenceId, not on the redirect.

Test in sandbox

Run the full flow with your processor’s test cards before going live.

Troubleshooting

Checkout does not load — the session has expired, or the plan is not active. Create a new session. Payment failed — the customer’s bank declined the charge; the checkout shows the processor’s reason and lets them try another method. Customer not redirected — check success_url is set on the session and publicly reachable; the checkout.session.completed webhook still fires either way.

Next steps

Embedded checkout

Render the same checkout inside your own page.

Hosted checkout integration guide

Dashboard-first walkthrough.

Customer portal

Self-service after the first payment.

Launch self-serve

Trials, credits, checkout and portal in one flow.