Skip to main content

Fake Invoice Data API

MOCK DATA

Exact fake invoices with line items, ISO currency precision, tax, collectible balances and status-consistent issue, due and payment dates.

Generated test data for fixtures and development

Base URL
/api/invoices
Capabilities
1 route Seedable
Last updated
July 30, 2026

GET /api/invoices

Live requestRuns against the public API
No key required
GET/api/invoices?status=paid&count=5&seed=42

Request parameters

Pin the invoice status. Omit for a weighted mix.

Active ISO 4217 currency code. Case-insensitive; amounts use the currency's 0, 2 or 3 minor-unit digits.

Minimum number of invoice lines (inclusive).

Maximum number of invoice lines (inclusive). Must be ≥ minItems.

Tax percentage, 0–30, with at most two decimal places. Applied using integer basis points.

Earliest issueDate. Defaults to 365 days before the resolved to date.

Latest issueDate and as-of date for overdue status (through 9998-12-31). Defaults to today's UTC boundary.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/invoices?status=paid&count=5&seed=42"
const res = await fetch("https://randomapi.dev/api/invoices?status=paid&count=5&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/invoices?status=paid&count=5&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/invoices?status=paid&count=5&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 7
status enum

Pin the invoice status. Omit for a weighted mix.

allowed: draft | sent | paid | overdue | void
example: status=overdue
currency string

Active ISO 4217 currency code. Case-insensitive; amounts use the currency's 0, 2 or 3 minor-unit digits.

default: USD
example: currency=EUR
minItems int

Minimum number of invoice lines (inclusive).

default: 1
allowed: 1 – 10
example: minItems=2
maxItems int

Maximum number of invoice lines (inclusive). Must be ≥ minItems.

default: 4
allowed: 1 – 10
example: maxItems=6
taxRate float

Tax percentage, 0–30, with at most two decimal places. Applied using integer basis points.

default: 20
allowed: 0 – 30
example: taxRate=8.25
from date

Earliest issueDate. Defaults to 365 days before the resolved to date.

example: from=2025-01-01
to date

Latest issueDate and as-of date for overdue status (through 9998-12-31). Defaults to today's UTC boundary.

example: to=2025-12-31
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=id,invoiceNumber
exclude list

Return all fields except these (comma-separated).

example: exclude=balanceDue
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 15
id string

Distinct synthetic invoice ID.

example: inv_93c0a5de8f340002

invoiceNumber string

Human-readable synthetic invoice number.

example: INV-2025-X8FQ-001

status string

draft | sent | paid | overdue | void.

example: paid

currency string

Canonical active ISO 4217 code.

example: USD

seller object

Synthetic seller with id, name, email and address.

example: {"id":"org_123","name":"Northwind Labs","email":"billing@example.com","address":"42 Market Street"}

buyer object

Synthetic buyer with id, name and reserved-domain email.

example: {"id":"cus_123","name":"Avery Chen","email":"avery.chen@example.net"}

lineItems object[]

1–10 lines with description, quantity, unitPrice and exact lineTotal.

example: [{"description":"Design services","quantity":2,"unitPrice":120,"lineTotal":240}]

issueDate string (YYYY-MM-DD)

Invoice issue date inside from..to.

example: 2025-04-01

dueDate string (YYYY-MM-DD)

Due date after issueDate; overdue dates are before resolved to.

example: 2025-05-01

paidAt string (YYYY-MM-DD) nullable

Payment date for paid invoices, else null.

example: null

subtotal number

Exact sum of line totals.

example: 240

tax number

Subtotal multiplied by the resolved tax rate, rounded once in minor units.

example: 48

total number

Exactly subtotal + tax.

example: 288

amountPaid number

Paid portion, determined by invoice status.

example: 0

balanceDue number

Collectible outstanding balance; zero for paid and void invoices.

example: 288

Documented examples

Build-generated requests and complete responses
3
Paid USD invoices
GET /api/invoices?status=paid&count=5&seed=42
{
  "data": [
    {
      "id": "inv_cfb6a5c85eac58cd0000",
      "invoiceNumber": "INV-2026-5KA8-001",
      "status": "paid",
      "currency": "USD",
      "seller": {
        "id": "org_b15863c1d1cf",
        "name": "Bergstrom - Veum",
        "email": "billing-9srfs@example.com",
        "address": "341 Mitchell Junctions"
      },
      "buyer": {
        "id": "cus_448a0b56b87c",
        "name": "Vincent Will",
        "email": "accounts-ekhcn@example.net"
      },
      "lineItems": [
        {
          "description": "Oriental Plastic Mouse",
          "quantity": 6,
          "unitPrice": 100.87,
          "lineTotal": 605.22
        },
        {
          "description": "Generic Wooden Chicken",
          "quantity": 1,
          "unitPrice": 828.85,
          "lineTotal": 828.85
        }
      ],
      "issueDate": "2026-01-20",
      "dueDate": "2026-02-24",
      "paidAt": "2026-05-14",
      "subtotal": 1434.07,
      "tax": 286.81,
      "total": 1720.88,
      "amountPaid": 1720.88,
      "balanceDue": 0"generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Overdue EUR invoices at 8.25% tax
GET /api/invoices?status=overdue&currency=EUR&taxRate=8.25&from=2025-01-01&to=2025-12-31&count=4&seed=9
{
  "data": [
    {
      "id": "inv_e779f63b31b86a1a0000",
      "invoiceNumber": "INV-2025-VMPX-001",
      "status": "overdue",
      "currency": "EUR",
      "seller": {
        "id": "org_6409af2e4850",
        "name": "Block, Wilderman and Lehner",
        "email": "billing-256fx@example.com",
        "address": "23217 Cremin Lake"
      },
      "buyer": {
        "id": "cus_2308cd05dff3",
        "name": "Dennis Fadel-Beier DDS",
        "email": "accounts-v3tx6@example.net"
      },
      "lineItems": [
        {
          "description": "Licensed Bamboo Car",
          "quantity": 3,
          "unitPrice": 346.71,
          "lineTotal": 1040.13
        },
        {
          "description": "Luxurious Marble Keyboard",
          "quantity": 6,
          "unitPrice": 1469.66,
          "lineTotal": 8817.96
        },
        {
          "description": "Practical Marble Gloves",
          "quantity": 2,
          "unitPrice": 391.64,
          "lineTotal": 783.28
        },
        {
          "description": "Bespoke Steel Mouse",
          "quantity": 4,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Whole-yen invoices with exactly three lines
GET /api/invoices?currency=JPY&minItems=3&maxItems=3&count=6&seed=17
{
  "data": [
    {
      "id": "inv_73252bc1d36055630000",
      "invoiceNumber": "INV-2026-SMZ9-001",
      "status": "paid",
      "currency": "JPY",
      "seller": {
        "id": "org_a6772197c4b9",
        "name": "Corkery Inc",
        "email": "billing-drknn@example.com",
        "address": "2505 Ana Landing"
      },
      "buyer": {
        "id": "cus_15d4e9076dfe",
        "name": "Madeline VonRueden",
        "email": "accounts-rquea@example.net"
      },
      "lineItems": [
        {
          "description": "Handmade Aluminum Pizza",
          "quantity": 7,
          "unitPrice": 1490,
          "lineTotal": 10430
        },
        {
          "description": "Unbranded Cotton Towels",
          "quantity": 10,
          "unitPrice": 306,
          "lineTotal": 3060
        },
        {
          "description": "Rustic Granite Bike",
          "quantity": 3,
          "unitPrice": 1969,
          "lineTotal": 5907
        }
      ],
      "issueDate": "2026-02-01",
      "dueDate": "2026-03-02",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}

About this API

Coverage & behavior

Generates accounting-style invoice fixtures whose arithmetic can survive assertions. Quantity and unit price produce each line total; subtotal and tax are calculated in integer currency minor units; and total = subtotal + tax exactly. The taxRate accepts 0–30% with at most two decimal places, so values such as 8.25 are represented as integer basis points rather than floating-point money math.

Each status has a strict balance and date contract. Paid invoices have amountPaid = total, zero balance and a payment date. Draft and sent invoices remain wholly collectible. Overdue invoices have a due date before the resolved to date and may be partially paid, but always retain a positive balance. Void invoices have no payment and no collectible balance.

from and to constrain the calendar issueDate; defaults resolve to the 365-day window ending on today's UTC boundary and are echoed under meta.params. The latest supported to date is 9998-12-31, leaving room for generated payment terms. Overdue is evaluated against that resolved to, never against a drifting wall clock. All parties, descriptions and identifiers are synthetic.

Use it for

  • Populate billing tables, invoice detail screens and PDF prototypes
  • Assert tax, paid amount and outstanding balance calculations
  • Exercise draft, sent, paid, overdue and void invoice states

Frequently asked questions

Are invoice totals safe from floating-point drift?

Yes. Prices, lines, subtotal, tax, paid amount and balance are calculated in integer minor units before being rendered with the currency's precision.

What makes an invoice overdue?

Its dueDate is before the request's resolved to date and its balanceDue remains positive. The endpoint never compares against an unreported moving clock.

Can I choose a decimal tax rate?

Yes. taxRate accepts 0–30 with up to two decimal places, including values such as 8.25.