Pakistan payment integration

JazzCash Paywall integration guide

Connect a JazzCash checkout flow to SSCodeAxis plans, PKR prices, signed webhooks and entitlement checks from your Node.js backend.

1. Create a PKR checkout intent

Use a server-side API key and a price configured in your Paywall catalog.

import { PaywallSDK } from "@sscodeaxis/paywall-sdk";

const sdk = new PaywallSDK({
  apiKey: process.env.PLATFORM_API_KEY!,
  baseUrl: process.env.PLATFORM_API_URL!,
});

const checkout = await sdk.checkout.createIntent({
  customerEmail: "customer@example.com",
  planId: "your-plan-id",
  priceId: "your-pkr-price-id",
  successUrl: "https://yourapp.com/billing/success",
  cancelUrl: "https://yourapp.com/billing/cancelled",
});

// Show the hosted checkout URL to the customer.
console.log(checkout.id);

2. Verify before granting access

Configure your webhook endpoint in the Paywall console and verify every raw event with constructWebhookEvent. Store the delivery ID so retries do not grant access twice.

const access = await sdk.entitlements.check("pro_reports");
if (!access.allowed) {
  // Show an upgrade action instead of serving the feature.
}

3. Plan recurring billing

JazzCash does not provide a native recurring-subscription primitive in the current adapter. For a recurring PKR plan, schedule a renewal checkout and extend the subscription only after a verified successful payment. If you need provider-managed automatic collection, connect a provider that supports native recurring billing.