Set Up Subscriptions & Recurring Payments
Automate billing cycles for SaaS, memberships, and services using Pine Labs Online subscriptions.
Automate billing cycles for SaaS platforms, memberships, subscriptions, EMI collections, and recurring services using Pine Labs Online subscription APIs.
Pine Labs Online enables businesses to securely collect recurring payments using UPI mandates with support for fixed billing cycles, flexible recurring collections, automated payment authorization, and low-friction customer payment experiences.
Subscription models supported
Pine Labs Online supports two subscription models based on billing frequency and payment flexibility.
Fixed Frequency Subscription
Variable Frequency Subscription
Mandate types supported
A mandate is a customer authorization that allows merchants to debit payments based on agreed billing terms.
One Time Mandate
On Demand Mandate
Recurring Mandate
Pine Labs Online supports both subscription models through Redirect Checkout for faster implementation and Custom Checkout for full control over the checkout UI.
Subscription integration workflow
Before you begin
- Create a Pine Labs Online merchant account — Sign up and enable API access.
- Generate API credentials — Copy your Client ID and Client Secret from the Dashboard → Settings.
- Set up a backend server — Required for secure API calls and webhook handling.
- Enable subscriptions — Contact your account manager to enable subscriptions on your merchant account.
Step 1 — Generate access token
Pine Labs Online payment APIs use bearer tokens to authenticate. Generate an access_token from your backend.
curl --request POST \
--url https://pluraluat.v2.pinepg.in/api/auth/v1/token \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \
--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \
--data '{
"client_id": "<your-client-id>",
"client_secret": "<your-client-secret>",
"grant_type": "client_credentials"
}'
Use the access_token received to authenticate all subsequent Pine Labs Online API requests.
Step 2 — Create a plan
Define your subscription plan with pricing, billing interval, and mandate limits.
curl --request POST \
--url https://pluraluat.v2.pinepg.in/api/v1/public/plans \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \
--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \
--data '{
"plan_name": "Monthly Plan",
"plan_description": "Monthly subscription plan",
"frequency": "Month",
"amount": {
"value": 100,
"currency": "INR"
},
"max_limit_amount": {
"value": 210,
"currency": "INR"
},
"initial_debit_amount": {
"value": 110,
"currency": "INR"
},
"trial_period_in_days": 0,
"end_date": "2026-10-21T12:02:28Z",
"merchant_metadata": {
"key1": "DD"
},
"merchant_plan_reference": "<your-plan-reference>",
"auto_debit_ot": false
}'
Step 3 — Create a subscription
Use the plan_id from the Create Plan response to create a subscription for a customer.
curl --request POST \
--url https://pluraluat.v2.pinepg.in/api/v1/public/subscriptions \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \
--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \
--data '{
"merchant_subscription_reference": "<your-subscription-reference>",
"plan_id": "<plan_id>",
"enable_notification": true,
"start_date": "2025-06-12T06:22:21Z",
"end_date": "2025-06-21T17:32:28Z",
"customer_id": "<customer_id>",
"allowed_payment_methods": ["UPI"],
"integration_mode": "REDIRECT",
"merchant_metadata": {
"key1": "DD",
"key2": "XOF"
},
"is_tpv_enabled": false,
"callback_url": "https://your-domain.com/success",
"failure_callback_url": "https://your-domain.com/failure"
}'
The response includes a redirect_url — redirect the customer to this URL to complete their first payment and authorize recurring charges.
Step 4 — Create payment
Use the order_id from the Create Subscription response to create a payment.
curl --request POST \
--url https://pluraluat.v2.pinepg.in/api/pay/v1/orders/{order_id}/payments \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--header 'Request-ID: c17ce30f-f88e-4f81-ada1-c3b4909ed235' \
--header 'Request-Timestamp: 2024-07-09T07:57:08.022Z' \
--data '{
"payments": [
{
"payment_method": "UPI",
"merchant_payment_reference": "<your-payment-reference>",
"payment_amount": {
"value": 100,
"currency": "INR"
},
"payment_option": {
"upi_details": {
"txn_mode": "INTENT"
}
},
"mandate_info": {
"request_type": "CREATE_MANDATE"
}
}
]
}'
- The
payment_amount.valuemust match themax_limit_amount.valuefrom the Create Plan API. - Currently, subscriptions are supported only through UPI payments (UPI Intent or UPI Collect flow).
- The
challenge_urlin the response is applicable only for UPI Intent flow. For UPI Collect, the customer receives a notification in their UPI app.
Step 5 — Handle payment callback
After the customer completes or fails payment, Pine Labs returns the result to your callback URL.
{
"order_id": "v1-4405071524-aa-qlAtAf",
"status": "AUTHORIZED",
"signature": "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
}
Verify payment signature
Verify the authenticity of the payment details returned to your callback URL using SHA256.
Parameters used for signature verification:
order_id— Unique order identifierpayment_status— Payment statuserror_code— Short error code (if applicable)error_message— Error message (if applicable)secret_key— Provided during onboarding
If the signature generated on your server matches the Pine Labs signature returned in the callback URL, it confirms that the payment details are authentic.
Signature verification is a mandatory step. Always verify the authenticity of callback details before updating your system.
Step 6 — Go live
- Verify your merchant account — Complete KYC verification in the Dashboard.
- Switch base URL — Replace
pluraluat.v2.pinepg.inwithapi.pluralpay.in. - Update credentials — Use production Client ID and Client Secret.
- Configure production webhooks — Point webhook endpoints to your live server.
- Test on production — Make a small real payment and refund it to verify the flow.
- Enable signature verification — Mandatory for all payment callbacks.
- Enable TLS 1.2+ — Required for all API communication.
