Test mode
Build and test your integration with fake users and simulated payments. No real money moves and nobody is texted or emailed.
Test mode lets you run the whole subscription flow, from subscribe to renew, lapse and expire, before you go live. You don't need real money or real users.
1. Make a test key
In Settings → Developers → API keys, choose Test and create a key. Test keys start with sk_test_:
curl https://paylead.app/api/v1/access?ref=USER_42 \
-H "Authorization: Bearer sk_test_your_key"
Making a test key also turns on test mode for your store's subscribe pages.
2. Add a test webhook endpoint
In Webhooks, add an endpoint and choose Test. Test endpoints only get test-mode events, and live endpoints never do, so a fake user can't reach your production app.
Every event carries livemode:
{
"id": "evt_…",
"type": "subscription.activated",
"livemode": false,
"data": { "object": "subscription", "livemode": false, "status": "active" }
}
3. Subscribe a test user
Open your subscribe page with ?test=1:
https://paylead.app/subscribe/k3x9pa?test=1&ref=USER_42&[email protected]
Or add data-paylead-test to your Subscribe button or pricing table:
<button data-paylead-subscribe="k3x9pa" data-paylead-ref="USER_42" data-paylead-test>
Subscribe
</button>
From code: Paylead.subscribe('k3x9pa', { ref: 'USER_42', test: true }).
Instead of the payment page, you get Paylead's test payment page. Choose Payment succeeds or Payment fails. A success starts the subscription and fires subscription.activated to your test endpoints. Then the user lands where a real subscriber would: your app's return URL, or their subscription page.
4. Fast-forward time
In Settings → Developers → Test mode, each test subscription has buttons to:
| Button | What happens | Event |
|---|---|---|
| Renew now | A simulated payment adds a period | subscription.renewed |
| End the period | The paid period runs out; the 3-day grace period starts | subscription.past_due |
| End grace period | Access ends | subscription.expired |
| Cancel | It stops renewing and runs to the end of the period | subscription.cancelled |
Delete test data removes every test subscription so you can start again.
What test keys can do
| Endpoint | Test key |
|---|---|
GET /store, GET /products |
Yes, your real store and products |
GET /access, /subscriptions |
Yes, test subscriptions only |
POST /subscriptions/{id}/cancel |
Yes, test subscriptions only |
| Orders, customers, payment links, invoices | No: 403 with live_key_required |
Live keys never see test subscriptions.
What test mode never does
- It never creates an order or touches your wallet, fees or Paylead Credit.
- It never texts or emails your test users.
- It never shows in your sales, subscribers list or monthly revenue.
Going live
Swap your sk_test_ key for a sk_live_ key. Point your app's live webhook endpoint at production, and remove ?test=1 or data-paylead-test. Nothing else changes.