API Reference
v1Complete reference for the InvoiceFlow REST API. Build powerful integrations with invoices, customers, products, and more.
Getting Started
Endpoints
Authentication
All API requests require a Bearer token in the Authorization header. Generate your API key from Settings.
curl https://invoiceflow.cc/api/v1/invoices \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
const response = await fetch('https://invoiceflow.cc/api/v1/invoices', {
headers: {
'Authorization': `Bearer ${apiKey}`,
'Accept': 'application/json'
}
});
const data = await response.json();
$response = Http::withToken($apiKey)
->accept('application/json')
->get('https://invoiceflow.cc/api/v1/invoices');
$invoices = $response->json();
Rate Limits
Response Headers
| Header | Description |
|---|---|
X-RateLimit-Limit |
Maximum requests allowed per window |
X-RateLimit-Remaining |
Requests remaining in current window |
X-RateLimit-Reset |
Unix timestamp when the rate limit resets |
Error Handling
All errors return a consistent JSON structure with helpful messages.
{
"success": false,
"error": "validation_error",
"message": "The given data was invalid.",
"errors": {
"email": ["The email field is required."]
}
}
HTTP Status Codes
Invoices
/api/v1/invoices
List all invoices
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status |
string | Filter by status: draft, sent, paid, overdue |
search |
string | Search by invoice number or customer name |
per_page |
integer | Results per page (default: 15, max: 100) |
Example Request
curl https://invoiceflow.cc/api/v1/invoices?status=sent \
-H "Authorization: Bearer YOUR_API_KEY"
Response 200
{
"success": true,
"data": [
{
"id": 1,
"invoice_number": "INV-0001",
"status": "sent",
"customer": {
"id": 1,
"name": "Acme Corp"
},
"total": 1500.00,
"currency": "USD",
"due_date": "2025-02-15"
}
],
"meta": {
"current_page": 1,
"total": 25
}
}
/api/v1/invoices
Create an invoice
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
customer_id |
integer | * | Customer ID |
issue_date |
date | * | Invoice date (YYYY-MM-DD) |
due_date |
date | * | Payment due date |
items |
array | * | Array of line items |
items[].description |
string | * | Item description |
items[].quantity |
number | * | Quantity |
items[].unit_price |
number | * | Price per unit |
notes |
string | Additional notes |
Example Request
curl -X POST https://invoiceflow.cc/api/v1/invoices \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_id": 1,
"issue_date": "2025-01-15",
"due_date": "2025-02-15",
"items": [
{
"description": "Web Development",
"quantity": 40,
"unit_price": 150
}
],
"notes": "Thank you!"
}'
Response 201
{
"success": true,
"data": {
"id": 42,
"invoice_number": "INV-0042",
"status": "draft",
"customer_id": 1,
"subtotal": 6000.00,
"tax": 0,
"total": 6000.00,
"issue_date": "2025-01-15",
"due_date": "2025-02-15",
"created_at": "2025-01-15T10:30:00Z"
},
"message": "Invoice created"
}
/api/v1/invoices/{id}
Get invoice details
Example Request
curl https://invoiceflow.cc/api/v1/invoices/42 \
-H "Authorization: Bearer YOUR_API_KEY"
Response 200
{
"success": true,
"data": {
"id": 42,
"invoice_number": "INV-0042",
"status": "sent",
"customer": { ... },
"items": [ ... ],
"total": 6000.00
}
}
/api/v1/invoices/{id}
Update an invoice
Update invoice details. Cannot modify paid or cancelled invoices.
/api/v1/invoices/{id}
Delete an invoice
Soft delete an invoice. Cannot delete paid invoices.
/api/v1/invoices/{id}/send-email
Send invoice via email
Example Request
curl -X POST https://invoiceflow.cc/api/v1/invoices/42/send-email \
-H "Authorization: Bearer YOUR_API_KEY"
Response 200
{
"success": true,
"message": "Invoice sent to [email protected]"
}
/api/v1/invoices/{id}/send-payment-link
Send Stripe payment link
Generate and send a Stripe payment link. Requires Stripe Connect to be configured.
Customers
/api/v1/customers
List all customers
Example Request
curl https://invoiceflow.cc/api/v1/customers \
-H "Authorization: Bearer YOUR_API_KEY"
Response 200
{
"success": true,
"data": [
{
"id": 1,
"company_name": "Acme Corp",
"contact_name": "John Doe",
"email": "[email protected]",
"total_invoiced": 15000.00
}
]
}
/api/v1/customers
Create a customer
Example Request
curl -X POST https://invoiceflow.cc/api/v1/customers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"company_name": "Acme Corp",
"contact_name": "John Doe",
"email": "[email protected]",
"phone": "+1 555-0100"
}'
Response 201
{
"success": true,
"data": {
"id": 15,
"company_name": "Acme Corp",
"contact_name": "John Doe",
"email": "[email protected]"
},
"message": "Customer created"
}
/api/v1/customers/{id}
Get customer details
Retrieve customer with their recent invoices and payment history.
/api/v1/customers/{id}
Update a customer
/api/v1/customers/{id}
Delete a customer
Delete a customer. Fails if customer has unpaid invoices.
Products
/api/v1/products
List all products
Query params: search, type (product/service), active
/api/v1/products
Create a product
Example Request
curl -X POST https://invoiceflow.cc/api/v1/products \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "service",
"name": "Web Development",
"price": 150.00,
"unit": "hour"
}'
Response 201
{
"success": true,
"data": {
"id": 8,
"type": "service",
"name": "Web Development",
"price": 150.00,
"unit": "hour"
}
}
/api/v1/products/{id}
/api/v1/products/{id}
/api/v1/products/{id}/adjust-stock
Adjust inventory
{ "adjustment": -5, "reason": "Sold to customer" }
Estimates
/api/v1/estimates
List estimates
Query params: status (draft/sent/approved/rejected/converted), search
/api/v1/estimates
Create estimate
/api/v1/estimates/{id}
/api/v1/estimates/{id}/convert-to-invoice
Convert to invoice
Example Request
curl -X POST https://invoiceflow.cc/api/v1/estimates/5/convert-to-invoice \
-H "Authorization: Bearer YOUR_API_KEY"
Response 201
{
"success": true,
"data": {
"invoice_id": 43,
"invoice_number": "INV-0043"
},
"message": "Estimate converted to invoice"
}
Teams
/api/v1/teams
List your teams
{
"success": true,
"data": [
{
"id": 1,
"name": "My Company",
"is_current": true,
"is_owner": true,
"role": "admin",
"plan": { "name": "Business" }
}
]
}
/api/v1/teams/current
Get current team
All API calls operate in the context of your current team.
/api/v1/teams/switch
Switch team
Request Body
{ "team_id": 2 }
Response 200
{
"success": true,
"message": "Switched to Another Team",
"data": { "id": 2, "name": "Another Team" }
}
Need help with integration?
Our team is here to help you build powerful integrations.