Skip to main content

Exported resources

The table below provides an overview of the supported resources, the schema, and any notes on their sync behavior:

ResourceSync CadenceNotesSchema
Credit ledger entryDailyOrb syncs all committed (i.e. non-pending) ledger entries.This mirrors the schema returned by the Fetch credits ledger endpoint.
CustomerDailyCustomer resourceThis mirrors the schema returned by the Fetch customer endpoint.
Daily Line Item RevenueDailyCurrently in beta, please reach out to your Orb sales representative for more information.More information can be found below
InvoiceDailyOrb syncs invoices, except draft invoices which are filtered out.This mirrors the schema returned by the Fetch invoice endpoint.
SubscriptionDailySubscription resourceThis mirrors the schema returned by the Fetch subscription endpoint.
Subscription versionDailyThis captures the subscription schedule of a subscription, specifically allowing you to understand plan transitions.A JSON object with the following keys: start_date, ended_at, plan, subscription_id subscription_start_date, subscription_ended_at

Daily Line Item Revenue

Overview

The Daily Line Item Revenue resource can be used to track the daily quantity and associated costs for invoice line items. This resource will function similarly to the subscription costs endpoint, but with more fine grained access to information.

This information can be used to power use cases like:

  • Daily revenue recognition workflows
  • Running pricing exercises

As mentioned, this resource will track daily quantities, but will reflect intra-day plan changes where applicable. This means that rows may span time periods less than a day in cases where a plan changes. Values in the export are periodic values (as opposed to cumulative values) and only relevant to the applicable timeframe.

The Daily Line Item Revenue resource is conceptually an append only resource. Entries in this table can be reverted. For example, when a backdated operation occurs, this may result in old values changing. When entries are reverted, they will have a corresponding timestamp in their reverted_at field but will still exist in the table. This means that historical queries can be constructed to understand what values were returned in the past.

The Daily Line Item Revenue resource relies on upstream processes running to calculate these values. Importantly, this processing relies on the grace period ending before it can run. This means that entries in this resource will be delayed. On average, we expect this delay to be approximately three days.

Schema

Field NameTypeDescription
customer_idstringThe ID of the customer.
subscription_idnullable stringThe ID of the subscription.

Note that a subscription ID may not always be present due to things like one-off invoices.
pricing_currencystringThe currency of the underlying price.
invoicing_currencynullable stringThe currency used for invoicing if it differs from the price’s currency.

Today, this only occurs if you are using virtual pricing units.
item_idstringThe ID of the item
invoice_idstringThe ID of the invoice
invoice_line_item_idstringThe ID of the invoice line item
price_idstringThe ID of the price
billable_metric_idnullable stringThe ID of the billable metric.

Note that a billable metric ID may not be present if the associated price is not usage based.
plan_idnullable stringThe ID of the plan.

Note that it may not always be present due to things like one-off invoices.
timeframe_starttimestampThe inclusive timestamp for the start of the relevant period.

Note that entries are scoped to day boundaries, but may start or end in the middle of the day if a plan change occurs.
timeframe_endtimestampThe exclusive timestamp for the end of the relevant period.

Note that entries are scoped to day boundaries, but may start or end in the middle of the day if a plan change occurs.
quantitydecimalThe price’s quantity for the relevant timeframe.
subtotaldecimalThe list price before any adjustments have been applied.
adjusted_subtotaldecimalThe list price after adjustments have been applied.

Called the “total” in the subscription costs API. This has been renamed to avoid confusion.
amountdecimalThe list price after: adjustments have been applied, prepaid credits have been applied, and overage conversions have been applied
credits_applieddecimalThe number of credits used.
conversion_ratedecimalThe conversion rate between the price currency and the invoicing currency.

If they are the same, this is 1.
adjustmentsJSONB

An array of dictionaries with: adjustment ID, adjustment type, amount, and price IDs.
The adjustments made to line items to account for maximums, minimums, and discounts.
sub_line_itemsnullable JSONB

If this field is null, the number of sub-line items exceeds 100. This is differentiated from cases with no sub-line items, where the column will be empty JSON.
The serialized sub-line items from the invoice.

This field can contain up to 100 sub-line items for a given line item. If the number of sub-line items exceeds 100, this field will not contain any sub-line items.
reverted_atnullable timestampWhen this entry was reverted.

Entries are reverted when backdated operations occur that change the amounts for a given invoice line item on a specified day. Entries are never deleted and are only marked as reverted to allow for historical tracking of values returned on a given day in the past.

A row is valid in this table if reverted_at is null.