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 |
\BillaBear\Model\InlineResponse20014 chargeInvoice($invoice_id)
Charge Invoice
Attempts to charge a card that is on file for the invoice amount
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$apiInstance = new BillaBear\Api\InvoicesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$invoice_id = "invoice_id_example"; // string | The id of the invoice
try {
$result = $apiInstance->chargeInvoice($invoice_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InvoicesApi->chargeInvoice: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
invoice_id | string | The id of the invoice |
\BillaBear\Model\InlineResponse20014
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string downloadInvoice($invoice_id)
Download Invoice
Returns the pdf blob for the invoice
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$apiInstance = new BillaBear\Api\InvoicesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$invoice_id = "invoice_id_example"; // string | The id of the invoice
try {
$result = $apiInstance->downloadInvoice($invoice_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InvoicesApi->downloadInvoice: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
invoice_id | string | The id of the invoice |
string
- Content-Type: Not defined
- Accept: application/pdf
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\BillaBear\Model\InlineResponse2006 getInvoicesForCustomer($customer_id)
List Customer Invoices
List Customer Invoices
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$apiInstance = new BillaBear\Api\InvoicesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_id = "customer_id_example"; // string | The id of the customer to retrieve
try {
$result = $apiInstance->getInvoicesForCustomer($customer_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InvoicesApi->getInvoicesForCustomer: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
customer_id | string | The id of the customer to retrieve |
\BillaBear\Model\InlineResponse2006
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]