GithubHelp home page GithubHelp logo

moesif-chargebee-example's Introduction

Moesif Chargebee Example

An example app integrating Moesif with Chargebee for usage-based billing based Tutorial to Set Up Usage-Based API Billing with Moesif and Chargebee

  • Moesif handles API metering and providing usage metrics to customers
  • Chargebee handles invoicing customers and accepting payments through a gateway like Stripe.

Embedded billing dashboard

This example app does a few things:

  1. Sync Chargebee Subscription info to Moesif
  2. Handle metered billing webhooks of type pending_invoice_created
  3. Calculate the usage by querying Moesif's Management API
  4. Add a line-item charged based on API usage for that customer

How to run this example.

  1. Install all dependencies:
npm install
  1. Set the following environment variables
Environment variable Description
CHARGEBEE_SITE The slug of your Chargebee site which is the subdomain when logging into your dashboard.
CHARGEBEE_API_KEY A Chargebee API key that has at least read access to both subscriptions and customers.
CHARGEBEE_WEBHOOK_USERNAME The username you define when creating a new webhook in Chargebee
CHARGEBEE_WEBHOOK_PASSWORD The password you define when creating a new webhook in Chargebee
MOESIF_APPLICATION_ID Your Moesif Application Id displayed during onboarding and found under the API keys menu in Moesif
MOESIF_MANAGEMENT_API_KEY A generated management API key which has the scope read:events which can be found under the API keys menu in Moesif
  1. Run the example, it will listen on port 5000.
node index.js
  1. Verify the app works:
  • Your Chargebee users and companies will be synced to your Moesif app
  • Set up a Chargebee webhook to the app's endpoint POST /chargebee/webhooks

moesif-chargebee-example's People

Contributors

dgilling avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.