55min

Chargebee Subscriptions

Introduction

Chargebee is a subscription management system that can help you handle all the aspects of the subscription life cycle including recurring billing, invoicing, and trial management for your customers.

How to setup

  1. Create Chargebee account https://www.chargebee.com/trial-signup/
  2. Go to Settings -> Configure Chargebee
Document image



​3. Go to API keys​

Document image



4. Press Add API Key​

Document image

​5. Create Full-Access Key​

Document image



6. Set the name of API Key​

Document image



7. Copy API Key​

Document image



8. Place this API Key in Plugin fields​

Document image

Plugin Element Proprietes

Chargebee Card Input- use Chargebee Components to collect card details. Chargebee Components are iframe-based input fields.

Element fields ⚙

Document image



Document image



Document image



  • Site - text, Required.

Your Site name. The site name can be obtained from the link from your Chargebee page.​

Document image



  • Domain - text, Required if the custom domain is enabled.

Your custom domain. Example: https://billing.yourdomain.com​

  • Number - text. Optional.

Custom text for card number placeholder.​

  • Expiry - text. Optional.

Custom text for card expiry placeholder.​

  • CVV - text. Optional.

Custom text for card cvv expiry placeholder.​

  • Placeholder Color - color. Optional.

Color of placeholder text.​

  • Icon Color - color. Optional.

Color of card image in input.​

  • publishableKey - text. Required.

How to get Publishable Key:

  1. Go to Settings -> Configure Chargebee
Document image



3. Go to API keys​

Document image



​4. Press Add API Key​

Document image



​5. Create Publishable Key

Document image

​6. Check all checkboxes and set a name for this key​

Document image



7. Copy this key and put it in the element field​

Document image
  • Type - Fields mode or Default mode. Required.

Fields mode

Document image

​Default mode

Document image

Element actions ⚙

Generate token - generate a token with data about the card. Return token value in Card Token state.

Clear token - delete token from Card Token state.

Element events ⚙

Token Is Generated - is triggered when action Generate token is executed and the token is written in Card Token state.

Error In Token Generation - is triggered when an action Generate token has an error. Error text is written in the Token Generation Error state.

Error in input - is triggered when an input value is not valid. Error text is written in Error in input state.

Element states ⚙

Card Token - contains token generated by an action Generate token.

Token Generation Error - contains error text in the token generation.

Error in input - contains error text from invalid input.

Plugin actions

1. ChargeBee - Get Item Price

Get a list of all prices and item_id and return item_price_id.​

Document image



Action Fields

Item ID - text, required. ID of Chargebee item.

List of prices - List of things returned by API Call List item prices, required.​

2. ChargeBee - Generate Sort Query For ...

We have 4 actions with the same name and different things. These actions generate a special Chargebee sort query. Chargebee filtering info.

3. ChargeBee - Generate Query For Buing

This action gets a list of things where represent a bucket and using additional options ( read about Buy query ) generates a correct query.

Document image

Plugin API Calls

The site name, for the your_site field can be obtained from the link from your Chargebee page.​

Document image



1. Create a customer

This API call creates a new customer in Chargebee.​

Document image
Document image
Document image



​About Create customer fields (customer attributes and sample of customer JSON) see Chargebee docs.

2. List of customers

This API call return list of your customers.​

Document image



About List of customers fields (samples of JSON request and response, and input parameters) see Chargebee docs.

3. Retrieve Customer

Return information about a customer.​

Document image



About Retrieve Customer fields (samples of JSON request and response, and input parameters) see Chargebee docs.

4. Update Customer (No Billing)

Update data of customer excluding billing data.​

Document image
Document image
Document image



About Update Customer (No Billing) fields (samples of JSON request and response, and input parameters) see Chargebee docs.

5. Update Customer (Billing Data)

This method is used for updating the 'Billing Info' - the Billing Address and 'vat_number' attributes - of the customer.​

Document image
Document image



About Update Customer ( Billing Data ) fields (samples of JSON request and response, and input parameters) see Chargebee docs.

6. Create a card payment source via token for a customer

Add a card payment source to a customer using Chargebee.js token​

Document image



About Create a card payment source via token for customer fields (samples of JSON request and response, and input parameters) see Chargebee docs.

7. Create a bank account payment source for a customer

This API adds a Direct Debit payment source for a customer.​

Document image
Document image



About Create a bank account payment source for customer fields (samples of JSON request and response, and input parameters) see Chargebee docs.

8. List items

Returns a list of items satisfying all the conditions specified in the filter parameters below. ​

Document image

Abou List items fields (samples of JSON request and response, and input parameters) see Chargebee docs.

9. Retrieve An Item

Retrieve an item resource.​

Document image



About Retrieve An Item fields (samples of JSON request and response) see Chargebee docs.

10. List item prices

An item price is a price point for an item.​

Document image



About List item prices fields (samples of JSON request and response, and input parameters) 11 see Chargebee docs.

11. Retrieve Item Price

Retrieve a specific item price.​

Document image



About Retrieve Item Price fields (samples of JSON request and response) see Chargebee docs.

12. Create Subscription For Items

Creates a new subscription for an existing customer in Chargebee.​

Document image
Document image
Document image
Document image

About Create Subscription For Items fields (samples of JSON request and response, and input parameters) see Chargebee docs.

13. Cancel subscription for items

Cancels the subscription.​

Document image

About Cancel subscription for items fields (samples of JSON request and response, and input parameters) see Chargebee docs.

14. Pause subscription

Pausing a subscription will move the subscription from its current state to Paused state, and will stop all recurring actions.

Document image



About Pause subscription fields (samples of JSON request and response, and input parameters) see Chargebee docs.

15. Resume subscription

This API is used to resume a paused subscription.​

Document image

About Resume subscription fields (samples of JSON request and response, and input parameters) see Chargebee docs.

16. List subscriptions

Returns a list of subscriptions meeting all the conditions specified in the filter parameters below.​

Document image



About List subscriptions fields (samples of JSON request and response, and input parameters) see Chargebee docs.

17. Retrieve subscription

Retrieves a subscription.

Document image



​About Retrieve subscription fields (samples of JSON request and response, and input parameters) see Chargebee docs.

18. Update a card payment source

Update card details.​

Document image



About Update a card payment source fields (samples of JSON request and response, and input parameters) see Chargebee docs.

19. Delete a payment source

Deletes a payment source.

Document image



About Delete a payment source fields (samples of JSON request and response) see Chargebee docs.

20. Delete subscription

Deletes the subscription resource.

Document image



About Delete a payment source fields (samples of JSON request and response) see Chargebee docs.

21. Delete customer

Deletes the customer resource.

Document image

About Delete a payment source fields (samples of JSON request and response) see Chargebee docs.​​

Demo to preview the settings



Updated 18 Apr 2022
Did this page help?
Yes
No