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

Integration modes

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

  1. Create a Pine Labs Online merchant accountSign up and enable API access.
  2. Generate API credentials — Copy your Client ID and Client Secret from the Dashboard → Settings.
  3. Set up a backend server — Required for secure API calls and webhook handling.
  4. 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.

Bash
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"
}'
Note

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.

Bash
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.

Bash
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"
}'
Redirect URL

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.

Bash
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"
      }
    }
  ]
}'
Important
  • The payment_amount.value must match the max_limit_amount.value from the Create Plan API.
  • Currently, subscriptions are supported only through UPI payments (UPI Intent or UPI Collect flow).
  • The challenge_url in 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.

JSON
{
  "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 identifier
  • payment_status — Payment status
  • error_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.

Mandatory

Signature verification is a mandatory step. Always verify the authenticity of callback details before updating your system.


Step 6 — Go live

  1. Verify your merchant account — Complete KYC verification in the Dashboard.
  2. Switch base URL — Replace pluraluat.v2.pinepg.in with api.pluralpay.in.
  3. Update credentials — Use production Client ID and Client Secret.
  4. Configure production webhooks — Point webhook endpoints to your live server.
  5. Test on production — Make a small real payment and refund it to verify the flow.
  6. Enable signature verification — Mandatory for all payment callbacks.
  7. Enable TLS 1.2+ — Required for all API communication.

Related guides

New chat
Responses are generated using AI and may contain mistakes.
Hi! I'm Pine, your AI developer assistant. Ask me anything about Pine Labs APIs, integrations, or troubleshooting.

Tip: you can create a new chat with + E