Getting started
Paylo is payment infrastructure for mobile and web apps. Accept payments and subscriptions through a hosted, Stripe-powered checkout — with remotely configurable native paywalls on mobile, and a plain REST redirect on the web.
How it works#
Your app (or backend) calls the Paylo API with your API key. Paylo creates a Stripe Embedded Checkout session and returns a hosted checkout URL branded with your name, logo and colors. When the customer pays, Paylo updates the status and notifies your server with a signed webhook.
Mobile app (Flutter / Swift / Kotlin SDK)
Web app / backend (REST — POST /v1/subscriptions)
│ create session or subscription
▼
Paylo API ──▶ creates Stripe checkout
│
▼
Hosted checkout page (your branding)
│ payment complete → redirect to your success_url
▼
Stripe webhook ──▶ Paylo ──▶ your webhook (HMAC-signed)Authentication#
Every request carries an API key as a bearer token. Each environment has two keys, both in Dashboard → Settings:
| Field | Type | Description |
|---|---|---|
pk_test_… / pk_live_… | publishable | Goes in your app. Only reaches what the SDKs call: bootstrap, checkout creation, customer status, portal, plan change, identify. |
sk_test_… / sk_live_… | secret | Stays on your server. Reaches the whole API (plans, refunds, cancellations, lists, settings). Never ship it in an app or a web page. |
Authorization: Bearer sk_test_... # from your server
Authorization: Bearer pk_test_... # from your app (the SDKs do this for you)A publishable key calling a server-only endpoint gets a 403. Keys are shown once at creation and stored hashed — treat secret keys like passwords. If a key leaks, regenerate it from Settings: the old key stops working immediately.
Test & live modes#
Every account has two environments. The key prefix picks the environment: _test_keys hit Stripe's test mode (no real money, test cards like 4242 4242 4242 4242), _live_ keys charge real customers. Plans, subscriptions, payments, customers and stats are fully separated per mode. Paywalls and targeting rules are shared by both modes: publishing a paywall or editing a rule changes what test and live apps see at once.
The dashboard follows the test/live switch in the sidebar; your apps don't. Each app is pinned to its own key's environment — a pk_live_ build keeps serving live data even while you flip the dashboard to test mode to experiment. Generate your live keys from Settings when you're ready to launch.
Base URL & environments#
https://paylo-production.up.railway.app/v1The SDKs point there by default. To target a staging deployment, pass baseUrl when constructing the client.
Idempotency#
Creation endpoints accept an Idempotency-Key header. Sending the same key within 24 hours returns the original response instead of creating a duplicate checkout — protect yourself against double-taps and network retries.
curl -X POST .../v1/subscriptions \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: order-42-attempt" \
-d '{ "plan_id": "pro_monthly", "customer_id": "user_42" }'Quickstart — 3 calls#
0. Set your default Success and Cancel URLs in Settings → Redirect URLs — where customers land after checkout (a web page or an app deep link). Calls can override them with success_url / cancel_url; without either, checkout creation returns a 400.
1. Create a plan (once, from the dashboard or the API):
/v1/plans2. Subscribe a customer — open the returned URL:
/v1/subscriptions3. Gate premium features:
/v1/customers/:customerId/status