Skip to main content
GET
/
v1
/
invoices
curl -X GET "https://api.flexprice.io/v1/invoices?customer_id=cust_1234&invoice_status=FINALIZED&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "data": [
    {
      "id": "inv_1234567890",
      "customer_id": "cust_1234",
      "subscription_id": "sub_5678",
      "invoice_number": "INV-2024-0001",
      "invoice_type": "SUBSCRIPTION",
      "invoice_status": "FINALIZED",
      "payment_status": "PAID",
      "currency": "usd",
      "amount_due": "100.00",
      "amount_paid": "100.00",
      "amount_remaining": "0.00",
      "subtotal": "100.00",
      "total_tax": "0.00",
      "total_discount": "0.00",
      "total": "100.00",
      "total_prepaid_credits_applied": "0.00",
      "due_date": "2024-02-01T00:00:00Z",
      "period_start": "2024-01-01T00:00:00Z",
      "period_end": "2024-01-31T23:59:59Z",
      "billing_period": "MONTHLY",
      "billing_reason": "subscription_cycle",
      "line_items": [],
      "metadata": {},
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-15T00:00:00Z"
    }
  ],
  "total": 1,
  "limit": 20,
  "offset": 0
}

Query Parameters

customer_id
string
Filter invoices by customer ID
subscription_id
string
Filter invoices by subscription ID
invoice_status
string
Filter by invoice statusValues: DRAFT, FINALIZED, VOIDED, UNCOLLECTIBLE
payment_status
string
Filter by payment statusValues: PENDING, PAID, UNPAID, PARTIALLY_PAID, OVERPAID, FAILED
invoice_type
string
Filter by invoice typeValues: SUBSCRIPTION, ONE_TIME, CREDIT, PRORATION
due_date_from
string
Filter invoices with due date on or after this date (ISO 8601 format)
due_date_to
string
Filter invoices with due date on or before this date (ISO 8601 format)
period_start_from
string
Filter invoices with billing period starting on or after this date (ISO 8601 format)
period_start_to
string
Filter invoices with billing period starting on or before this date (ISO 8601 format)
limit
integer
default:"10"
Number of invoices to return per page (max 100)
offset
integer
default:"0"
Number of invoices to skip for pagination
sort_by
string
default:"created_at"
Field to sort byValues: created_at, updated_at, due_date, period_start, total
sort_order
string
default:"desc"
Sort orderValues: asc, desc

Response

data
array
Array of invoice objects
total
integer
Total number of invoices matching the filter criteria
limit
integer
Number of invoices returned per page
offset
integer
Number of invoices skipped
curl -X GET "https://api.flexprice.io/v1/invoices?customer_id=cust_1234&invoice_status=FINALIZED&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "data": [
    {
      "id": "inv_1234567890",
      "customer_id": "cust_1234",
      "subscription_id": "sub_5678",
      "invoice_number": "INV-2024-0001",
      "invoice_type": "SUBSCRIPTION",
      "invoice_status": "FINALIZED",
      "payment_status": "PAID",
      "currency": "usd",
      "amount_due": "100.00",
      "amount_paid": "100.00",
      "amount_remaining": "0.00",
      "subtotal": "100.00",
      "total_tax": "0.00",
      "total_discount": "0.00",
      "total": "100.00",
      "total_prepaid_credits_applied": "0.00",
      "due_date": "2024-02-01T00:00:00Z",
      "period_start": "2024-01-01T00:00:00Z",
      "period_end": "2024-01-31T23:59:59Z",
      "billing_period": "MONTHLY",
      "billing_reason": "subscription_cycle",
      "line_items": [],
      "metadata": {},
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-15T00:00:00Z"
    }
  ],
  "total": 1,
  "limit": 20,
  "offset": 0
}