Skip to content

Latest commit

 

History

History
160 lines (112 loc) · 4.25 KB

InvoicesApi.md

File metadata and controls

160 lines (112 loc) · 4.25 KB

BillaBear.InvoicesApi

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

Method HTTP request Description
chargeInvoice POST /invoice/{invoiceId}/charge Charge Invoice
downloadInvoice GET /invoice/{invoiceId}/download Download Invoice
getInvoicesForCustomer GET /customer/{customerId}/invoices List Customer Invoices

chargeInvoice

InlineResponse20014 chargeInvoice(invoiceId)

Charge Invoice

Attempts to charge a card that is on file for the invoice amount

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let 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 = 'Token';

let apiInstance = new BillaBear.InvoicesApi();
let invoiceId = "invoiceId_example"; // String | The id of the invoice

apiInstance.chargeInvoice(invoiceId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
invoiceId String The id of the invoice

Return type

InlineResponse20014

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

downloadInvoice

'Blob' downloadInvoice(invoiceId)

Download Invoice

Returns the pdf blob for the invoice

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let 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 = 'Token';

let apiInstance = new BillaBear.InvoicesApi();
let invoiceId = "invoiceId_example"; // String | The id of the invoice

apiInstance.downloadInvoice(invoiceId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
invoiceId String The id of the invoice

Return type

'Blob'

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/pdf

getInvoicesForCustomer

InlineResponse2006 getInvoicesForCustomer(customerId)

List Customer Invoices

List Customer Invoices

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let 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 = 'Token';

let apiInstance = new BillaBear.InvoicesApi();
let customerId = "customerId_example"; // String | The id of the customer to retrieve

apiInstance.getInvoicesForCustomer(customerId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
customerId String The id of the customer to retrieve

Return type

InlineResponse2006

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json