Plugins
Templates

Chargebee Subscriptions

Link to the page: https://zeroqode.com/plugin/chargebee-subscriptions-1626424798466x289870563788640500

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

3. Go to API keys

4. Press Add API Key

5. Create Full-Access Key

6. Set the name of API Key

7. Copy API Key

8. Place this API Key in Plugin fields

Plugin Element Proprietes

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

Element fields

  • Site - text, Required.

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

  • 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

3. Go to API keys

4. Press Add API Key

5. Crate Publishable Key

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

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

  • Type - Fields mode or Default mode. Required.

Fields mode
Default mode
Fields mode
Default mode

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 Errorstate.

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.

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.

Plugin API Calls

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

1. Create a customer

This API call creates a new customer in Chargebee.

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.

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.

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.

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.

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

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.

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.

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

9. Retrieve An Item

Retrieve an item resource.

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.

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.

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.

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.

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.

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.

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.

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

17. Retrieve subscription

Retrieves a subscription.

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.

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.

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

20. Delete subscription

Deletes the subscription resource.

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

21. Delete customer

Deletes the customer resource.

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

Demo to preview the settings