Integration Guide for your SaaS Application

Pabbly Subscriptions Integration Workflow

This workflow is useful, if you offer a web application and you wish to integrate Pabbly Subscriptions in your application.

You can follow the workflow below to integrate Pabbly subscription in your application.
  1. Let’s say you are running your application on your website
  2. You will be mentioning all the plans of your product on your website.
  3. Under each plan will be the checkout link of each plan. You will get the checkout link for plans after creating the product and plan inside Pabbly subscriptions product.
  4. If one of your customers tries to purchase any plan from your website.
  5. He will click the checkout link of any plan and he will be redirected to the checkout page.
  6. On the checkout page, he will fill his contact details including his name, email and address.
  7. After entering the credit card details, he will be redirected to the thanks page.
  8. You can also redirect customer to any custom thanks page on your application. The custom thanks page link is setup at the time of creating products inside Pabbly Subscriptions.
  9. When the customer is redirected to thanks page, the redirection link also includes a special query variable hostedpage.
    For example:
  10. You need to catch that query string and pass that value into the Verify Hosted page API to confirm the customer subscription.. Check
  11. The API response will give you the details of the customer along with the subscription status.
"status": "success",
"message": "Invoice data",
"data": [
"customer_id": "5a4b78053152df337d841348",
"user_id": "5a4b5db47cfab6872a7feafa",
"status": "paid",
"amount": 99,
"due_date": "2018-01-02T12:16:05.055Z",
"plan_id": [
"subscription_id": "5a4b78053152df337d841349",
"subscription": {
"customer_id": "5a4b78053152df337d841348",
"email_id": "",
"product_id": "5a4b5e6ecb9bc82fd2b4bfef",
"plan_id": "5a4b5e7fcb9bc82fd2b4bff0",
"user_id": "5a4b5db47cfab6872a7feafa",
"status": "live",
"quantity": "1",
"amount": 99,
"starts_at": "2018-01-02T12:16:05.055Z",
"activation_date": "2018-01-02T12:16:05.055Z",
"expiry_date": "",
"trial_days": 0,
"trial_expiry_date": "",
"next_billing_date": "",
"last_billing_date": "2018-01-02T12:16:05.508Z",
"plan": {
"product_id": "5a4b5e6ecb9bc82fd2b4bfef",
"user_id": "5a4b5db47cfab6872a7feafa",
"plan_name": "Life Time Plan",
"plan_code": "lifetime",
"price": "99",
"billing_period": "y",
"billing_period_num": "1",
"billing_cycle": "lifetime",
"billing_cycle_num": null,
"trial_period": null,
"setup_fee": null,
"plan_description": null,
"createdAt": "2018-01-02T10:27:11.365Z",
"updatedAt": "2018-01-02T10:27:11.365Z",
"id": "5a4b5e7fcb9bc82fd2b4bff0"
"setup_fee": null,
"payment_terms": "",
"pcustomer_id": "5a4b776f7cfab6872a7feb06",
"createdAt": "2018-01-02T12:16:05.503Z",
"updatedAt": "2018-01-02T12:16:05.535Z",
"payment_method": "5a4b78053152df337d841346",
"id": "5a4b78053152df337d841349"
"setup_fee": null,
"pcustomer_id": "5a4b776f7cfab6872a7feb06",
"createdAt": "2018-01-02T12:16:05.508Z",
"updatedAt": "2018-01-02T12:16:05.541Z",
"id": "5a4b78053152df337d84134a"

  1. From the API response, you should save the customer_id, subscription_id and plan_id in your database.
  2. You can map your applications user id with the Pabbly customer_id, So that you can check anything you like in future using different API’s of Pabbly subscription.
  3. If you want to check the status of any particular subscription you can use subscription_id of that customer to find the current status of subscription.
  4. Possible subscription status responses are as below. You can decide what you want to do with different subscription status in your application.
  1. Trial - This represents that the subscription plan is now under a active and valid trial period.
  2. Live - This represents that the subscription is active and paid up-to-date.
  3. Dunning - This represents that the system tried renewing the subscription upon expiration and it failed and currently our system is attempting to collect payment from the customer by sending him dunning emails to update his credit card details.
  4. Unpaid - This represents that the last invoice payment for this subscription was not received. The Dunning state leads to Unpaid status once all the attempts to collect the payment have failed.
  5. Future - This represents that the subscription period starts in a future date and not on the current date.
  6. Non Renewing - This appears when the subscription is cancelled using Cancel on Next Renewal date from the admin dashboard.
  7. Canceled - This represents that the subscription has been cancelled. This may appear due to the manual cancellation of a subscription using Cancel Immediately or automatically subject to your Retry Settings preference.
  8. Expired - This represents that the subscription period has expired.
  9. Trial Expired - This represents that the trial period of the subscription plan has expired.