Manage your Billit API integration and test connectivity
You need to authorize this application with Billit to use the API.
Use these endpoints in your old PHP system:
<?php
// Example usage in your old PHP system
$apiUrl = 'https://billit-bb.redbit.be/api/billit/invoices';
$apiKey = 'your_secure_api_key_here';
$customerData = [
'name' => 'John Doe',
'email' => 'john.doe@example.com',
'phone' => '+32 123 456 789',
'address' => [
'street' => 'Main Street 123',
'city' => 'Brussels',
'postal_code' => '1000',
'country' => 'BE'
]
];
$invoiceData = [
'reference' => 'INV-2024-001',
'description' => 'Web development services',
'lines' => [
[
'description' => 'Website development',
'quantity' => 1,
'unit_price' => 1500.00,
'vat_rate' => 21
]
]
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $apiUrl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'customer' => $customerData,
'invoice' => $invoiceData
]),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: ' . $apiKey,
'Accept: application/json'
],
CURLOPT_TIMEOUT => 30,
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$result = json_decode($response, true);
echo "Invoice created: " . $result['data']['invoice']['id'];
} else {
echo "Error: " . $response;
}
?>