List invoices

Retrieves a paginated list of invoices for the specified company. Supports filtering by status, date range, client, and search terms.

GET /api/v1/invoices

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
X-CompanystringYesCompany UUID to scope the request

Query parameters

NameTypeDefaultDescription
pageinteger1Page number for pagination
limitinteger20Number of items per page (max 100)
searchstring-Search term for invoice number or client name
statusstring-Filter by document status (see DocumentStatus enum)
directionstring-Filter by direction: incoming or outgoing
fromstring-Start date filter (ISO 8601 format: YYYY-MM-DD)
tostring-End date filter (ISO 8601 format: YYYY-MM-DD)
clientIdstring-Filter by client UUID
sortstringissueDateField to sort by (issueDate, number, total, dueDate)
orderstringdescSort order: asc or desc

DocumentStatus enum values

  • draft - Invoice is being edited
  • issued - Invoice has been issued
  • sent_to_provider - Submitted to e-invoice provider
  • validated - Provider validation successful
  • rejected - Provider validation failed
  • cancelled - Invoice has been cancelled

Request

curl https://api.storno.ro/api/v1/invoices?page=1&limit=20&status=issued&direction=outgoing \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Company: 550e8400-e29b-41d4-a716-446655440000"

Response

Returns a paginated list of invoices with summary information.

{
  "data": [
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "number": "FAC-2024-001",
      "status": "issued",
      "direction": "outgoing",
      "currency": "RON",
      "issueDate": "2024-02-15",
      "dueDate": "2024-03-15",
      "subtotal": 1000.00,
      "vatTotal": 190.00,
      "total": 1190.00,
      "clientName": "Acme Corporation SRL",
      "amountPaid": 500.00,
      "balance": 690.00,
      "supplier": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "Your Company SRL",
        "cif": "RO12345678"
      }
    }
  ],
  "total": 156,
  "page": 1,
  "limit": 20,
  "pages": 8
}

Response fields

FieldTypeDescription
dataarrayArray of invoice objects
totalintegerTotal number of invoices matching the filters
pageintegerCurrent page number
limitintegerItems per page
pagesintegerTotal number of pages

Invoice object fields

FieldTypeDescription
idstringInvoice UUID
numberstringInvoice number (series-formatted)
statusstringCurrent invoice status
directionstringInvoice direction (incoming/outgoing)
currencystringISO 4217 currency code
issueDatestringDate invoice was issued
dueDatestringPayment due date
subtotalnumberTotal before VAT
vatTotalnumberTotal VAT amount
totalnumberFinal total including VAT
clientNamestringClient/customer name
amountPaidnumberTotal amount paid
balancenumberRemaining balance due
supplierobjectSupplier information

Error codes

CodeDescription
401Missing or invalid authentication token
403No access to the specified company
422Invalid query parameters