Invoices

Create, manage, and send professional invoices.

GET/v1/invoices

Retrieve a list of invoices.

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20)
statusstringFilter: draft, sent, paid, overdue, cancelled
customer_emailstringFilter 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/invoices

Create a new invoice.

Request Body

FieldTypeRequiredDescription
customer_namestringYesCustomer or company name
customer_emailstringYesCustomer email address
itemsarrayYesArray of invoice line items
due_datestringNoDue date (YYYY-MM-DD)
tax_ratenumberNoTax percentage (default: 15 for GST)
currencystringNoCurrency 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/:id

Retrieve 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/:id

Update 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/send

Send an invoice to the customer via email. The invoice status will change to "sent".

Request Body (Optional)

FieldTypeDescription
ccstring[]CC email addresses
messagestringCustom 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."
  }'