Invoices
Create, manage, and send professional invoices.
GET
/v1/invoicesRetrieve a list of invoices.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
limit | integer | Items per page (default: 20) |
status | string | Filter: draft, sent, paid, overdue, cancelled |
customer_email | string | Filter by customer email |
Request
bash
curl -X GET "https://api.peeap.com/api/v1/invoices?status=sent" \
-H "X-API-Key: sk_live_your_api_key"Response
json
{
"success": true,
"data": [
{
"id": "inv_abc123",
"invoice_number": "INV-2025-0001",
"status": "sent",
"customer_name": "Acme Corporation",
"customer_email": "billing@acme.com",
"subtotal": 1000.00,
"tax_amount": 100.00,
"total": 1100.00,
"currency": "SLE",
"due_date": "2025-02-15",
"items": [
{
"description": "Web Development Services",
"quantity": 10,
"unit_price": 100.00,
"total": 1000.00
}
],
"created_at": "2025-01-15T10: 00: 00.000Z",
"sent_at": "2025-01-15T10: 30: 00.000Z"
}
],
"meta": {
"page": 1,
"limit": 20,
"total": 85,
"has_next_page": true
}
}POST
/v1/invoicesCreate a new invoice.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
customer_name | string | Yes | Customer or company name |
customer_email | string | Yes | Customer email address |
items | array | Yes | Array of invoice line items |
due_date | string | No | Due date (YYYY-MM-DD) |
tax_rate | number | No | Tax percentage (default: 15 for GST) |
currency | string | No | Currency code (default: SLE) |
Request
bash
curl -X POST "https://api.peeap.com/api/v1/invoices" \
-H "X-API-Key: sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"customer_name": "Acme Corporation",
"customer_email": "billing@acme.com",
"items": [
{
"description": "Web Development Services",
"quantity": 10,
"unit_price": 100.00
},
{
"description": "Hosting (Monthly)",
"quantity": 1,
"unit_price": 50.00
}
],
"due_date": "2025-02-15",
"tax_rate": 15,
"notes": "Thank you for your business!"
}'GET
/v1/invoices/:idRetrieve a single invoice by ID.
bash
curl -X GET "https://api.peeap.com/api/v1/invoices/inv_abc123" \
-H "X-API-Key: sk_live_your_api_key"PATCH
/v1/invoices/:idUpdate a draft invoice. Sent invoices cannot be modified.
bash
curl -X PATCH "https://api.peeap.com/api/v1/invoices/inv_abc123" \
-H "X-API-Key: sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"due_date": "2025-02-28",
"notes": "Updated payment terms"
}'POST
/v1/invoices/:id/sendSend an invoice to the customer via email. The invoice status will change to "sent".
Request Body (Optional)
| Field | Type | Description |
|---|---|---|
cc | string[] | CC email addresses |
message | string | Custom email message |
bash
curl -X POST "https://api.peeap.com/api/v1/invoices/inv_abc123/send" \
-H "X-API-Key: sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"cc": ["accounting@yourcompany.com"],
"message": "Please find attached your invoice for January services."
}'