Loading..

API Reference

Getting your subscription business up and running with Chargebee is a breeze with our sleek and powerful API.

Jump right in into API Docs
curl  https://supercharge-test.chargebee.com/api/v1/subscriptions \
    -u test_XFZWh2otngDtKBLglQfqknrrTVcuft7Mj: \
    -d customer[email]="[email protected]" \
    -d customer[first_name]="John" \
    -d customer[last_name]="Doe" \
    -d customer[phone]="+1-949-999-9999" \
    -d plan_id="spacebox-spaceplan-10-boxes" \
    -d plan_quantity="5"
        
require 'ChargeBee.php';
ChargeBee_Environment::configure("supercharge-test","test_XFZWh2otngDtKBLglQfqknrrTVcuft7Mj");
$result = ChargeBee_Subscription::create(array(
"customer" => array(
    "email" => "[email protected]",
    "firstName" => "John",
    "lastName" => "Doe",
    "phone" => "+1-949-999-9999"
),
"planId" => "spacebox-spaceplan-10-boxes",
"planQuantity" => 5
));
$subscription = $result->subscription();
$customer = $result->customer();
        
require 'chargebee'
ChargeBee.configure(:site => "supercharge-test",
:api_key => "test_XFZWh2otngDtKBLglQfqknrrTVcuft7Mj")
result = ChargeBee::Subscription.create({
:customer => {
    :email => "[email protected]",
    :first_name => "John",
    :last_name => "Doe",
    :phone => "+1-949-999-9999"
},
:plan_id => "spacebox-spaceplan-10-boxes",
:plan_quantity => "5"
})
subscription = result.subscription
customer = result.customer
        
chargebee.configure("test_XFZWh2otngDtKBLglQfqknrrTVcuft7Mj", "supercharge-test")
result = chargebee.Subscription.create({
    "plan_id" : "spacebox-spaceplan-10-boxes",
    "plan_quantity" : 5,
    "customer" : {
        "email" : "[email protected]",
        "first_name" : "John",
        "last_name" : "Doe",
        "phone" : "+1-949-999-9999"
    }
})
subscription = result.subscription
customer = result.customer
        
Environment.configure("supercharge-test","test_XFZWh2otngDtKBLglQfqknrrTVcuft7Mj");
Result result = Subscription.create()
    .planId("spacebox-spaceplan-10-boxes")
    .planQuantity(5)
    .customerEmail("[email protected]")
    .customerFirstName("John")
    .customerLastName("Doe")
    .customerPhone("+1-949-999-9999")
    .request();
Subscription subscription = result.subscription();
Customer customer = result.customer();
        
ApiConfig.Configure("supercharge-test","test_XFZWh2otngDtKBLglQfqknrrTVcuft7Mj");
EntityResult result = Subscription.Create()
    .PlanId("spacebox-spaceplan-10-boxes")
    .PlanQuantity(5)
    .CustomerEmail("[email protected]")
    .CustomerFirstName("John")
    .CustomerLastName("Doe")
    .CustomerPhone("+1-949-999-9999")
    .Request();
Subscription subscription = result.Subscription;
Customer customer = result.Customer;
        
var chargebee = require("chargebee");
chargebee.configure({site : "supercharge-test",  api_key : "test_XFZWh2otngDtKBLglQfqknrrTVcuft7Mj"});
chargebee.subscription.create({
plan_id : "spacebox-spaceplan-10-boxes",
plan_quantity : 5,
customer : {
    email : "[email protected]",
    first_name : "John",
    last_name : "Doe",
    phone : "+1-949-999-9999"
}
}).request(function(error, result){
if(error){
    console.log(error);
} else{
    console.log(result);
    var subscription = result.subscription;
    var customer = result.customer;
    var card = result.card;
    var invoice = result.invoice;
}
})
        

Client libraries

It’s not a good feeling to be lost in translation. That’s why Chargebee supports a number of client libraries for you to work with.

.Net
PHP
Ruby
Node.js
Python
Java

API integration tutorials

Need results fast? Chargebee’s integration tutorials will help you work some API magic.

New You can now Filter and Sort the results of your 'list' API requests.