Skip to content

billabear/javascript-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BillaBear Javascript SDK

Installation & Usage

npm install billabear --save

Getting Started

Please follow the installation instruction and execute the following JS code:

var BillaBear = require('billa_bear');
var defaultClient = BillaBear.ApiClient.instance;
defaultClient.basePath = 'YOUR API URL'

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['X-API-Key'] = "Token"

var api = new BillaBear.CheckoutApi()
var body = new BillaBear.CheckoutBody(); // {CheckoutBody} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createCheckout(body, callback);

Documentation for API Endpoints

All URIs are relative to https://{customerId}.billabear.cloud/api/v1

Class Method HTTP request Description
BillaBear.CheckoutApi createCheckout POST /checkout Create Checkout
BillaBear.CustomersApi addSeatsSubscriptions POST /subscription/{subscriptionId}/seats/add Add Seats
BillaBear.CustomersApi applyVoucherToCustomer POST /customer/{customerId}/voucher Apply voucher
BillaBear.CustomersApi createCustomer POST /customer Create
BillaBear.CustomersApi disableCustomer POST /customer/{customerId}/disable Disable Customer
BillaBear.CustomersApi enableCustomer POST /customer/{customerId}/enable Enable Customer
BillaBear.CustomersApi getActiveForCustomer GET /customer/{customerId}/subscription/active List Customer Active Subscriptions
BillaBear.CustomersApi getAllCustomers GET /customer List
BillaBear.CustomersApi getCustomerById GET /customer/{customerId} Detail
BillaBear.CustomersApi getCustomerLimitsById GET /customer/{customerId}/limits Fetch Customer Limits
BillaBear.CustomersApi getForCustomer GET /customer/{customerId}/subscription List Customer Subscriptions
BillaBear.CustomersApi getInvoicesForCustomer GET /customer/{customerId}/invoices List Customer Invoices
BillaBear.CustomersApi getPaymentsForCustomer GET /customer/{customerId}/payment List Customer Payments
BillaBear.CustomersApi getRefundsForCustomer GET /customer/{customerId}/refund List Customer Refunds
BillaBear.CustomersApi listPaymentDetails GET /customer/{customerId}/payment-methods List Customer's Payment Details
BillaBear.CustomersApi removeSeatsSubscriptions POST /subscription/{subscriptionId}/seats/remove Remove Seats
BillaBear.CustomersApi updateCustomer PUT /customer/{customerId} Update
BillaBear.InvoicesApi chargeInvoice POST /invoice/{invoiceId}/charge Charge Invoice
BillaBear.InvoicesApi downloadInvoice GET /invoice/{invoiceId}/download Download Invoice
BillaBear.InvoicesApi getInvoicesForCustomer GET /customer/{customerId}/invoices List Customer Invoices
BillaBear.PaymentDetailsApi completeFrontendPaymentDetails POST /customer/{customerId}/payment-methods/frontend-payment-token Complete Frontend Detail Collection
BillaBear.PaymentDetailsApi deletePaymentDetails DELETE /payment-methods/{paymentDetailsId} Delete
BillaBear.PaymentDetailsApi deletePaymentDetailsCustomer DELETE /customer/{customerId}/payment-methods/{paymentDetailsId} Delete With Customer
BillaBear.PaymentDetailsApi getPaymentDetails GET /payment-methods/{paymentDetailsId} Fetch
BillaBear.PaymentDetailsApi listPaymentDetails GET /customer/{customerId}/payment-methods List Customer's Payment Details
BillaBear.PaymentDetailsApi makeDefaultPaymentDetails POST /payment-methods/{paymentDetailsId}/default Make Default
BillaBear.PaymentDetailsApi makeDefaultPaymentDetailsCustomer POST /customer/{customerId}/payment-methods/{paymentDetailsId}/default Make Default With Customer
BillaBear.PaymentDetailsApi startFrontendPaymentDetails GET /customer/{customerId}/payment-methods/frontend-payment-token Start Frontend Detail Collection
BillaBear.PaymentsApi chargeInvoice POST /invoice/{invoiceId}/charge Charge Invoice
BillaBear.PaymentsApi downloadInvoice GET /invoice/{invoiceId}/download Download Invoice
BillaBear.PaymentsApi downloadReceipt GET /receipt/{receiptId}/download Download Receipt
BillaBear.PaymentsApi getInvoicesForCustomer GET /customer/{customerId}/invoices List Customer Invoices
BillaBear.PaymentsApi getPaymentsForCustomer GET /customer/{customerId}/payment List Customer Payments
BillaBear.PaymentsApi listPayment GET /payment List
BillaBear.PaymentsApi refundPayment POST /payment/{paymentId}/refund Refund Payment
BillaBear.PricesApi createPrice POST /product/{productId}/price Create
BillaBear.PricesApi listPrice GET /product/{productId}/price List
BillaBear.ProductsApi createProduct POST /product Create
BillaBear.ProductsApi listProduct GET /product List
BillaBear.ProductsApi showProductById GET /product/{productId} Detail
BillaBear.ProductsApi updateProduct PUT /product/{productId} Update
BillaBear.ReceiptApi downloadReceipt GET /receipt/{receiptId}/download Download Receipt
BillaBear.RefundsApi getRefundsForCustomer GET /customer/{customerId}/refund List Customer Refunds
BillaBear.RefundsApi listRefund GET /refund List
BillaBear.RefundsApi showRefundById GET /refund/{refundId} Detail
BillaBear.SubscriptionsApi addSeatsSubscriptions POST /subscription/{subscriptionId}/seats/add Add Seats
BillaBear.SubscriptionsApi cancelSubscription POST /subscription/{subscriptionId}/cancel Cancel Subscription
BillaBear.SubscriptionsApi changeSubscriptionPrice POST /subscription/{subscriptionId}/price Change Price
BillaBear.SubscriptionsApi createSubscription POST /customer/{customerId}/subscription/start Create Subscription
BillaBear.SubscriptionsApi customerChangeSubscriptionPlan POST /subscription/{subscriptionId}/plan Change Subscription Plan
BillaBear.SubscriptionsApi extendTrial POST /subscription/{subscriptionId}/extend Extend Trial Subscription
BillaBear.SubscriptionsApi getActiveForCustomer GET /customer/{customerId}/subscription/active List Customer Active Subscriptions
BillaBear.SubscriptionsApi getForCustomer GET /customer/{customerId}/subscription List Customer Subscriptions
BillaBear.SubscriptionsApi listSubscriptionPlans GET /subscription/plans List Subscription Plans
BillaBear.SubscriptionsApi listSubscriptions GET /subscription List
BillaBear.SubscriptionsApi removeSeatsSubscriptions POST /subscription/{subscriptionId}/seats/remove Remove Seats
BillaBear.SubscriptionsApi showSubscriptionById GET /subscription/{subscriptionId} Detail
BillaBear.SubscriptionsApi startTrial POST /customer/{customerId}/subscription/trial Start Trial Subscription For Customer

Documentation for Models

Documentation for Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header