DocsGetting StartedQuickstart
Quickstart
Go from a fresh account to your first successful test payment. No real money is involved — everything here happens in test mode.
1. Create your account and store
Sign up at saleonix.com/register and complete onboarding (business details and verification documents). Every account gets two stores:
| Store | Purpose | Keys |
|---|---|---|
| TEST | A sandbox that mirrors your live store. Payments are simulated — perfect for development. | sk_test_ / pk_test_ |
| LIVE | Real customers, real money. Available once onboarding is approved. | sk_live_ / pk_live_ |
2. Get your API keys
In the dashboard, open API Keys (/app/keys) and generate a key pair for your store:
| Key | Prefix | Where it lives | What it can do |
|---|---|---|---|
| Secret key | sk_test_ / sk_live_ | Your server only | Create and retrieve checkout sessions |
| Publishable key | pk_test_ / pk_live_ | Browsers / mobile apps | Confirm a session it holds the client_secret for; License API calls |
Never ship a secret key to the browser
sk_ keys on browser-facing endpoints (wrong_key_type), and our SDKs refuse to accept them. If a secret key ever leaks, regenerate it immediately in the dashboard.3. Create a product (or skip with amount mode)
Add a product with a price in Store → Products. Every price gets a price_id — copy it from the product page. Prices are in EUR and stored in cents (1000 = €10.00).
If your totals are computed at runtime (a shopping cart with shipping and coupons), you can skip the catalog entirely and pass an amount instead — see amount mode.
4. Create a checkout session and redirect
From your server, create a session with your test secret key, then send the customer to the returned url — a hosted payment page run by Saleonix:
POST /api/v1/checkout/sessions
curl -X POST https://saleonix.com/api/v1/checkout/sessions \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-12345" \
-d '{
"price_id": "clpr1ce...",
"quantity": 1,
"success_url": "https://example.com/thanks",
"customer_email": "buyer@example.com"
}'On the payment page, pay with the test card 4242 4242 4242 4242 (any future expiry, any CVC). The customer lands back on your success_url with ?session_id=cs_... appended.
5. Verify before you fulfill
A redirect can be faked — never fulfill an order from the redirect alone. Retrieve the session from your server and check both status fields:
GET /api/v1/checkout/sessions/{id}
curl https://saleonix.com/api/v1/checkout/sessions/cs_test_aBcD... \
-H "Authorization: Bearer sk_test_xxx"Prefer webhooks in production
checkout.session.completed webhook — set one up here.Going live — checklist
- Onboarding approved and your LIVE store enabled.
- Swap
sk_test_→sk_live_(andpk_test_→pk_live_) in your server configuration — keep them in environment variables, never in code. success_urlmust behttps://in live mode.- Webhook endpoint deployed and its signing secret stored securely.
- Fulfillment only happens after
status = completeandpayment_status = paidis verified server-side. - Idempotency keys on session creation so network retries can't double-charge.