API Documentation
Navigation

Welcome to GenerateInvoice API

The GenerateInvoice API allows you to programmatically create, manage, and send professional invoices, receipts, quotes, and credit notes. Build powerful billing automation into your applications.

Quick Start

Get started with the GenerateInvoice API in minutes. Follow these steps to create your first invoice.

1. Get Your API Key

First, sign up for a GenerateInvoice account and generate an API key from your dashboard. Navigate to Settings → API Keys and click "Create New Key".

Keep your API key secure

Never share your API key or commit it to version control. Use environment variables instead.

2. Make Your First API Call

All API requests must include your API key in the Authorization header.

curl -X POST "https://api.generateinvoice.com/v1/invoices" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "document_type": "invoice",
    "from_details": {
      "name": "Your Company",
      "email": "billing@yourcompany.com",
      "address_line1": "123 Business St",
      "city": "San Francisco",
      "country_code": "US"
    },
    "to_details": {
      "name": "Customer Name",
      "email": "customer@example.com"
    },
    "line_items": [
      {
        "description": "Consulting Services",
        "quantity": 10,
        "unit_price": 150.00,
        "unit": "hours"
      }
    ],
    "currency": "USD"
  }'

3. Understand the Response

A successful API call returns a JSON response with the created invoice:

{
  "success": true,
  "data": {
    "id": "inv_1234567890",
    "document_type": "invoice",
    "document_number": "INV-2024-0001",
    "status": "draft",
    "from_details": {
      "name": "Your Company",
      "email": "billing@yourcompany.com",
      "address_line1": "123 Business St",
      "city": "San Francisco",
      "country_code": "US"
    },
    "to_details": {
      "name": "Customer Name",
      "email": "customer@example.com"
    },
    "line_items": [...],
    "currency": "USD",
    "subtotal": "1500.00",
    "tax_amount": "0.00",
    "total": "1500.00",
    "pdf_url": "https://api.generateinvoice.com/v1/invoices/inv_1234567890/pdf",
    "created_at": "2024-01-15T10:30:00Z"
  },
  "meta": {
    "request_id": "req_abc123",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Base URL

All API requests should be made to:

https://api.generateinvoice.com/v1

Content Type

The API accepts and returns JSON. Always include the Content-Type: application/json header in requests with a body.

Next Steps