DevelopersGet startedQuick start
Get started

Quick start

Charge for your app every month in four steps. A Subscribe button, one API call, and optionally a webhook.

This guide takes you from nothing to a paying subscriber. It assumes your store is on the Pro or Business plan.

1. Create a subscription product

In your dashboard go to Products → Add product → Subscription.

  • Give it a name, for example Pro plan.
  • Set the price and how often it renews: every week, month, 3 months or year.
  • Under Digital Delivery, choose Redirect URL and enter your app's URL, for example https://myapp.com/welcome. After paying, subscribers are sent there.

Save it. On the product page, the Subscribe link button copies the hosted subscribe page, which looks like:

https://paylead.app/subscribe/k3x9pa

k3x9pa is the product's code. You'll use it below.

2. Add a Subscribe button

The simplest button is a link. Pass the signed-in user's email and your own id for them as ref:

<a href="https://paylead.app/subscribe/[email protected]&ref=USER_123">
  Upgrade to Pro
</a>

Or open the subscribe page over your app with the embed script, so the user never leaves:

<script src="https://paylead.app/embed.js" async></script>

<button
  data-paylead-subscribe="k3x9pa"
  data-paylead-ref="USER_123"
  data-paylead-prefill-email="[email protected]"
>
  Upgrade to Pro
</button>

The user pays with mobile money or card. When the payment is confirmed they're sent to your link with the subscription added to the address:

https://myapp.com/welcome?subscription=sub_8f2k1m0q9z&ref=USER_123&status=active

3. Check access from your server

Create a key in Settings → Developers → API keys. Keep it on your server only.

Then, when the user signs in (or once a day), ask Paylead whether they should be let in:

curl "https://paylead.app/api/v1/access?ref=USER_123" \
  -H "Authorization: Bearer sk_live_your_key"
{
  "has_access": true,
  "status": "active",
  "access_ends_at": "2026-11-13T09:00:00+00:00",
  "subscription": {
    "id": "sub_8f2k1m0q9z",
    "ref": "USER_123",
    "status": "active",
    "current_period_end": "2026-11-10T09:00:00+00:00",
    "manage_url": "https://paylead.app/subscription/…"
  }
}

has_access is all most apps need. It stays true during the 3-day grace period while a subscriber renews.

// Node.js
const response = await fetch(
  `https://paylead.app/api/v1/access?ref=${encodeURIComponent(user.id)}`,
  { headers: { Authorization: `Bearer ${process.env.PAYLEAD_KEY}` } },
);
const { has_access } = await response.json();
// Laravel
$access = Http::withToken(config('services.paylead.key'))
    ->get('https://paylead.app/api/v1/access', ['ref' => $user->id])
    ->json();

$user->update(['is_pro' => $access['has_access']]);

4. Optional: get told when things change

Instead of checking on every sign-in, you can let Paylead tell you. Add an endpoint in Settings → Developers → Webhooks, and Paylead will POST events like subscription.activated, subscription.renewed and subscription.expired to it.

See Webhooks for the events and how to check the signature.

Let users manage their subscription

Every subscription has a private page where the subscriber can renew early or cancel. Link to it from your app's settings using subscription.manage_url. Every reminder Paylead sends links there too.