Skip to main content

Fake Subscription Data API

MOCK DATA

Fake SaaS subscriptions with exact currency precision, calendar billing periods and explicit trial, renewal, pause and cancellation state masks.

Generated test data for fixtures and development

Base URL
/api/subscriptions
Capabilities
1 route Seedable
Last updated
July 29, 2026

GET /api/subscriptions

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

Request parameters

Pin the lifecycle status. Omit for a weighted mix.

Billing cadence. The period uses calendar months or calendar years.

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

Earliest createdAt timestamp. Defaults to 730 days before resolved to.

Latest createdAt timestamp and lifecycle as-of time (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/subscriptions?status=active&count=5&seed=42"
const res = await fetch("https://randomapi.dev/api/subscriptions?status=active&count=5&seed=42");
const { data, meta } = await res.json();
import requests

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

Pin the lifecycle status. Omit for a weighted mix.

allowed: trialing | active | pastDue | cancelled | paused
example: status=active
interval enum

Billing cadence. The period uses calendar months or calendar years.

default: monthly
allowed: monthly | yearly
example: interval=yearly
currency string

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

default: USD
example: currency=KWD
from date

Earliest createdAt timestamp. Defaults to 730 days before resolved to.

example: from=2024-01-01
to date

Latest createdAt timestamp and lifecycle as-of time (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,customer
exclude list

Return all fields except these (comma-separated).

example: exclude=createdAt
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 14
id string

Distinct synthetic subscription ID.

example: sub_82fe1c4a32d90001

customer object

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

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

plan object

Synthetic plan id, name, tier and feature list.

example: {"id":"pro","name":"Pro","tier":"pro","features":["10 workspaces","Usage reports"]}

status string

trialing | active | pastDue | cancelled | paused.

example: active

interval string

monthly | yearly.

example: monthly

currency string

Canonical active ISO 4217 code.

example: USD

amount number

Recurring amount per selected billing interval, calculated in minor units.

example: 29

currentPeriodStart string (ISO 8601)

Start of the current trial or billing period.

example: 2025-06-01T00:00:00.000Z

currentPeriodEnd string (ISO 8601)

Exclusive end of the current period; always after currentPeriodStart.

example: 2025-07-01T00:00:00.000Z

trialEndsAt string (ISO 8601) nullable

Trial end for trialing records only, else null.

example: null

cancelledAt string (ISO 8601) nullable

Cancellation time for cancelled records only, else null.

example: null

nextBillingAt string (ISO 8601) nullable

Next period boundary for renewing statuses; null when cancelled or paused.

example: 2025-07-01T00:00:00.000Z

autoRenew boolean

True for trialing, active and pastDue; false for cancelled and paused.

example: true

createdAt string (ISO 8601)

Creation time inside from..to and not after currentPeriodStart.

example: 2025-01-10T12:00:00.000Z

Documented examples

Build-generated requests and complete responses
3
Active monthly subscriptions
GET /api/subscriptions?status=active&count=5&seed=42
{
  "data": [
    {
      "id": "sub_958016cfb6a5c85e0000",
      "customer": {
        "id": "cus_ac58cdd40fb1",
        "name": "Kaylie Ziemann",
        "email": "subscriber-msng2@example.com"
      },
      "plan": {
        "id": "pro",
        "name": "Pro",
        "tier": "pro",
        "features": [
          "10 workspaces",
          "Usage reports",
          "Priority support"
        ]
      },
      "status": "active",
      "interval": "monthly",
      "currency": "USD",
      "amount": 29.51,
      "currentPeriodStart": "2026-07-05T09:33:34.727Z",
      "currentPeriodEnd": "2026-08-05T09:33:34.727Z",
      "trialEndsAt": null,
      "cancelledAt": null,
      "nextBillingAt": "2026-08-05T09:33:34.727Z",
      "autoRenew": true,
      "createdAt": "2025-12-05T09:33:34.727Z"
    },
    {
      "id": "sub_78f248abeccba6fd0001",
      "customer": {
        "id": "cus_45df91c36673",
        "name": "Waino Friesen",
        "email": "subscriber-7t93x@example.com"
      },
      "plan": {
        "id": "starter",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Cancelled yearly subscriptions in EUR
GET /api/subscriptions?status=cancelled&interval=yearly&currency=EUR&count=4&seed=8
{
  "data": [
    {
      "id": "sub_5a0ad10ec49812580000",
      "customer": {
        "id": "cus_64a0ce7ed05d",
        "name": "Morris Ondricka",
        "email": "subscriber-nkjcs@example.com"
      },
      "plan": {
        "id": "pro",
        "name": "Pro",
        "tier": "pro",
        "features": [
          "10 workspaces",
          "Usage reports",
          "Priority support"
        ]
      },
      "status": "cancelled",
      "interval": "yearly",
      "currency": "EUR",
      "amount": 295.1,
      "currentPeriodStart": "2026-04-16T22:47:21.478Z",
      "currentPeriodEnd": "2027-04-16T22:47:21.478Z",
      "trialEndsAt": null,
      "cancelledAt": "2026-07-03T11:48:31.407Z",
      "nextBillingAt": null,
      "autoRenew": false,
      "createdAt": "2026-04-16T22:47:21.478Z"
    },
    {
      "id": "sub_2b831d0f2fb232510001",
      "customer": {
        "id": "cus_1ae248f70db8",
        "name": "Christian Luettgen",
        "email": "subscriber-s3eh6@example.com"
      },
      "plan": {
        "id": "team",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
KWD trials created in a fixed window
GET /api/subscriptions?status=trialing&currency=KWD&from=2025-01-01&to=2025-12-31&count=6&seed=17
{
  "data": [
    {
      "id": "sub_55abf24f73252bc10000",
      "customer": {
        "id": "cus_d360556385bf",
        "name": "Miss Mary Hilpert-Welch",
        "email": "subscriber-wnrrf@example.com"
      },
      "plan": {
        "id": "pro",
        "name": "Pro",
        "tier": "pro",
        "features": [
          "10 workspaces",
          "Usage reports",
          "Priority support"
        ]
      },
      "status": "trialing",
      "interval": "monthly",
      "currency": "KWD",
      "amount": 29.505,
      "currentPeriodStart": "2025-12-15T17:04:38.137Z",
      "currentPeriodEnd": "2026-01-14T17:04:38.137Z",
      "trialEndsAt": "2026-01-14T17:04:38.137Z",
      "cancelledAt": null,
      "nextBillingAt": "2026-01-14T17:04:38.137Z",
      "autoRenew": true,
      "createdAt": "2025-12-15T17:04:38.137Z"
    },
    {
      "id": "sub_b87eea1d421a411b0001",
      "customer": {
        "id": "cus_b239200a0eb0",
        "name": "Erick Dickinson",
        "email": "subscriber-5bn2y@example.com"
      },
      "plan": {
        "id": "team",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates subscription fixtures for SaaS billing screens without borrowing a payment provider's proprietary schema. Each record couples a synthetic customer and plan to a status, monthly or yearly calendar interval, exact per-period amount and an ordered lifecycle.

The nullable fields form an explicit state mask. Only trialing records have trialEndsAt; only cancelled records have cancelledAt; cancelled and paused records have autoRenew=false and no next billing time. Trialing, active and past-due records keep auto-renewal enabled and expose the next period boundary. Monthly and yearly periods use calendar arithmetic, including end-of-month clamping.

from and to constrain createdAt and resolve by default to the two years ending at today's UTC boundary. Status is evaluated at the resolved to date, so seeded lifecycle dates do not drift with milliseconds. The latest supported to date is 9998-12-31, leaving room for the following period boundary. Amounts are built in integer ISO 4217 minor units: JPY is whole, USD has two decimals and KWD has three. All customers, plans and IDs are synthetic.

Use it for

  • Populate subscription-management and SaaS billing dashboards
  • Test trial, renewal, dunning, pause and cancellation UI branches
  • Verify zero-, two- and three-decimal recurring-price rendering

Frequently asked questions

Which subscription statuses can I generate?

Use status=trialing|active|pastDue|cancelled|paused; every choice changes the nullable lifecycle fields and renewal behavior, not just the label.

Are billing periods calendar-correct?

Yes. Monthly and yearly periods use UTC calendar arithmetic with end-of-month clamping rather than assuming every month has 30 days.

Does the amount respect currency precision?

Yes. The recurring amount is constructed in integer minor units and rendered with the selected active currency's 0, 2 or 3 digits.