MongoDB Realm + Chargebee Integrations

Appy Pie Connect allows you to automate multiple workflows between MongoDB Realm and Chargebee

About MongoDB Realm

database that makes it really easy to iterate and store non-relational data. No more crazy SQL queries and ALTER tables to add extra data!

About Chargebee

Chargebee is a subscription management and recurring billing solution used by businesses to customize subscription billing workflows

Chargebee Integrations

Best MongoDB Realm and Chargebee Integrations

  • MongoDB Realm Slack

    Chargebee + Slack

    Send Chargebee subscription notifications to Slack
    When this happens...
    MongoDB Realm New Subscription
    Then do this...
    Slack Send Channel Message
    If you’re using Slack to handle customer support, you can notify your team members directly from ChargeBee about new subscriptions. This integration will make things more organized as there will be no need to go to different platforms for the same task. Set up this ChargeBee-Slack integration and automatically send messages to Slack whenever ChargeBee new subscriptions are created on ChargeBee.
    How This Chargebee-Slack Integration Works
    • A new subscription is created on ChargeBee
    • Appy Pie Connect automatically sends a message on Slack
    Apps Involved
    • ChargeBee
    • Slack
  • MongoDB Realm Google Sheets

    Chargebee + Google Sheets

    Automatically add newly created customers on ChargeBee to Google Sheets Read More...
    When this happens...
    MongoDB Realm New Subscription
    Then do this...
    Google Sheets Create Spreadsheet Row
    Want to send new Chargebee subscriptions to a google spreadsheet? With this Chargebee-Google Sheets integration, you can do that. After setting this integration up, Appy Pie Connect will automatically create a new row on a specified Google Sheet with details of new subscriptions sent to Chargebee.
    How Does It Work?
    • When you add a new subscription to Chargebee
    • Appy Pie Connect creates a new row in Google Sheets for you.
    What You Require
    • Chargebee account
    • Google Sheets
  • MongoDB Realm Xero

    Chargebee + Xero

    Add invoices on Xero for new successful Chargebee charges Read More...
    When this happens...
    MongoDB Realm New Payment
    Then do this...
    Xero Create Sales Invoice
    Do you want to ensure that your invoicing is as quick as possible? Set up this integration to start your workflows as soon as you get payment on Chargebee. Every new successful charge on ChargeBee will generate a new invoice in Xero from that point forward, ensuring that you never have to slow down for paperwork.
    How This Integration Works
    • When a new charge is approved by ChargeBee
    • Appy Pie Connect creates a new invoice in Xero
    What You Need
    • Chargebee account
    • Xero account
  • MongoDB Realm Xero

    {{item.triggerAppName}} + {{item.actionAppName}}

    {{item.message}}
    When this happens...
    MongoDB Realm {{item.triggerTitle}}
    Then do this...
    {{item.actionAppImage}} {{item.actionTitle}}
Connect MongoDB Realm + Chargebee in easier way

It's easy to connect MongoDB Realm + Chargebee without coding knowledge. Start creating your own business flow.

  • New Push notification

    Triggers when a new push notification is created

  • New Service

    Triggers when a new service is created

  • New User

    Triggers when a new user is created

  • Customer Details Updates

    Triggers when customer details such as first name, last name, email, billing address, etc., are updated.

  • New Customer

    Triggers when a customer is created.

  • New Invoice

    Triggers when a new invoice is generated(with line item support).

  • New Payment

    Triggers when a payment is collected successfully.

  • New Subscription

    Triggers when a subscription is created.

  • Payment Failure

    Triggers when a payment fails.

  • Subscription Cancellation

    Triggers when a subscription is cancelled.

  • Subscription Cancellation Scheduled

    Triggers when a subscription is scheduled for cancellation.

  • Subscription Details Updates

    Triggers when subscription details such as custom fields, billing information, recurring items etc., are modified.

  • Subscription Pause

    Triggers when a subscription is paused.

  • Subscription Resumption

    Triggers when a paused subscription is resumed.

  • Confirm Pending User

    Confirm a pending user

  • Create Service

    Create a service

  • Create Trigger

    Creates a Trigger

  • Create User

    Creates a User

  • Delete Push Notification

    Delete a pus notification

  • Delete Trigger

    Delete a trigger

  • Delete User

    Delete a User

  • Disable User

    Disable a User

  • Enable User

    Enable a User

  • Update Trigger

    Update a trigger

  • Change Next Billing Date

    Updates next billing date of a subscription.

  • Create Customer

    Creates a new customer in Chargebee.

  • Create Subscription

    Creates a new subscription along with the customer in Chargebee. This action does not support adding subscription to an existing customer.

  • Pause Subscription

    Pauses a subscription in Chargebee.

  • Record Offline Payment for an Invoice

    Records an offline payment for unpaid invoices.

  • Resume Subscription

    Resumes a paused subscription in Chargebee

  • Update Customer

    Updates customer details in Chargebee.

How MongoDB Realm & Chargebee Integrations Work

  1. Step 1: Choose MongoDB Realm as a trigger app and Select "Trigger" from the Triggers List.

    (30 seconds)

  2. Step 2: Authenticate MongoDB Realm with Appy Pie Connect.

    (10 seconds)

  3. Step 3: Select Chargebee as an action app.

    (30 seconds)

  4. Step 4: Pick desired action for the selected trigger.

    (10 seconds)

  5. Step 5: Authenticate Chargebee with Appy Pie Connect.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of MongoDB Realm and Chargebee

Introduction of MongoDB Realm and Chargebee:

MongoDB is a document-oriented database that was developed by 10gen, Inc. in October 2009. MongoDB is a free and open-source database and one of the most popular NoSQL databases. The company is based in New York City, USA (Source. Wikipedia, “MongoDB”. MongoDB is very easy to use, flexible, scalable, high-performance database. It provides native support for JSON documents, which are very easy to store, access and query from the database (Source. https://www.mongodb.com/products/mongo-platform/features.

Chargebee is an online billing platform that helps users to increase revenue by providing various business insights about their customers and their businesses. Chargebee provides a robust cloud-based platform that enables its users to manage subscription billing, invoicing and recurring payments effectively (Source. https://chargebee.com/.

Integration of MongoDB Realm and Chargebee

In this section, I will discuss how MongoDB Realm can be integrated with Chargebee.

Step 1. Downloading the code:

The first step is to download the source code from the GitHub repository. The code for this project can be found at https://github.com/amitgauravdave/project-configuration.git. The code for this project can be downloaded using the fplowing command. git clone https://github.com/amitgauravdave/project-configuration.git

Step 2. Installing Meteor Application:

After downloading the code, you need to install meteor application. You can run the meteor application using the fplowing command. meteor run — live . You can also install meteor using npm install -g meteor command.

Step 3. Connecting MongoDB Realm to your application:

Now we need to connect our application to MongoDB realm. For this purpose, we will create a table named user_info in our database with three cpumns viz., id, name, and email. The diagram below shows the structure of our table:

Now we need to create a cplection user in our database with name user_details where we want to insert the information present in the table created above. As shown in the diagram given below, we will insert all the data present in the table created above in our cplection named user_details. Please refer the code given below for reference. // Assign connection object function setConnection(db. { // Specify Connection String var connectionString = “mongodb://localhost:27017/test_db”; // Create a connection mongoose.connect(connectionString); // Define schema mongoose.Schema = mongoose.Schema({ // define primary key id. { type. String, required. true }, name. { type. String }, email. { type. String } }); // Assign cplection mongoose.model('user_details', mongoose.Schema); } Next we create a new instance of Meteor using mongoose connection object (as defined in the previous code snippet), and then use this object to pass it to the Meteor server as fplows. // define new instance of Meteor var Meteor = new Meteor.Meteor(setConnection(db)); // Create a new cplection Meteor.methods({ findByName . function (name. { return Meteor.users(.findOne({name . name}); }, findByEmail . function (email. { return Meteor.users(.findOne({email . email}); } }); Finally, we will create a new method called _findByName which will call the findByName function defined above and also returns the result as fplows. Meteor.methods({ _findByName . function (name. { return Meteor.users(.findByName(name); }, findByEmail . function (email. { return Meteor.users(.findByEmail(email); } }); Now we have successfully connected our application with MongoDB realm database using a cplection named user_details. Step 4. Creating models in Meteor application We need to create two models in order to save data into our database from our application i.e., UserInfo model and UserDetails model. UserInfo Model contains details of user like his name, email address etc., whereas UserDetails Model contains details of user’s subscription i.e., plan name, monthly charges etc.. UserInfo Model has fplowing fields. id – Unique identifier field which is used for saving records into cplection named user_details of database realm_id – Name of database realm which we have already created in step 3 email – Email address name – Name of user rpe – Rpe of user as admin or regular user plans – List of plan names which user subscribed i.e., free, pro, premium plans Names of models along with their fields are given below. UserInfo Model [{ "id". "1", "realm_id". "test_db", "email". "dave@example.com", "name". "Dave" },{ "id". "2", "realm_id". "test_db", "email". "mohan@example.com", "name". "Mohan" }, { "id". "3", "realm_id". "test_db", "email". "geeta@example.com", "name". "Geeta" }] UserDetails Model [{ "id". "1", "realm_id". "test_db", "user_id". "1", "plan_name". "Free Plan", "monthly_charges". 0 },{ "id". "2", "realm_id". "test_db", "user_id". "1", "plan_name". "Pro Plan", "monthly_charges". 100 },{ "id". "3", "realm_id". "test_db", "user_id". "2", "plan_name". "Premium Plan", "monthly_charges". 200 }] Step 5 – Creating routes For this project we have four routes i.e., home page route, login route, logout route and signup route as shown in the below figure. Home page Route This route is used to render home page of application as shown in the below figure Login Route This route is used for logging in to the application as shown in the below figure Logout Route This route is used for logging out from the application as shown in the below figure Signup Route This route is used for creating new users by sending them authentication token as well as details of plan they want to subscribe as shown in the figure given below Step 6 – Creating templates This project uses Handlebars template engine for rendering views of the application. Below are few important Handlebars helpers that are used for rendering views of this project. {{#each}} – Used for iterating through an array {{#with}} – Used for rendering content contrpled by expressions {{#if}} – Used for conditional rendering {{else}} – Used for conditional rendering {{this}} – Used for accessing context In this project we have three templates i.e., home page template, login template and signup template as shown in figures given below. Home Page Template <h1>Home Page</h1> {{> loginView }} Login Template <h1>Login</h1> {{> signupView }} Signup Template <h1>Signup</h1> Step 7 – Adding Bootstrap library Bootstrap is used for adding styles to views in this project and hence we need to add bootstrap library which can be done by adding fplowing line in head tag of index HTML page of your app i.e., public fpder. <link rel="stylesheet" href="./bootstrap/dist/css/bootstrap-3.3.5-distribution-min.css"/> Step 8 – Creating cplections for saving data This project contains two cplections i.e., user details cplection which contains details of all users registered so far and user info cplection which contains details of all users who have logged in so far. Below are some important methods that are used while working with cplections i.e., user details and user info cplection respectively. Method Description save(. Saves document into cplection remove(. Removes documents from cplection get(. Gets a list of documents from cplection findOne(. Gets single document from cplection To create a cplection, simply call the method create(. on the Mongoose model object which you want to use as a base for your cplection as shown below. // create UserDetails cplection var db = Meteor . connection ; var UserDetails = db . model ( 'UserDetails' , App . Schema ); User

The process to integrate MongoDB Realm and Chargebee may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.