> This page is for version Preview (default).
> For other versions, use one of these documentation indexes:
> - Preview (default): https://docs.preview.paid.ai/preview/llms.txt
> - Current: https://docs.preview.paid.ai/current/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.preview.paid.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.preview.paid.ai/_mcp/server.

# List event lineages

GET https://api.paid.ai/v1/event-lineages

Lists where events went in billing, latest received first, each in the same shape as an event's lineage. Filter by `customer`, `invoice`, `invoiceLine`, `usageLine`, `eventName` or `status`; without one of the first five, set a `timestamp` window of at most 92 days. When held transparency is enabled, the default list excludes waiting and outdated holds, including broad `status=notCounted` reads. Select waiting holds with `status=notCounted&outcome=held`, or outdated holds with `status=notCounted&outcome=outdated`. Pass `include=summary` for counts over every selected event, including not-counted events by reason; with `usageLine` as well, the summary explains that usage line. The `timestamp` window is of event timestamps, from 2026-08-05: an event received since then with an earlier `timestamp` is only retrieved by its ID.

Reference: https://docs.preview.paid.ai/api-reference/metering/event-lineages/list

## Authentication

- `Authorization` header (bearer token, required) — API Key authentication using Bearer token

## Request

### Query parameters

- `cursor` (string, optional) — The `nextCursor` of the previous page. Omit it for the first page.
- `customer` (string, optional) — Only this customer's events: its `cus_` ID, your `externalId`, or one of its aliases.
- `eventName` (string, optional) — The event's name, such as `ticket.closed`.
- `include` (enum, optional) — Pass `summary` to add `summary`, counts over every event the filters select, not only this page.
  - Allowed values: `summary`
- `invoice` (string, optional) — Only events counted on this invoice, by its `inv_` ID.
- `invoiceLine` (string, optional) — Only events counted on this invoice line, by its `invl_` ID.
- `limit` (integer, optional, default: 10) — How many objects to return, 1 to 100. Defaults to 10.
- `outcome` (enum, optional) — With `status=notCounted`, only events not counted for this reason, as `notCounted.type` gives it, voided events left out. `held` selects waiting holds; `outdated` selects holds recorded as outdated and requires held transparency to be enabled. Other or omitted outcomes select ordinary usage when enabled. More values may be added.
  - Allowed values: `held`, `outdated`, `noOrderLine`, `notBillable`, `reverted`, `usageNotRecorded`, `settling`, `processing`
- `status` (enum, optional) — Only events with this lineage `status`, or with `voided`, only voided events. With held transparency enabled, omitted status and broad `notCounted` select ordinary non-held usage; only an explicit held or outdated outcome selects holds. `invoice`, `invoiceLine` and `usageLine` select counted events only.
  - Allowed values: `counted`, `notCounted`, `voided`
- `timestamp[gte]` (datetime, optional) — Inclusive start of the window of event `timestamp`s, no earlier than 2026-08-05. Required with `timestamp[lt]` unless `customer`, `invoice`, `invoiceLine`, `usageLine` or `eventName` is set, and at most 92 days before it.
- `timestamp[lt]` (datetime, optional) — Exclusive end of the window of event `timestamp`s. Without it, `timestamp` has no upper bound, and the list stops at the events Paid had received when the first page was requested.
- `usageLine` (string, optional) — Only events counted on this usage line, by the `ul_` ID an event's lineage returns in `usage`. With `include=summary`, `summary.usageLine` explains the line.

### Headers

- `Paid-Beta` (enum, required) — This endpoint is in the `event_lineage=v1` beta. Send this header to use it.
  - Allowed values: `event_lineage=v1`

## Response

### 200

200

- `object` (enum, required) — The type of object. Always `list`.
  - Allowed values: `list`
- `data` (list of EventLineage, required) — The events' lineages on this page, latest received first. In a list, `credits` is what each event spent within the filters, and `creditGrant` is null; retrieve one event's lineage for its grants.
- `hasMore` (boolean, required) — Whether another page follows this one.
- `nextCursor` (string, required, nullable) — Send it as `cursor` to get the next page. Null on the last page.
- `summary` (EventLineageSummary, required) — Counts over every event the filters select.

## Errors

### 400 Bad Request Error

400

- `error` (ApiErrorObject, required) — What went wrong, in the same shape for every /v1 error.

### 401 Unauthorized Error

401

- `error` (ApiErrorObject, required) — What went wrong, in the same shape for every /v1 error.

### 403 Forbidden Error

403

- `error` (ApiErrorObject, required) — What went wrong, in the same shape for every /v1 error.

### 429 Too Many Requests Error

Too many requests. Retry after the `Retry-After` seconds.

- `error` (ApiErrorObject, required) — What went wrong, in the same shape for every /v1 error.

### 500 Internal Server Error

500

- `error` (ApiErrorObject, required) — What went wrong, in the same shape for every /v1 error.

## Types

### EventLineage

Where one event went in billing: the usage lines it counted on, the invoices that bill them, and the credits it spent.

- `object` (enum, required) — The type of object. Always `eventLineage`.
  - Allowed values: `eventLineage`
- `asOf` (datetime, required) — When the lineage was read; billing may add to it later.
- `credits` (list of EventLineageCreditSpend, required) — Every credit spend the event caused.
- `customer` (string, required, nullable) — The customer's `cus_` ID; null when billing never resolved one.
- `event` (string, required) — The event's `evt_` ID.
- `eventName` (string, required) — The event's name, such as `ticket.closed`.
- `history` (list of EventLineageHistoryEntry, required, nullable) — What happened to the event, oldest first: its receipt, each refusal, skip, hold and replay, where it counted and stopped counting, its credit spends and its invoices, and its void with the credits it gave back. Refusals, skips, holds and replays are recorded from November 3, 2026, so an older event's history may leave out retries before it counted. Null in a list; retrieve the event's lineage for its history.
- `livemode` (boolean, required) — `true` for an object on a live account, `false` on a test account.
- `notCounted` (EventLineageNotCounted, required) — Why the event counted on no usage line.
- `partialFailure` (EventLineagePartialFailure, required, nullable) — Why billing refused the event on an order line.
- `receivedAt` (datetime, required) — When Paid received the event. Lineage covers events received from 2026-08-05.
- `status` (enum, required) — `counted` once it counted on a usage line, `notCounted` when it hasn't (`notCounted` says why, including `processing` while billing is still working on it). A meter's event with no product is `notCounted`: `skipped`, or `notProcessed` when received before not-counted outcomes began being recorded on 2026-11-02. More values may be added.
  - Allowed values: `counted`, `notCounted`
- `timestamp` (datetime, required) — When the event occurred, as billing dates it: the event's `timestamp`, else, for a signal sent through the legacy API, a valid `data.historicalTimestamp`, else its receipt. The list's `timestamp[gte]` and `timestamp[lt]` filter on it.
- `usage` (list of EventLineageUsage, required) — Every usage line the event counted on.
- `voided` (boolean, required) — Whether the event was voided. A voided event keeps its lineage: `history` says when, by whom and why, and what credits went back.

### EventLineageSummary

Counts over every event the filters select.

- `asOf` (datetime, required) — The summary counts events received before this. With a not-counted breakdown, it's when billing's outcomes are settled, some 20 minutes back, so events still being processed are left out rather than counted as lost; the page's rows can be newer.
- `byEventName` (list of EventLineageEventNameCounts, required) — Where each event name's events went.
- `credits` (list of EventLineageCreditTotal, required, nullable) — Credits the selected events spent, per currency; null when the filters are too wide to sum.
- `events` (integer, required) — Every event the filters select, received before `asOf`.
- `notCounted` (list of EventLineageSummaryNotCountedItems, required, nullable) — Not-counted events by reason, most first, each counted from its recorded outcome. Set only with `status=notCounted`; null otherwise, or when they can't be counted. Outcomes are recorded from a set date on, so such a summary needs `timestamp[gte]` on the hour and no earlier than that date (the error names it), and `timestamp[lt]`, if set, on the hour.
- `usageLine` (EventLineageUsageLine, required) — With the `usageLine` filter, that usage line explained; null otherwise.
- `voided` (EventLineageSummaryVoidedCounts, required) — Voided events the filters select, an event voided before Paid recorded its event name included, which no `byEventName` entry counts. None with `invoice`, `invoiceLine` or `usageLine`: a void takes an event off its usage lines.

### ApiErrorObject

What went wrong, in the same shape for every /v1 error.

- `code` (string, required) — A stable, machine-readable code for this error. New codes may be added at any time. See [Errors](https://docs.paid.ai/preview/developers/api/errors) for what each one means and how to fix it. - `unauthorized`: The API key is missing, malformed, revoked or expired. - `session_revoked`: The session behind this token has been signed out. - `forbidden`: The credentials are valid but cannot access this account. - `insufficient_scope`: The API key's scopes do not cover this endpoint. - `user_required`: Only a person signed in to Paid can do this, not an API key: it sends email for the account or acts on its behalf. - `customer_key_forbidden`: A customer-scoped API key called an endpoint it cannot use. - `organization_required`: The request did not say which account it is for. - `auth_context_error`: Paid could not load the account for these credentials. - `invalid_version`: The API version is malformed or not a released version. - `rollback_window_expired`: The account tried to move its pinned version back after the rollback window closed. - `unknown_beta`: `Paid-Beta` names a beta that does not exist, or is malformed. - `beta_not_enabled`: The account is not enrolled in this private beta. - `beta_header_required`: A beta endpoint or field was used without opting in. - `invalid_idempotency_key`: `Idempotency-Key` is empty, longer than 255 characters, or not printable ASCII. - `idempotency_key_reused`: The `Idempotency-Key` was already used with a different request. - `idempotency_request_in_progress`: A request with this `Idempotency-Key` is still running. - `validation_error`: The request body or parameters failed validation. - `invalid_json`: The request body is not valid JSON. - `payload_too_large`: The request body exceeds 10 MB. - `resource_missing`: No resource or path matches the request. - `type_mismatch`: A polymorphic field's `type` doesn't match the sub-object sent with it, or more than one sub-object was sent. `param` names the field. - `reference_not_found`: A reference in the body or query string doesn't name a resource on the account. `param` names the field, e.g. `customer` or `lines[0].price`. - `resource_archived`: A resource the request names is archived, so it can't be used for this. `param` names the field; it's empty when the archived resource is the one in the path. - `resource_not_active`: A resource the request names isn't active: it's still a draft, has ended or was deactivated. `param` names the field. - `status_conflict`: The action can't run on the object in the path from its current `status`, e.g. activating an active order or releasing a captured hold. `message` names the status and the statuses the action needs. - `resource_in_use`: The resource can't be archived or changed this way while other resources still use it. `param` names the field when there is one. - `resource_exists`: A resource with this identifier (an `externalId`, `key` or alias) already exists on the account, ignoring letter case. `param` names the field. - `customer_mismatch`: A resource the request names belongs to a different customer than the one the request is for. `param` names the field. - `internal_error`: Something went wrong on Paid's side. - `currency_not_supported`: `currency` is not enabled on the account. - `currency_locked`: The customer has an order, so its `currency` cannot change. - `customer_has_active_orders`: The customer cannot be archived while it has an activating, active or paused order. - `parent_livemode_mismatch`: `parent` names a customer in the other mode: live for a test key, or test for a live key. - `parent_has_parent`: Parents are one level deep: the named parent has a parent of its own, or the customer being given a parent has children. - `parent_cycle`: `parent` names the customer itself, or, for a customer unit, the unit itself or a unit under it. - `has_active_children`: The customer cannot be archived while it is the `parent` of a customer that is not archived, or the customer unit while it has units under it that are not archived. - `tax_provider_not_connected`: Tax cannot be enabled while no tax provider is connected. - `mixed_tax_codes`: A prepaid commit taxed at purchase is scoped to products with different tax codes, so its invoice has no single code. - `tax_provider_unavailable`: The tax provider could not be reached, so the tax code could not be checked against its catalog. - `immutable_field`: An update tried to change a field that can't change after creation, such as a rate, a key or a reference. - `currency_mismatch`: An amount or reference isn't in the currency the request needs, such as an order's currency. - `limit_exceeded`: The request has more items than the resource allows, such as rates, adjustments, filters or outcomes. - `forfeit_confirmation_required`: Ending this would forfeit a remaining balance, and `forfeitRemaining` wasn't `true`. - `external_id_scopes_meter`: The product's `externalId` can't change while a meter is scoped to it, because the meter matches on that ID. - `percent_of_base_missing`: A percent-of line names prices in `of.lines` that aren't on the order. - `outcome_not_allowed`: `usage.outcome` was sent for an events meter, which has no outcomes. - `meter_not_priceable`: The meter can't be priced on its own: it has `groupBy`, or uses a dashboard-only feature. - `price_in_active_plan`: The price can't be archived while an active plan lists it. - `ambiguous_match`: Two rates match the same dimension values with equal specificity, so rating couldn't choose between them. - `meter_already_priced`: One measure would be priced by both a price and a rate card on the same order. - `no_common_currency`: The plan's lines share no currency. - `default_requires_upgrade_path`: `default: true` was sent on a plan with no `upgradePath`. - `plan_legacy`: The plan was converted from v2 without v1 prices, so it can't be used on a v1 order. - `upgrade_path_position_taken`: Another plan already has this `position` in the upgrade-path `group`. - `quantity_not_allowed`: A line has a `quantity`, but its price has no `unit` (a usage price or flat fee). - `quantity_out_of_range`: A `quantity` is outside the price's or line's `quantityLimits`. - `quantity_limits_wider_than_price`: A line's `quantityLimits` are wider than its price's. - `interval_mismatch`: A recurring price's interval neither divides the order's billing cycle evenly nor is a whole multiple of it. - `line_not_on_order`: An amendment change names a line from another order. - `no_material_changes`: The amendment's changes leave the order as it is. - `usage_billing_behind`: Usage for a past period hasn't been billed yet, so the usage line can't be replaced now. - `seats_exceed_quantity`: The new quantity is below the line's active seats. - `order_ambiguous`: Several orders share this `externalId`, so it can't name one of them. - `order_version_mismatch`: The order changed since the `expectedVersion` sent. - `preview_stale`: The order changed after the amendment was previewed. - `billing_unavailable`: Billing couldn't be reached to preview or apply the change. Nothing changed. - `commit_conflict`: The invoiced minimum overlaps another on the order in both time and scope. - `duplicate_outcome_key`: Two outcomes, or an outcome and `catchAll`, share a key. - `single_event_field_not_allowed`: A single-event meter sent a field only workflows or event aggregation use, such as `identifier`, `close` or `aggregation`. - `alias_unit_conflict`: `customer` is an alias of one unit and `customerUnit` names a unit outside its subtree. - `workflow_unit_conflict`: The event names a different customer unit from the open workflow it joins. - `incompatible_unit`: A strict meter reads a Quantity whose unit can't be converted to the meter's unit. - `unknown_provider`: Paid's model catalog doesn't know the inference provider. - `unknown_model`: Paid's model catalog doesn't know the model. - `range_too_large`: The range is longer than `granularity` allows. - `misaligned_range`: `startsAt` or `endsAt` doesn't fall on a bucket boundary in `timezone`. - `depth_exceeded`: The unit, or a moved subtree, would go below 16 levels. - `root_unit_immovable`: An update tried to move the customer's root unit. - `root_unit_always_billable`: A create or update tried to make the root unit non-billable. - `has_active_cap`: The unit can't be archived while it has an active spend cap. - `has_active_seat`: The unit can't be archived while it holds an active seat, or the customer is billed per seat, so its units can't be created, changed or archived. - `alias_held_by_draft_customer`: The alias value is a draft customer's external ID: usage sent under it before the alias existed made that draft. - `alias_system_managed`: The alias was made by Paid, when a customer's `externalId` changed or from a SalesBricks buyer, so it can't be updated, archived, unarchived or deleted. It has `systemManaged: true`. - `draft_has_billing`: The draft customer to merge has credit grants, pending spends or other billing postings. - `price_not_on_order`: `price` isn't on the order. - `price_not_seat_based`: `price` isn't a recurring price with `seats`. - `customer_unit_not_billable`: The customer unit has `effectiveBillable: false`, so it can't hold a seat. - `seat_limit_reached`: The seat line is full: a purchased line has `quantity` active seats, or an assigned line reached `quantityLimits.maximum`. - `unit_already_has_seat`: The unit already holds an active seat for this product. - `refill_rollover_conflict`: The grant sets both `refill` and `rollover`. - `credit_currency_key_reserved`: The credit currency `key` is an ISO 4217 currency code. - `insufficient_credits`: The customer's spendable balance in the credit currency doesn't cover the hold. Nothing was reserved. - `price_not_one_time`: The auto top-up's `price` isn't a one-time price. - `price_grants_mismatch`: The auto top-up's `price` doesn't grant the rule's credit currency. - `payment_method_required`: `collection: "chargeAutomatically"` was set, but there is no card to charge: the customer has no payment method on file, or the one named (or the default) is a bank transfer account. - `auto_top_up_conflict`: The customer already has an enabled auto top-up for this credit currency. - `invalid_request`: The request was rejected. - `not_found`: The requested resource does not exist. - `conflict`: The request conflicts with the resource's current state. - `rate_limited`: Too many requests in too short a time. - `api_error`: An unexpected error.
- `docUrl` (string, required) — A link to this code's entry on the errors page, or to the page itself for an undocumented code.
- `message` (string, required) — A human-readable explanation of what went wrong.
- `requestId` (string, required) — The ID of the request, also returned in the `Request-Id` header. Include it when contacting support.
- `type` (enum, required) — The category of error.
  - Allowed values: `invalid_request_error`, `authentication_error`, `permission_error`, `idempotency_error`, `rate_limit_error`, `api_error`
- `param` (string, optional) — The request field or header the error relates to, when there is one.

### EventLineageCreditSpend

Credits the event spent.

- `amount` (string, required) — An exact non-negative credit amount, up to 15 fractional places.
- `chargedAt` (datetime, required) — When the credits were spent.
- `creditCurrency` (string, required) — The credit currency's ID.
- `creditGrant` (string, required, nullable) — The ID of the grant it drew from, or null.
- `customerUnit` (string, required, nullable) — The `cu_` ID of the unit charged, or null.

### EventLineageHistoryEntry

One thing that happened to the event. More types may be added.

- `type`: `received` (received)
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `failed` (failed)
  - `failed` (EventLineageHistoryEntryFailedFailed, required) — The refusal.
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `skipped` (skipped)
  - `occurredAt` (datetime, required) — When it happened.
  - `skipped` (EventLineageHistoryEntrySkippedSkipped, required) — The skip.
- `type`: `held` (held)
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `released` (released)
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `replayed` (replayed)
  - `occurredAt` (datetime, required) — When it happened.
  - `replayed` (EventLineageHistoryEntryReplayedReplayed, required) — The replay.
- `type`: `replaced` (replaced)
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `processed` (processed)
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `noOrderLine` (noOrderLine)
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `notBillable` (notBillable)
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `counted` (counted)
  - `counted` (EventLineageHistoryEntryCountedCounted, required) — The line and what the event added to it, in the line's unit.
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `removed` (removed)
  - `occurredAt` (datetime, required) — When it happened.
  - `removed` (EventLineageHistoryEntryRemovedRemoved, required) — The line it was taken off.
- `type`: `spent` (spent)
  - `occurredAt` (datetime, required) — When it happened.
  - `spent` (EventLineageHistoryEntrySpentSpent, required) — The spend.
- `type`: `invoiced` (invoiced)
  - `invoiced` (EventLineageHistoryEntryInvoicedInvoiced, required) — The invoice that billed it.
  - `occurredAt` (datetime, required) — When it happened.
- `type`: `voided` (voided)
  - `occurredAt` (datetime, required) — When it happened.
  - `voided` (EventLineageHistoryEntryVoidedVoided, required) — The void.
- `type`: `creditsReturned` (creditsReturned)
  - `creditsReturned` (EventLineageHistoryEntryCreditsReturnedCreditsReturned, required) — The credits.
  - `occurredAt` (datetime, required) — When it happened.

### EventLineageNotCounted

Why the event counted on no usage line.

- `type`: `settling` (settling)
- `type`: `failed` (failed)
  - `failed` (EventLineageNotCountedFailedFailed, required) — Why billing refused the event on an order line.
- `type`: `skipped` (skipped)
  - `skipped` (EventLineageNotCountedSkippedSkipped, required) — The skip.
- `type`: `held` (held)
  - `held` (EventLineageNotCountedHeldHeld, required) — The hold.
- `type`: `outdated` (outdated)
  - `outdated` (EventLineageNotCountedOutdatedOutdated, required) — The outdated hold.
- `type`: `noOrderLine` (noOrderLine)
  - `noOrderLine` (EventLineageNotCountedNoOrderLineNoOrderLine, required) — The processing.
- `type`: `aggregated` (aggregated)
  - `aggregated` (EventLineageNotCountedAggregatedAggregated, required) — The aggregation.
- `type`: `notBillable` (notBillable)
  - `notBillable` (EventLineageNotCountedNotBillableNotBillable, required) — The tracking.
- `type`: `reverted` (reverted)
  - `reverted` (EventLineageNotCountedRevertedReverted, required) — The revert.
- `type`: `usageNotRecorded` (usageNotRecorded)
- `type`: `processing` (processing)
- `type`: `notProcessed` (notProcessed)
- `type`: `voided` (voided)
  - `voided` (EventLineageNotCountedVoidedVoided, required) — The void.

### EventLineagePartialFailure

Why billing refused the event on an order line.

- `occurredAt` (datetime, required) — When billing refused it.
- `reason` (string, required) — Billing's reason, in its own words as it recorded the refusal, as in `history`. When billing no longer keeps that record, a short summary of the reason.
- `step` (enum, required) — Where billing refused the event: the check that failed, or `unrecorded` when it failed without saying where. More values may be added.
  - Allowed values: `validation`, `product`, `customer`, `user`, `order`, `orderLine`, `postActions`, `creditSpend`, `unrecorded`

### EventLineageUsage

A usage line the event counted on. `quantity` is what the event added, in the line's unit: the event data field it sums, such as `pages`, or `event` when each event counts once.

- `countedAfterInvoice` (boolean, required) — `true` when the event was counted after the invoice was issued, so it is not on that invoice.
- `invoice` (string, required, nullable) — The `inv_` ID of the invoice billing the line, or null.
- `invoiceLine` (string, required, nullable) — The `invl_` ID of the invoice line, or null.
- `orderLine` (string, required, nullable) — The order line's `ordl_` ID; null for a line created before order lines had one.
- `period` (EventLineageUsagePeriod, required) — The usage period the event counted in.
- `quantity` (EventLineageQuantity, required) — The quantity this event added, exact to 15 decimal places as billing counted it. Null when it is part of an aggregate settlement whose quantity belongs to the whole cell.
- `status` (enum, required) — `collecting` while the period is open, `billed` once it's on an invoice, `skipped` when it settled with nothing to bill; null when billing has no record of the period.
  - Allowed values: `collecting`, `billed`, `skipped`
- `usageLine` (string, required) — The usage line's `ul_` ID: one priced order line in one billing period.
- `settlement` (string, optional, nullable) — Opaque reference to the settlement that counted this event in aggregate; null for a per-event contribution. No quantity is allocated to an individual member.

### EventLineageEventNameCounts

Where one event name's events went.

- `aggregatedReason` (enum, required) — Why events can't be traced one at a time: an aggregate meter prices the line, the line is billed at settlement, the line has usage billing cannot trace to events, or a meter's inputs could not be resolved. More values may be added.
  - Allowed values: `aggregateMeter`, `settlementOnly`, `untracedUsage`, `unresolvedMeterInputs`
- `counted` (integer, required) — Events counted on at least one usage line.
- `eventName` (string, required) — The event's name, such as `ticket.closed`.
- `notCounted` (integer, required, nullable) — Events counted nowhere, voided ones left out; null when `aggregatedReason` says it can't be known.
- `received` (integer, required) — Events received: `counted`, `notCounted` and `voided.events` together.
- `voided` (EventLineageVoidedCounts, required) — Voided events, split by whether they had counted first.

### EventLineageCreditTotal

Credits spent in one credit currency.

- `amount` (string, required) — An exact non-negative credit amount, up to 15 fractional places.
- `creditCurrency` (string, required) — The credit currency's ID.

### EventLineageSummaryNotCountedItems

- `events` (integer, required) — Events with this reason.
- `type` (enum, required) — Why the events counted nowhere, as `notCounted.type` on an event's lineage. More values may be added.
  - Allowed values: `failed`, `skipped`, `held`, `outdated`, `noOrderLine`, `notBillable`, `reverted`, `usageNotRecorded`, `aggregated`, `settling`, `processing`, `notProcessed`

### EventLineageUsageLine

With the `usageLine` filter, that usage line explained; null otherwise.

- `asOf` (datetime, required) — When the line was read. It's read whole, for each response, so it can include events newer than `summary.asOf`.
- `billedEvents` (integer, required, nullable) — Billing's own count of events on the line; null when billing has no record of the period.
- `byEventName` (list of EventLineageEventNameCounts, required) — Where the customer's events of the line's event names went in the period, across every line.
- `countedAfterInvoice` (integer, required) — Traced events counted after the line's invoice was issued, so not on it.
- `credits` (list of EventLineageUsageLineCreditsItems, required) — Credits the line's events spent, per currency.
- `eventName` (string, required) — The event's name, such as `ticket.closed`.
- `events` (integer, required) — Events traced to the line.
- `invoice` (string, required, nullable) — The `inv_` ID of the invoice billing the line, or null.
- `invoiceLine` (string, required, nullable) — The `invl_` ID of the invoice line, or null.
- `notCounted` (EventLineageUsageLineNotCounted, required) — The line's events that counted nowhere, and why.
- `orderLine` (string, required, nullable) — The order line's `ordl_` ID; null for a line created before order lines had one.
- `otherLines` (list of EventLineageUsageLineOtherLinesItems, required) — Other usage lines the same events counted on, most events first, up to 100.
- `otherLinesTruncated` (boolean, required) — `true` when `otherLines` stops at 100.
- `period` (EventLineageUsageLinePeriod, required) — The line's billing period.
- `quantity` (EventLineageUsageLineQuantity, required) — What the traced events added to the line, exact to 15 decimal places as billing counted it.
- `settlement` (EventLineageSettlement, required) — How billing settled the line at its period's close; null while the period is open, or for a line settled before billing recorded settlements.
- `status` (enum, required) — `collecting` while the period is open, `billed` once it's on an invoice, `skipped` when it settled with nothing to bill; null when billing has no record of the period.
  - Allowed values: `collecting`, `billed`, `skipped`
- `untraced` (EventLineageUsageLineUntraced, required) — What billing counted that the trace can't show: events it can't trace one by one, and `openingBalance`, a quantity carried in with no events behind it.
- `usageLine` (string, required) — The usage line's `ul_` ID: one priced order line in one billing period.

### EventLineageSummaryVoidedCounts

Voided events the filters select, an event voided before Paid recorded its event name included, which no `byEventName` entry counts. None with `invoice`, `invoiceLine` or `usageLine`: a void takes an event off its usage lines.

- `afterCounted` (integer, required) — Of them, those voided after they counted on a usage line, which the void took them off. The rest were voided before they counted anywhere.
- `events` (integer, required) — Voided events, which `received` still counts and `notCounted` leaves out.

### EventLineageHistoryEntryFailedFailed

The refusal.

- `reason` (string, required, nullable) — Billing's reason, in plain words; null once billing no longer keeps it (90 days).
- `step` (enum, required) — Where billing refused the event: the check that failed, or `unrecorded` when it failed without saying where. More values may be added.
  - Allowed values: `validation`, `product`, `customer`, `user`, `order`, `orderLine`, `postActions`, `creditSpend`, `unrecorded`

### EventLineageHistoryEntrySkippedSkipped

The skip.

- `reason` (string, required, nullable) — Why billing skipped it; null once billing no longer keeps it (90 days).

### EventLineageHistoryEntryReplayedReplayed

The replay.

- `trigger` (enum, required) — What replayed it: `operation` a reprocessing run, such as a backfill after a fix, `orderActivation` its order activating, `other` anything else. More values may be added.
  - Allowed values: `operation`, `orderActivation`, `other`

### EventLineageHistoryEntryCountedCounted

The line and what the event added to it, in the line's unit.

- `orderLine` (string, required, nullable) — The order line's `ordl_` ID; null for a line created before order lines had one.
- `quantity` (EventLineageHistoryQuantity, required) — What the event added to the line, exact to 15 decimal places as billing counted it; null when billing counted it in aggregate.
- `usageLine` (string, required, nullable) — The usage line's `ul_` ID; null for a line the event no longer counts on, whose period billing doesn't keep.

### EventLineageHistoryEntryRemovedRemoved

The line it was taken off.

- `orderLine` (string, required, nullable) — The order line's `ordl_` ID; null for a line created before order lines had one.
- `usageLine` (string, required, nullable) — The usage line's `ul_` ID; null for a line the event no longer counts on, whose period billing doesn't keep.

### EventLineageHistoryEntrySpentSpent

The spend.

- `amount` (string, required) — An exact non-negative credit amount, up to 15 fractional places.
- `creditCurrency` (string, required) — The credit currency's ID.

### EventLineageHistoryEntryInvoicedInvoiced

The invoice that billed it.

- `invoice` (string, required, nullable) — The invoice's `inv_` ID.
- `invoiceLine` (string, required, nullable) — The invoice line's `invl_` ID.
- `usageLine` (string, required) — The usage line's `ul_` ID: one priced order line in one billing period.

### EventLineageHistoryEntryVoidedVoided

The void.

- `by` (enum, required) — Who voided it: `apiKey` a call with one of your API keys, `dashboardUser` someone in your dashboard, `staff` Paid's support team, `system` Paid itself. More values may be added.
  - Allowed values: `apiKey`, `dashboardUser`, `staff`, `system`
- `chargesVoided` (boolean, required) — Whether the void also voided the charges the event fed, rather than the event alone.
- `reason` (string, required, nullable) — The reason given for the void, or null.

### EventLineageHistoryEntryCreditsReturnedCreditsReturned

The credits.

- `amount` (string, required) — An exact non-negative credit amount, up to 15 fractional places.
- `creditCurrency` (string, required) — The credit currency's ID.
- `forfeited` (boolean, required) — False for credits given back to the grant they were spent from. True for credits the grant could not take back, because it had ended or expired: they are lost.

### EventLineageNotCountedFailedFailed

Why billing refused the event on an order line.

- `occurredAt` (datetime, required) — When billing refused it.
- `reason` (string, required) — Billing's reason, in its own words as it recorded the refusal, as in `history`. When billing no longer keeps that record, a short summary of the reason.
- `step` (enum, required) — Where billing refused the event: the check that failed, or `unrecorded` when it failed without saying where. More values may be added.
  - Allowed values: `validation`, `product`, `customer`, `user`, `order`, `orderLine`, `postActions`, `creditSpend`, `unrecorded`

### EventLineageNotCountedSkippedSkipped

The skip.

- `occurredAt` (datetime, required) — When billing skipped it.
- `reason` (string, required) — Why billing skipped it.

### EventLineageNotCountedHeldHeld

The hold.

- `heldAt` (datetime, required) — When billing started holding it.
- `identifier` (string, required) — The customer unit identifier the event was sent with, which has not resolved yet.
- `expiresAt` (datetime, optional) — When the hold becomes eligible to be marked outdated, 90 days after receipt. The event stays held until that transition is recorded.

### EventLineageNotCountedOutdatedOutdated

The outdated hold.

- `expiresAt` (datetime, required) — When the hold became eligible to be marked outdated, 90 days after receipt.
- `heldAt` (datetime, required) — When billing started holding it.
- `identifier` (string, required) — The unresolved customer unit identifier the event was sent with.
- `outdatedAt` (datetime, required) — When the hold was recorded as outdated.

### EventLineageNotCountedNoOrderLineNoOrderLine

The processing.

- `occurredAt` (datetime, required, nullable) — When billing processed it; null when billing did not record the time.

### EventLineageNotCountedAggregatedAggregated

The aggregation.

- `reason` (enum, required) — Why events can't be traced one at a time: an aggregate meter prices the line, the line is billed at settlement, the line has usage billing cannot trace to events, or a meter's inputs could not be resolved. More values may be added.
  - Allowed values: `aggregateMeter`, `settlementOnly`, `untracedUsage`, `unresolvedMeterInputs`

### EventLineageNotCountedNotBillableNotBillable

The tracking.

- `occurredAt` (datetime, required) — When billing tracked it.

### EventLineageNotCountedRevertedReverted

The revert.

- `revertedAt` (datetime, required) — When billing took it off its last line.

### EventLineageNotCountedVoidedVoided

The void.

- `voidedAt` (datetime, required) — When the event was voided.

### EventLineageUsagePeriod

The usage period the event counted in.

- `endsAt` (datetime, required, nullable) — End of the usage period; null when billing has no record of it.
- `startsAt` (datetime, required) — Start of the usage period.

### EventLineageQuantity

The quantity this event added, exact to 15 decimal places as billing counted it. Null when it is part of an aggregate settlement whose quantity belongs to the whole cell.

- `unit` (string, required) — What `value` is measured in: a time unit such as `minute` or `month`, or what a meter counts, such as `token` or `ticket`.
- `value` (string, required) — A non-negative exact decimal string, up to 15 fractional places.

### EventLineageVoidedCounts

Voided events, split by whether they had counted first.

- `afterCounted` (integer, required) — Of them, those voided after they counted on a usage line, which the void took them off. The rest were voided before they counted anywhere.
- `events` (integer, required) — Voided events, which `received` still counts and `notCounted` leaves out.

### EventLineageUsageLineCreditsItems

- `amount` (string, required) — An exact non-negative credit amount, up to 15 fractional places.
- `creditCurrency` (string, required) — The credit currency's ID.
- `customerUnits` (list of EventLineageUsageLineCreditsItemsCustomerUnitsItems, required) — Who was charged.
- `events` (integer, required) — Events that spent these credits.

### EventLineageUsageLineNotCounted

The line's events that counted nowhere, and why.

- `aggregatedReason` (enum, required) — Why events can't be traced one at a time: an aggregate meter prices the line, the line is billed at settlement, the line has usage billing cannot trace to events, or a meter's inputs could not be resolved. More values may be added.
  - Allowed values: `aggregateMeter`, `settlementOnly`, `untracedUsage`, `unresolvedMeterInputs`
- `events` (integer, required, nullable) — The line's events that counted nowhere; null when `aggregatedReason` says it can't be known.
- `reasons` (list of EventLineageUsageLineNotCountedReasonsItems, required) — Not-counted events by reason, most first, each counted from its recorded outcome. Empty for a line whose period began before `reasonsStartedAt`: its reasons aren't given for part of the period.
- `reasonsStartedAt` (datetime, required, nullable) — When Paid started recording why events didn't count, which `reasons` are counted from. A line whose period began earlier gets no reasons: `reasons` is empty, while the rest of the line is explained. Null before any is recorded, when no line gets reasons.

### EventLineageUsageLineOtherLinesItems

- `events` (integer, required) — Events traced to that line.
- `orderLine` (string, required, nullable) — The order line's `ordl_` ID, or null.
- `usageLine` (string, required) — The usage line's `ul_` ID: one priced order line in one billing period.

### EventLineageUsageLinePeriod

The line's billing period.

- `endsAt` (datetime, required, nullable) — End of the usage period; null when billing has no record of it.
- `startsAt` (datetime, required) — Start of the usage period.

### EventLineageUsageLineQuantity

What the traced events added to the line, exact to 15 decimal places as billing counted it.

- `unit` (string, required) — What `value` is measured in: a time unit such as `minute` or `month`, or what a meter counts, such as `token` or `ticket`.
- `value` (string, required) — A non-negative exact decimal string, up to 15 fractional places.

### EventLineageSettlement

How billing settled the line at its period's close; null while the period is open, or for a line settled before billing recorded settlements.

- `backfilled` (EventLineageSettlementBackfilled, required, nullable) — Events a backfill added to the line; null when none did.
- `countedAfterSettlement` (EventLineageSettlementCountedAfterSettlement, required, nullable) — Events counted on the line after it settled; null when none were.
- `evaluation` (EventLineageSettlementEvaluation, required, nullable) — What the close evaluated to reach the line's quantity; null when the settlement was rebuilt.
- `isRebuilt` (boolean, required) — `true` when the settlement was rebuilt from billing's records after the close rather than recorded at it; `evaluation` is then null.
- `meter` (EventLineageSettlementMeter, required, nullable) — The meter the close evaluated; null for a line billed from its events one by one, or a revision no longer found.
- `settledAt` (datetime, required) — When billing settled the line at its period's close.
- `skipReason` (enum, required) — Why the close billed nothing on the line: `noUsage` when it had none, `historicalReplay` when its period fell inside the historical usage the order was started with, `other` for any other reason. Null when the close billed it. More values may be added.
  - Allowed values: `noUsage`, `historicalReplay`, `other`

### EventLineageUsageLineUntraced

What billing counted that the trace can't show: events it can't trace one by one, and `openingBalance`, a quantity carried in with no events behind it.

- `events` (integer, required, nullable) — Events billing counted that can't be traced one by one; null when billing has no record of the period.
- `openingBalance` (Quantity, required) — An exact value with an explicit measurement unit.

### EventLineageHistoryQuantity

What the event added to the line, exact to 15 decimal places as billing counted it; null when billing counted it in aggregate.

- `unit` (string, required) — What `value` is measured in: a time unit such as `minute` or `month`, or what a meter counts, such as `token` or `ticket`.
- `value` (string, required) — A non-negative exact decimal string, up to 15 fractional places.

### EventLineageUsageLineCreditsItemsCustomerUnitsItems

- `amount` (string, required) — An exact non-negative credit amount, up to 15 fractional places.
- `customerUnit` (string, required, nullable) — The `cu_` ID of the unit charged; null when the spend named no unit, or the unit doesn't exist yet.
- `events` (integer, required) — Events that spent it.

### EventLineageUsageLineNotCountedReasonsItems

- `events` (integer, required) — Events with this reason.
- `exampleEvent` (string, required, nullable) — Null: reasons are counted from recorded outcomes, not from example events.
- `type` (enum, required) — Why the events counted nowhere, as `notCounted.type` on an event's lineage. More values may be added.
  - Allowed values: `failed`, `skipped`, `held`, `outdated`, `noOrderLine`, `notBillable`, `reverted`, `usageNotRecorded`, `aggregated`, `settling`, `processing`, `notProcessed`

### EventLineageSettlementBackfilled

Events a backfill added to the line; null when none did.

- `events` (integer, required) — The line's events billing counted on a later pass, more than an hour after it received them.
- `lastCountedAt` (datetime, required) — When billing counted the last of them.

### EventLineageSettlementCountedAfterSettlement

Events counted on the line after it settled; null when none were.

- `events` (integer, required) — The line's events counted after it settled, which later closes bill.
- `invoice` (string, required, nullable) — The `inv_` ID of the invoice that bills them, once issued, when they all went to one line; else null.
- `lastCountedAt` (datetime, required) — When billing counted the last of them.
- `usageLines` (integer, required) — How many later usage lines they were billed on.

### EventLineageSettlementEvaluation

What the close evaluated to reach the line's quantity; null when the settlement was rebuilt.

- `carriedIn` (integer, required) — Events billed on this line from an earlier window that had already settled.
- `carriedOut` (integer, required) — Events of this window billed in a later one.
- `events` (integer, required, nullable) — Events the close counted on the line; null when not recorded.
- `readAt` (datetime, required, nullable) — When the close read the line's usage; null when not recorded.
- `window` (EventLineageSettlementEvaluationWindow, required) — The window of event timestamps the close read.

### EventLineageSettlementMeter

The meter the close evaluated; null for a line billed from its events one by one, or a revision no longer found.

- `name` (string, required) — The meter's name.
- `revision` (integer, required) — The meter's revision the close evaluated.

### Quantity

An exact value with an explicit measurement unit.

- `unit` (string, required) — What `value` is measured in: a time unit such as `minute` or `month`, or what a meter counts, such as `token` or `ticket`.
- `value` (string, required) — A non-negative exact decimal string, up to 15 fractional places.

### EventLineageSettlementEvaluationWindow

The window of event timestamps the close read.

- `endsAt` (datetime, required, nullable) — End of the window the close read, exclusive: the line's next billing date; null when not recorded.
- `startsAt` (datetime, required, nullable) — Start of the window the close read; null when not recorded.

## Examples

**Response**

```json
{
  "object": "list",
  "data": [
    {
      "object": "eventLineage",
      "asOf": "2024-01-15T09:30:00Z",
      "credits": [
        {
          "amount": "string",
          "chargedAt": "2024-01-15T09:30:00Z",
          "creditCurrency": "string",
          "creditGrant": "string",
          "customerUnit": "string"
        }
      ],
      "customer": "string",
      "event": "string",
      "eventName": "string",
      "history": [
        {
          "type": "received",
          "occurredAt": "2024-01-15T09:30:00Z"
        }
      ],
      "livemode": true,
      "notCounted": null,
      "partialFailure": {
        "occurredAt": "2024-01-15T09:30:00Z",
        "reason": "string",
        "step": "validation"
      },
      "receivedAt": "2024-01-15T09:30:00Z",
      "status": "counted",
      "timestamp": "2024-01-15T09:30:00Z",
      "usage": [
        {
          "countedAfterInvoice": true,
          "invoice": "string",
          "invoiceLine": "string",
          "orderLine": "string",
          "period": {
            "endsAt": "2024-01-15T09:30:00Z",
            "startsAt": "2024-01-15T09:30:00Z"
          },
          "quantity": {
            "unit": "month",
            "value": "1"
          },
          "status": "collecting",
          "usageLine": "string",
          "settlement": "string"
        }
      ],
      "voided": true
    }
  ],
  "hasMore": true,
  "nextCursor": "cur_9Vb3Lm",
  "summary": {
    "asOf": "2024-01-15T09:30:00Z",
    "byEventName": [
      {
        "aggregatedReason": "aggregateMeter",
        "counted": 1,
        "eventName": "string",
        "notCounted": 1,
        "received": 1,
        "voided": {
          "afterCounted": 1,
          "events": 1
        }
      }
    ],
    "credits": [
      {
        "amount": "string",
        "creditCurrency": "string"
      }
    ],
    "events": 1,
    "notCounted": [
      {
        "events": 1,
        "type": "failed"
      }
    ],
    "usageLine": {
      "asOf": "2024-01-15T09:30:00Z",
      "billedEvents": 1,
      "byEventName": [
        {
          "aggregatedReason": "aggregateMeter",
          "counted": 1,
          "eventName": "string",
          "notCounted": 1,
          "received": 1,
          "voided": {
            "afterCounted": 1,
            "events": 1
          }
        }
      ],
      "countedAfterInvoice": 1,
      "credits": [
        {
          "amount": "string",
          "creditCurrency": "string",
          "customerUnits": [
            {
              "amount": "string",
              "customerUnit": "string",
              "events": 1
            }
          ],
          "events": 1
        }
      ],
      "eventName": "string",
      "events": 1,
      "invoice": "string",
      "invoiceLine": "string",
      "notCounted": {
        "aggregatedReason": "aggregateMeter",
        "events": 1,
        "reasons": [
          {
            "events": 1,
            "exampleEvent": "string",
            "type": "failed"
          }
        ],
        "reasonsStartedAt": "2024-01-15T09:30:00Z"
      },
      "orderLine": "string",
      "otherLines": [
        {
          "events": 1,
          "orderLine": "string",
          "usageLine": "string"
        }
      ],
      "otherLinesTruncated": true,
      "period": {
        "endsAt": "2024-01-15T09:30:00Z",
        "startsAt": "2024-01-15T09:30:00Z"
      },
      "quantity": {
        "unit": "month",
        "value": "1"
      },
      "settlement": {
        "backfilled": {
          "events": 1,
          "lastCountedAt": "2024-01-15T09:30:00Z"
        },
        "countedAfterSettlement": {
          "events": 1,
          "invoice": "string",
          "lastCountedAt": "2024-01-15T09:30:00Z",
          "usageLines": 1
        },
        "evaluation": {
          "carriedIn": 1,
          "carriedOut": 1,
          "events": 1,
          "readAt": "2024-01-15T09:30:00Z",
          "window": {
            "endsAt": "2024-01-15T09:30:00Z",
            "startsAt": "2024-01-15T09:30:00Z"
          }
        },
        "isRebuilt": true,
        "meter": {
          "name": "string",
          "revision": 1
        },
        "settledAt": "2024-01-15T09:30:00Z",
        "skipReason": "noUsage"
      },
      "status": "collecting",
      "untraced": {
        "events": 1,
        "openingBalance": {
          "unit": "month",
          "value": "1"
        }
      },
      "usageLine": "string"
    },
    "voided": {
      "afterCounted": 1,
      "events": 1
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.paid.ai/v1/event-lineages"

headers = {
    "Paid-Beta": "event_lineage=v1",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.paid.ai/v1/event-lineages';
const options = {
  method: 'GET',
  headers: {'Paid-Beta': 'event_lineage=v1', Authorization: 'Bearer <token>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.paid.ai/v1/event-lineages"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Paid-Beta", "event_lineage=v1")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.paid.ai/v1/event-lineages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Paid-Beta"] = 'event_lineage=v1'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.paid.ai/v1/event-lineages")
  .header("Paid-Beta", "event_lineage=v1")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.paid.ai/v1/event-lineages', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Paid-Beta' => 'event_lineage=v1',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.paid.ai/v1/event-lineages");
var request = new RestRequest(Method.GET);
request.AddHeader("Paid-Beta", "event_lineage=v1");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Paid-Beta": "event_lineage=v1",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.paid.ai/v1/event-lineages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```