1. Go to this page and download the library: Download apextechnology/tidybill library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
apextechnology / tidybill example snippets
use ApexTechnology\TidyBill\TidyBillClient;
$client = new TidyBillClient(
token: 'your-api-token',
companyId: 'your-company-id',
baseUrl: 'https://tidybill.app', // optional, this is the default
);
use GuzzleHttp\Client;
$client = new TidyBillClient(
token: 'your-api-token',
companyId: 'your-company-id',
httpClient: new Client(['timeout' => 10]),
);
use ApexTechnology\TidyBill\TidyBillClient;
$client = app(TidyBillClient::class);
use ApexTechnology\TidyBill\DTOs\CreateInvoiceData;
use ApexTechnology\TidyBill\DTOs\LineItemData;
$invoice = $client->createInvoice(new CreateInvoiceData(
clientId: '42',
issueDate: '2026-05-01',
currency: 'ZAR',
notes: 'Net 30',
lineItems: [
new LineItemData(description: 'API usage', quantity: 100, unitPrice: 1.50),
new LineItemData(description: 'Support hours', quantity: 2, unitPrice: 350.00),
],
));
echo $invoice->id; // int
echo $invoice->status; // 'draft'
echo $invoice->total; // float (in the currency's major unit)
use ApexTechnology\TidyBill\DTOs\LineItemData;
// Single item
$lineItem = $client->addLineItem(invoiceId: $invoice->id, item: new LineItemData(
description: 'Extra usage',
quantity: 50,
unitPrice: 0.80,
));
// Multiple items (sequential API calls)
$results = $client->addLineItems(invoiceId: $invoice->id, items: [
new LineItemData(description: 'Item A', quantity: 1, unitPrice: 100.00),
new LineItemData(description: 'Item B', quantity: 3, unitPrice: 25.00),
]);