Connect

Your checkout, your UI. Altruon underneath.

Altruon.js mounts a secure payment component inside your page or funnel. Style it with your CSS variables, get results through callbacks, and keep your secret key on your server.

server.js

Your server

// Create a session with your secret key
const res = await fetch(ALTRUON_API + '/api/session/v1/create', { method: 'POST', headers: { 'content-type': 'application/json', 'x-secret-key': process.env.ALTRUON_SECRET_KEY }, body: JSON.stringify({ currency: 'EUR', lineItems: [{ planId: 'plan_premium_yearly', quantity: 1 }], billingPlatformId: 'bp_your_billing_platform' }) }); const { sessionId } = await res.json();

paywall.js

Your page

// Mount the component with your publishable key
altruon.init({ /* pk_test_your_publishable_key */ }); altruon.setSession(sessionId); altruon.renderComponent('#paywall'); // Charge, create the subscription, write it back
altruon.processPaymentAndSubscription();

4

Calls from mount to subscription

1

Session per checkout

2

Keys, the secret one stays server-side

SKILL.md

Docs written for AI agents

What you get

Your front end. The payment flow is ours.

Card data goes into secure fields and never touches your servers. Your code decides what the page looks like and what happens after the payment.

Styled with your CSS variables

Match your fonts, colors and spacing. The component renders inside your page, in the element you choose.

Same session model as hosted pages

Altruon.js and hosted pages share one flow, so you can run both on one site: the SDK in your funnel, a hosted link in your emails.

3D Secure handed back by callback

When a payment needs a challenge or a redirect, Altruon runs it and returns the result to your page through a callback.

Separate sandbox and production

Build and test in the sandbox, then go live in production. Test and live run in separate environments.

Signed webhooks

HMAC-signed, up to 2 endpoints, retried up to 4 times. Payloads are thin, so you fetch the current state through the API.

Docs for people and AI agents

docs.altruon.io includes a SKILL.md file written for AI coding agents, so your agent works from the same reference as your team.

How it fits together

From session to subscription in four steps

01

Create a session on your server

Call the session endpoint with your secret key, the currency, the plan and your billing platform. Sessions are single-use and last 15 minutes.

02

Mount the component

In the browser, init with your publishable key, set the session and render the component into your page.

03

Process payment and subscription

One call charges the payment method, creates the subscription on your billing engine and marks the first invoice paid.

04

Listen to signed webhooks

Verify the Altruon-Signature header, then fetch the current state of the object through the API.

Webhook events

Know when it happened, then ask for the state

Every event carries an HMAC signature in the Altruon-Signature header. Register up to 2 endpoints. Failed deliveries are retried up to 4 times.

All events in the docs
EventWhen it fires
checkout.session.completedA checkout ends with a successful payment or trial setup.
checkout.session.expiredA session reaches 15 minutes without being completed.
payment.succeededAn acquirer approves a payment.
invoice.paidA payment is recorded on the invoice in your billing engine.
invoice.dunning_startedA renewal fails and the invoice moves to dunning.
payment.retry_failedA scheduled retry of a failed renewal is declined.
payment_source.attachedA subscriber adds or replaces a card or mandate.

More in Connect

Build your checkout in the sandbox

A working sandbox takes hours. Start with the docs, or book a 45-minute payments review with our team.