• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

How can I integrate Pabbly Subscription Billing + Webhooks to my Next.js project?

alexco888

Member
Hi! I hopy you are great :)
I would like to be able to update an allow-list for my Next.js Application with Clerk.
I share a code that allows me to do it manually with node.js:

I only need to change the identifier and I automatically add that email to my Clerk's allow-list.
JavaScript:
const axios = require('axios')
require('dotenv').config({ path: '.env.local' })

async function addIdentifierToAllowlist() {
  try {
    const response = await axios.post(
      'https://api.clerk.com/v1/allowlist_identifiers',
      {
        identifier: '[email protected]',
        notify: true,
      },
      {
        headers: {
          Authorization: `Bearer ${process.env.CLERK_SECRET_KEY}`,
          'Content-Type': 'application/json',
        },
      },
    )

    console.log(response.data)
  } catch (error) {
    console.error(error)
  }
}

addIdentifierToAllowlist()
I want to be able to automize this process (right now Pabbly Connect does not support Clerk (https://clerk.com/) so I would need to do it with code (I am using node.js inside my Next.js project).
How should I get the emails from a specific product from Pabbly Subscription Billing each time there is a successful payment? And more, to be able via webhooks to read if the user is still active or if he missed a payment, to him to not have access to my app (and be removed from my allow-list).

Thank you very much for your attention :)
 
D

Deleted member 12173

Guest
Hello @alexco888

To configure the above mentioned requirement, you can use Pabbly Connect. In Pabbly Connect, you have the option to call the API using trigger known as the Custom API by Pabbly. After calling the API, you can pass the required details as per your specifications and achieve your use-case accordingly.

Additionally, to retrieve customer details such as email and subscription-related information, like failed payments or cancelled subscriptions, you can use the webhook option available in Pabbly Subscription Billing. There are multiple webhook triggers available, allowing you to use these triggers to obtain customer, subscription, or payment details. For a more details, please refer to the screenshot below.

I hope this addresses your query. If you have any further concerns or questions, please do not hesitate to contact us again.

1702715778688.png
 
Last edited by a moderator:
Top