AlphaBill API

REST API for invoice automation • v1.0

Contents

πŸ”‘ Authentication

All API requests require an API key. Pass it via one of these methods:

MethodExample
Header (recommended)X-API-Key: your_key_here
Bearer tokenAuthorization: Bearer your_key_here
Query parameter?api_key=your_key_here
Base URL: https://api.alphabill.hu
User Scoping: Each API key is tied to a user account. You can only access invoices, clients, and statistics belonging to your account. Products are shared across all users. Manage your keys in Settings β†’ API Keys.

πŸ‘€ Current User

API Key Info

GET /me

Returns information about the current API key and its owner.

πŸ“„ Invoices

List Invoices

GET /invoices

Query parameters:

ParamTypeDescription
statusstringoptional Filter: draft, sent, paid, overdue, cancelled
client_idintoptional Filter by client ID
fromdateoptional Issue date from (YYYY-MM-DD)
todateoptional Issue date to (YYYY-MM-DD)
limitintoptional Max results (default 50, max 200)
offsetintoptional Pagination offset

Get Invoice

GET /invoices/{id}

Returns full invoice details including line items, share URL, and PDF URL.

Create Invoice

POST /invoices

Create a new invoice. Totals, tax amounts, and HUF conversions are calculated automatically.

FieldTypeDescription
client_idintrequired* Existing client ID
buyer_namestringrequired* Buyer name (alternative to client_id)
buyer_companystringoptional Override buyer company
buyer_emailstringoptional Override buyer email
buyer_addressstringoptional Override buyer address
buyer_countrystringoptional Override buyer country
buyer_citystringoptional Override buyer city
buyer_zipcodestringoptional Override buyer zipcode
buyer_taxstringoptional Override buyer tax number
itemsarrayrequired Array of line items (see below)
issue_datedateoptional Default: today
fulfillment_datedateoptional Default: issue_date
due_datedateoptional Default: +30 days
currencystringoptional EUR, USD, GBP, HUF (default from settings)
huf_ratefloatoptional Override HUF exchange rate (auto-fetched if omitted)
payment_methodstringoptional Default from settings
statusstringoptional draft (default), sent, or paid
notesstringoptional Invoice notes/comments

Line item fields:

FieldTypeDescription
descriptionstringrequired* Item description (on invoice)
product_idintrequired* Load from product (fills defaults)
quantityfloatoptional Default: 1 (or product default)
unit_pricefloatoptional Default: 0 (or product price)
tax_ratefloatoptional Default: 27% (or product rate)
commentstringoptional Additional notes for this item
Note: Each item needs either description or product_id. When using product_id, the product's name, price, quantity, tax rate, and comment are used as defaults β€” you can still override any of them.

Update Invoice Status

PUT /invoices/{id}/status
FieldTypeDescription
statusstringrequired draft, sent, paid, or cancelled

Setting to paid auto-records a payment. Setting to sent generates the PDF.

Download Invoice PDF

GET /invoices/{id}/pdf

Returns the PDF binary. Generates it on-the-fly if missing.

πŸ‘₯ Clients

List Clients

GET /clients
ParamTypeDescription
searchstringoptional Search in name, company, email
limitintoptional Default 100, max 500
offsetintoptional Pagination offset

Get Client

GET /clients/{id}

Create Client

POST /clients
FieldTypeDescription
namestringrequired Client name
companystringoptional
emailstringoptional
phonestringoptional
addressstringoptional
countrystringoptional
citystringoptional
zipcodestringoptional
tax_numberstringoptional
notesstringoptional

πŸ“¦ Products

List Products

GET /products
ParamTypeDescription
activeintoptional Filter: 1 = active only, 0 = inactive only

Get Product

GET /products/{id}

πŸ“Š Statistics

GET /stats
ParamTypeDescription
yearintoptional Default: current year

Returns total invoices, total clients, revenue by status, and payment totals.

⚠️ Error Handling

All errors return a consistent JSON format:

{
  "error": true,
  "message": "Description of what went wrong",
  "code": 422,
  "details": ["Field-level errors if applicable"]
}
CodeMeaning
401Missing or invalid API key
404Resource not found
422Validation error (check details array)
500Server error

πŸš€ Examples

Create an invoice from products

curl -X POST https://api.alphabill.hu/invoices \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "client_id": 1,
    "status": "sent",
    "items": [
      {"product_id": 1, "quantity": 2},
      {"product_id": 3}
    ]
  }'

Create an invoice with custom items

curl -X POST https://api.alphabill.hu/invoices \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "client_id": 1,
    "issue_date": "2026-03-25",
    "due_date": "2026-04-25",
    "currency": "EUR",
    "payment_method": "ÁtutalÑs",
    "status": "draft",
    "notes": "Thank you for your business",
    "items": [
      {
        "description": "Web Development - March 2026",
        "quantity": 1,
        "unit_price": 2500.00,
        "tax_rate": 27,
        "comment": "Frontend + backend work"
      },
      {
        "description": "Hosting",
        "quantity": 1,
        "unit_price": 50.00,
        "tax_rate": 27
      }
    ]
  }'

Create invoice for a new buyer (no client record)

curl -X POST https://api.alphabill.hu/invoices \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "buyer_name": "John Doe",
    "buyer_company": "ACME Corp",
    "buyer_address": "123 Main St",
    "buyer_city": "Budapest",
    "buyer_country": "Hungary",
    "buyer_tax": "12345678-1-42",
    "items": [
      {"description": "Consulting", "quantity": 10, "unit_price": 100, "tax_rate": 27}
    ]
  }'

Mark invoice as paid

curl -X PUT https://api.alphabill.hu/invoices/5/status \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"status": "paid"}'

List unpaid invoices

curl https://api.alphabill.hu/invoices?status=sent \
  -H "X-API-Key: YOUR_API_KEY"

Create a client

curl -X POST https://api.alphabill.hu/clients \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "name": "Jane Smith",
    "company": "Smith & Co",
    "email": "jane@smith.co",
    "address": "456 Oak Ave",
    "city": "Vienna",
    "country": "Austria",
    "tax_number": "ATU12345678"
  }'

Download invoice PDF

curl https://api.alphabill.hu/invoices/5/pdf \
  -H "X-API-Key: YOUR_API_KEY" \
  -o invoice.pdf

AlphaBill API v1.0 • Back to Dashboard