- Documentation
- Create Invoice & Client
Create Invoice
Create an invoice in Axonomy using the API webhook endpoint.
Endpoint
POST /api/invoices/webhook
Headers
Name | Type | Required | Description |
---|---|---|---|
Authorization | string | Yes | Bearer token containing your API key |
Request Body
Request Type
{
// Required fields
customer: {
name: string;
address: string;
city: string;
postalCode: string;
country: string;
email?: string;
phone?: string;
nip?: string;
};
items: Array<{
name: string;
quantity: number;
price: number;
description?: string;
}>;
// Optional fields
date?: string; // Defaults to current date
dueDate?: string; // Defaults to 14 days from now
language?: string; // Defaults to 'en'
currency?: string; // Defaults to 'EUR'
timezone?: string; // Defaults to 'Europe/Warsaw'
status?: 'pending' | 'paid' | 'overdue' | 'cancelled'; // Defaults to 'pending'
type?: 'invoice' | 'quote' | 'receipt'; // Defaults to 'invoice'
// Shipping information (optional)
shipping?: {
company?: string;
name?: string;
address?: string;
city?: string;
postalCode?: string;
country?: string;
phone?: string;
email?: string;
nip?: string;
costs?: number;
};
// Payment details (optional)
payment?: {
IBAN?: string;
BIC?: string;
bank?: string;
statement?: string;
};
// Tax and discount settings (optional)
taxRate?: number; // Defaults to 0
includeShippingInTax?: boolean; // Defaults to false
discounts?: Array<{
type: 'percentage' | 'fixed';
value: number;
description?: string;
}>;
metadata?: {
header?: Array<{
key: string;
value: string;
}>;
logo?: string; // URL to logo image
};
}
Response
{
success: boolean;
invoiceId: string;
message: string;
}
Example Request
file.js
const response = await fetch('https://api.axonomy.com/api/invoices/webhook', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-api-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer: {
name: 'Acme Corp',
address: '123 Business St',
city: 'Tech City',
postalCode: '12345',
country: 'United States',
email: 'billing@acme.com'
},
items: [
{
name: 'Web Development',
quantity: 1,
price: 1000,
description: 'Frontend development services'
}
],
currency: 'USD',
taxRate: 20,
payment: {
IBAN: 'DE89370400440532013000'
}
})
});
const data = await response.json();
Error Codes
Status Code | Description |
---|---|
401 | Invalid or expired API key |
400 | Missing required fields |
402 | Invoice limit exceeded |
500 | Server error |
Notes
- The API key must be active and not expired
- Invoice numbers are automatically generated
- All monetary values should be provided in the smallest currency unit (cents)
- Dates should be provided in ISO 8601 format
- The API automatically includes your company details from your Axonomy profile
- Invoice templates are limited to 'corporate' or 'monospace'
- The free tier has limited invoice generation capacity
Rate Limits
- Free tier: Limited to 3 invoices per month
- Freelancer tier: Limited to 10 invoices per month
- Enterprise tier: Unlimited invoices
For more information about pricing and limits, visit our pricing page.