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 |
InlineResponse20014 chargeInvoice(invoiceId)
Charge Invoice
Attempts to charge a card that is on file for the invoice amount
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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| invoiceId | String | The id of the invoice |
- Content-Type: Not defined
- Accept: application/json
'Blob' downloadInvoice(invoiceId)
Download Invoice
Returns the pdf blob for the invoice
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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| invoiceId | String | The id of the invoice |
'Blob'
- Content-Type: Not defined
- Accept: application/pdf
InlineResponse2006 getInvoicesForCustomer(customerId)
List Customer Invoices
List Customer Invoices
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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| customerId | String | The id of the customer to retrieve |
- Content-Type: Not defined
- Accept: application/json