Export Metronome data
Metronome can send your sandbox and production data directly to your data warehouse, giving you the flexibility to build reports and dashboards with your favorite data tools.
Exporting data from Metronome is a simple process requiring a one-time setup of your data destination at https://app.metronome.com/settings/general/data-export. After the initial export, your data is updated automatically once a day.
To set up your destination data warehouse, please contact your Metronome representative.
Supported destination types
Metronome supports data export to the most common data warehouses, databases, and object storage providers. We continue to add new providers; if your preferred vendor is not listed below, please contact your Metronome representative.
Data warehouse
- BigQuery
- Clickhouse
- Databricks
- Redshift
- Snowflake
Database
- Athena
- MySQL
- Postgres
- SingleStore
Object storage
- Google Cloud Storage
- S3
Object storage destinations listed above will export files as an append-only log with at-least-once semantics. There will be rows with the same primary key in multiple files because of updates to the row or transfer retries. Metronome customers will need to handle these appropriately by using the most recent data for each row.
The data will appear in the following folder structure:
<bucket_name>/<folder_name>/<table_name>/dt=<transfer_date>/<file_part>_<transfer_timestamp>.parquet
Where:
<bucket_name>
and<folder_name>
are provided during destination configuration.<table_name>
is the name of the table being transferred (see Schema tables below for examples).<transfer_date>
and<transfer_timestamp>
are generated at transfer time and based on the transfer's start time.<transfer_date>
is of the form2006-01-01
, while<transfer_timestamp>
is of the form20060102150405
.<file_part>
is a monotonically increasing integer for a given timestamp, and does not carry any special meaning.
Data availability
Metronome can export these types of sandbox and production data:
Metronome data | Table name | Transfer Frequency† | Average Freshness†† |
---|---|---|---|
Alerts | alert | 2 hours | 4 hours |
Alerts | customer_alert_history | 2 hours | 4 hours |
Finalized Invoices | invoice | 2 hours | 4 hours |
Finalized Invoices | line_item | 2 hours | 4 hours |
Finalized Invoices | sub_line_item | 2 hours | 4 hours |
Draft Invoices | draft_invoice | 24 hours | n/a |
Draft Invoices | draft_line_item | 24 hours | n/a |
Draft Invoices | draft_sub_line_item | 24 hours | n/a |
Credit Grants | credit_grant | 2 hours | 4 hours |
Credit Grants | credit_grant_deduction | 2 hours | 4 hours |
Events | events | 2 hours | 4 hours |
Customers | customer | 2 hours | 4 hours |
Customer Plans | customer_plan | 2 hours | 4 hours |
Plans | credit_type | 2 hours | 4 hours |
Plans | plan_charge | 2 hours | 4 hours |
Plans | plan | 2 hours | 4 hours |
Plans | product | 2 hours | 4 hours |
† Transfer frequency indicates the frequency at which new records will be sent to your destination. †† Average Freshness indicates the average delay between when data is generated in Metronome and when the data appears in your destination.
Data exports of every table listed below contain only the rows of data that have changed since the last export. Use the updated_at
column to pull the latest data.
Alerts
Includes alerts and the history of customer alerts being triggered.
Tables
Example 1 - Fetch alerts with webhooks enabled
SELECT id, name, alert_type, threshold FROM alert WHERE webhooks_enabled = TRUE AND disabled_at IS NULL;
Example2 - Fetch count of alerts by day over the last week
SELECT DATE_TRUNC("DAY", ah.created_at) AS alert_date, alert.name, COUNT(alert.id) AS triggered_count
FROM customer_alert_history ah
JOIN alert
ON ah.alert_id = alert.id
GROUP BY 1, 2
ORDER BY 1;
Finalized Invoices
Includes all invoices to customers that have been finalized or voided. No further changes can be made to these invoices or their corresponding line items and sub-line items.
Tables
Note: Sub line items with a quantity of zero will not be exported.
Example 1 - Fetch monthly invoice totals
SELECT DATE_TRUNC("MONTH", end_timestamp) AS month, COUNT(0) AS invoice_count, SUM(total) AS invoice_total FROM invoice
GROUP BY 1
ORDER BY 1;
Example 2 - Fetch monthly usage-based totals
SELECT DATE_TRUNC("MONTH", i.end_timestamp) AS month,
CASE WHEN sli.billable_metric_id IS NULL THEN 'NON_USAGE' ELSE 'USAGE' END AS charge_type
, SUM(sli.subtotal) AS total
FROM invoice i
JOIN line_item li ON i.id = li.invoice_id
JOIN sub_line_item sli ON sli.line_item_id = li.id
GROUP BY 1, 2
ORDER BY 2, 1;
Draft Invoices
Includes all invoices to customers that are in a draft state. These tables are
daily snapshots of invoices based on the configuration and usage at a
point-in-time throughout the day. The updated_at
column is the time that the
invoice row was calculated while the snapshot_time
corresponds to the start of
day (UTC). An invoice row will be populated once per day throughout a billing
period until it is finalized or voided.
If an invoice is in a DRAFT_INCOMPLETE
state, it means that Metronome hasn't
fully computed the invoice. There will be no line items, sub line items, or total
on the invoice. Exporting these invoices lets you know that the invoice exists, but
Metronome has failed to compute it for some reason. Exporting incomplete invoices
enables Metronome to send data to the specified destination as soon as possible.
We expect these incomplete invoices to be hydrated in future snapshots.
Tables
Note: Sub line items with a quantity of zero will not be exported.
Example 1 - Fetch daily invoice totals
SELECT snapshot_time, COUNT(0) AS invoice_count, SUM(total) AS invoice_total FROM draft_invoice
GROUP BY 1
ORDER BY 1;
Example 2 - Fetch invoice total by plan from most recent snapshot
SELECT plan_id, plan_name, COUNT(0) AS invoice_count, SUM(total) AS invoice_total FROM draft_invoice
WHERE snapshot_time = (SELECT MAX(snapshot_time) FROM draft_invoice)
GROUP BY 1,2
ORDER BY 1;
Example 3 - Fetch daily usage-based totals
SELECT snapshot_time,
CASE WHEN billable_metric_id IS NULL THEN 'NON_USAGE' ELSE 'USAGE' END AS charge_type
, SUM(subtotal)
FROM draft_sub_line_item
GROUP BY 1, 2
ORDER BY 2, 1;
Credit Grants
Includes credit grant information required to reconstruct a ledger. The
credit_grant
table will contain all the credit grants and the
credit_grant_deduction
table contains all the deductions (either through
consumption or expiration) that occurred on a given grant.
Tables
Example 1 - Fetch expired credit grants per month
SELECT DATE_TRUNC('MONTH', effective_at), SUM(amount) FROM credit_grant_deduction
WHERE memo = 'Credits expired'
GROUP BY 1
ORDER BY 1;
Events
The full set of de-duplicated raw events received by Metronome regardless of whether or not they matched a billable metric.
Tables
Example 1 - Fetch event count per month
SELECT DATE_TRUNC('MONTH', timestamp), COUNT(0) FROM events
GROUP BY 1
ORDER BY 1;
Customers
Includes customer metadata stored in Metronome including their ingest aliases
which can be joined with the events
table. The archived_at
column is used to
determine whether or not the customer is active.
Tables
Example 1 - Fetch total active customers
SELECT COUNT(0) FROM customer WHERE archived_at IS NULL;
Plans
Includes default pricing information for every plan with their corresponding credit types. A credit type may be a fiat currency such as USD or GBP or a custom pricing unit.
Tables
Example 1 - Fetch all charges for a given plan
SELECT * FROM plan_charge WHERE plan_id = 'deadbeef-0000-0000-0000-0000deadbeef';
Example 2 - Fetch all plans starting in the next 7 days
SELECT * FROM plan WHERE starting_on >= CURRENT_DATE() AND starting_on <= DATEADD("DAY", 7, CURRENT_DATE());
Data is exported once per day, which means that some data may be up to 24 hours behind.
Schema
Due to our export methodology, all columns may appear as nullable in your
destination schema. The Nullable
column in the table below reflects how your
data is stored in Metronome.
Browse our interactive Entity Relationship Diagram that shows our full Schema and its relationships, as well as slices of the data to help you better visualize which tables are connected to each other.
(Scroll tables to the right to view the data types for every destination.)
metadata
Clients using Metronome have different external systems that require different metadata to be stored. This metadata is client specific and stored as a JSON object in the metadata
column of each table and on some of the JSON encoded objects too.
alert
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The alert ID | N | text | text | varchar | string | string |
name | The name of the alert | N | text | text | varchar | string | string |
alert_type | The type of alert | Y | text | text | varchar | string | string |
threshold | The threshold to trigger the alert | N | decimal | decimal | decimal | numeric | decimal |
webhooks_enabled | Indicates if the alert is configured for webhooks | N | boolean | boolean | boolean | boolean | boolean |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
created_at | The timestamp (UTC) of when the alert was created | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
disabled_at | The timestamp (UTC) of when the alert was disabled | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
updated_at | The timestamp (UTC) of when the alert was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
billable_metric
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The Billable Metric ID | N | text | text | varchar | string | string |
aggregate | The aggregation type | N | text | text | varchar | string | string |
aggregate_keys | The keys used for aggregation | N | text | text | varchar | string | string |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
group_keys | The keys associated with this metric | N | jsonb | variant | varchar | string | string |
name | The name of this metric | N | text | text | varchar | string | string |
created_at | The timestamp (UTC) of when the billable_metric was created | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
archived_at | The timestamp (UTC) of when the billable_metric was deleted | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
updated_at | The timestamp (UTC) of when the billable_metric was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
credit_grant
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The credit grant ID | N | text | text | varchar | string | string |
customer_id | The customer ID associated with the credit grant | N | text | text | varchar | string | string |
name | The name of the credit grant | N | text | text | varchar | string | string |
invoice_id | The ID of the invoice with the purchase charge for the credit grant, if applicable | Y | text | text | varchar | string | string |
priority | The priority of the credit grant | N | decimal | decimal | decimal | numeric | decimal |
reason | The reason of the credit grant | Y | text | text | varchar | string | string |
amount_granted | The amount of credit granted | N | decimal | decimal | decimal | numeric | decimal |
amount_granted_credit_type_id | The credit type ID for the amount granted | N | text | text | varchar | string | string |
amount_paid | The amount paid for the credit grant | N | decimal | decimal | decimal | numeric | decimal |
amount_paid_credit_type_id | The credit type ID for the amount paid | N | text | text | varchar | string | string |
custom_fields | Custom fields attached to the credit grant | Y | jsonb | variant | varchar | string | string |
product_ids | The products which the credit grant are applied to; this will be "[]" if the credit grant applies to all products | N | jsonb | variant | varchar | string | string |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
created_at | The timestamp (UTC) of when the credit grant was created | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
updated_at | The timestamp (UTC) of when the credit grant was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
effective_at | The timestamp (UTC) of when the credit grant is effective from | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
expires_at | The timestamp (UTC) of when the credit grant expires at | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
voided_at | The timestamp (UTC) of when the credit grant was voided, if applicable | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
credit_grant_type | The optional credit grant type specified during grant creation | Y | text | text | text | timestamp | timestamp |
credit_grant_deduction
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The credit grant deduction ID | N | text | text | varchar | string | string |
credit_grant_id | The credit grant ID associated with the credit grant deduction | N | text | text | varchar | string | string |
amount | The amount of credit deducted | N | decimal | decimal | decimal | numeric | decimal |
memo | The memo of the credit grant deduction | N | text | text | varchar | string | string |
invoice_id | The invoice ID associated with the credit grant deduction | N | text | text | varchar | string | string |
effective_at | The timestamp (UTC) of when the credit grant deduction occurred | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
updated_at | The timestamp (UTC) this row was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
credit_type
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The credit type ID | N | text | text | varchar | string | string |
name | The name of the credit type | N | text | text | varchar | string | string |
is_currency | Whether or not the credit type is a currency, TRUE or FALSE | N | boolean | boolean | boolean | bool | boolean |
environment_type | The Metronome environment, SANDBOX or PRODUCTION ; this will always be NULL for currencies | Y | text | text | varchar | string | string |
updated_at | The timestamp (UTC) this row was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
_metronome_metadata_id | Metronome metadata ID | N | text | text | varchar | string | string |
customer_alert_history
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The customer alert ID | N | text | text | varchar | string | string |
customer_id | The customer ID associated with the alert | N | text | text | varchar | string | string |
alert_id | The alert ID | N | text | text | varchar | string | string |
alert_status | The status of the triggered alert | N | text | text | varchar | string | string |
additional_data | Additional data included in the alert | Y | jsonb | variant | varchar | string | string |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
created_at | The timestamp (UTC) of the alert was triggered | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
customer
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The Metronome ID of the customer | N | text | text | varchar | string | string |
name | The name of the customer | N | text | text | varchar | string | string |
ingest_aliases | The ingest aliases of the customer | N | jsonb | variant | varchar | string | string |
salesforce_account_id | The Salesforce account ID for the customer | Y | text | text | varchar | string | string |
billing_provider_type | The billing provider connected to customer | Y | text | text | varchar | string | string |
billing_provider_customer_id | The billing provider ID of the customer | Y | text | text | varchar | string | string |
custom_fields | Custom fields attached to the customer | Y | jsonb | variant | varchar | string | string |
environment_type | The Metronome environment | N | text | text | varchar | string | string |
created_at | The timestamp (UTC) of when the customer was created | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
updated_at | The timestamp (UTC) of when the customer was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
archived_at | The timestamp (UTC) of when the customer was archived, if applicable | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
customer_plan
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The Metronome ID for the customer plan | N | text | text | varchar | string | string |
customer_id | The customer ID associated with the customer plan | N | text | text | varchar | string | string |
plan_id | The plan ID associated with the customer plan | N | text | text | varchar | string | string |
plan_name | The plan name associated with the customer plan | N | text | text | varchar | string | string |
starting_on | The timestamp (UTC) of when the customer plan is active | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
ending_before | The timestamp (UTC) of when the customer plan is inactive | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
net_payment_term_days | The net payment terms in days | Y | decimal | decimal | decimal | numeric | decimal |
custom_fields | Custom fields attached to the customer plan | Y | jsonb | variant | varchar | string | string |
created_at | The timestamp (UTC) of when the customer was assigned this plan | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
updated_at | The timestamp (UTC) of when the customer, plan, or any associated custom fields were updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
deleted_at | The timestamp (UTC) of when the customer plan was deleted, if applicable | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
draft_invoice
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
_metronome_metadata_id | Unique identifier for each draft invoice ID + snapshot_time pair | N | text | text | varchar | string | string |
id | The Metronome invoice ID | N | text | text | varchar | string | string |
status | The Metronome invoice status: DRAFT or DRAFT_INCOMPLETE (see the invoice table for FINALIZED and VOID invoices) | N | text | text | varchar | string | string |
total | The invoice total | Y | decimal | decimal | decimal | numeric | decimal |
credit_type_id | The credit type ID for the invoice | N | text | text | varchar | string | string |
credit_type_name | The name of the credit type associated with the invoice | N | text | text | varchar | string | string |
customer_id | The Metronome ID of the customer | N | text | text | varchar | string | string |
plan_id | The plan ID associated with the invoice | N | text | text | varchar | string | string |
plan_name | The name of the plan associated with the invoice | N | text | text | varchar | string | string |
start_timestamp | Beginning of the usage period that this invoice covers (UTC) | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
end_timestamp | End of the usage period that this invoice covers (UTC) | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
billing_provider_invoice_id | The external invoice ID from the billing provider (e.g., Stripe) | Y | text | text | varchar | string | string |
billing_provider_invoice_created_at | The timestamp (UTC) the external invoice was created by Metronome | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
updated_at | The timestamp (UTC) this row was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
snapshot_time | The timestamp (UTC) aligning with the start of the snapshot | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
label | The categorical label of the invoice | Y | text | text | varchar | string | string |
draft_line_item
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
_metronome_metadata_id | Opaque unique identifier for each row | N | text | text | varchar | string | string |
id | The line item ID | N | text | text | varchar | string | string |
invoice_id | The Metronome invoice ID associated with the line item | N | text | text | varchar | string | string |
credit_grant_id | The credit grant ID associated with the line item | N | text | text | varchar | string | string |
credit_type_id | The credit type ID associated with the line item | N | text | text | varchar | string | string |
credit_type_name | The name of the credit type associated with the line item | N | text | text | varchar | string | string |
name | The line item description | N | text | text | varchar | string | string |
quantity | The quantity associated with the line item; this will always be 1 for invoice adjustments | Y | decimal | decimal | decimal | numeric | decimal |
total | The line item total | N | decimal | decimal | decimal | numeric | decimal |
commit_id | The commit ID associated with the line item. Only present for beta Contract Invoices | Y | text | text | varchar | string | string |
product_id | The product ID associated with the line item; this will always be NULL for invoice adjustments | Y | text | text | varchar | string | string |
group_key | The group key associated with the line item | Y | text | text | varchar | string | string |
group_value | The group value associated with the line item | Y | text | text | varchar | string | string |
is_prorated | Indicates if the value is prorated over the period. For subscription charges only. | Y | boolean | boolean | boolean | boolean | boolean |
updated_at | The timestamp (UTC) of when the line item was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
snapshot_time | The timestamp (UTC) aligning with the start of the snapshot | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
draft_sub_line_item
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
_metronome_metadata_id | Opaque unique identifier for each row | N | text | text | varchar | string | string |
id | The sub line item ID | N | text | text | varchar | string | string |
line_item_id | The line item ID associated with the sub line item | N | text | text | varchar | string | string |
name | The sub line item description | N | text | text | varchar | string | string |
quantity | The quantity associated with the sub line item | Y | decimal | decimal | decimal | numeric | decimal |
subtotal | The subtotal associated with the sub line item | Y | decimal | decimal | decimal | numeric | decimal |
charge_id | The charge ID associated with the sub line item | N | text | text | varchar | string | string |
is_prorated | Indicates if the value is prorated over the period. For subscription charges only. | Y | boolean | boolean | boolean | boolean | boolean |
billable_metric_id | The billable metric ID associated with the sub line item | Y | text | text | varchar | string | string |
billable_metric_name | The name of the billable metric associated with the sub line item | Y | text | text | varchar | string | string |
tiers | Information about the tiers associated with the sub line item, including sub_line_item_id , name , quantity , subtotal , updated_at , price , and starting_at | Y | jsonb | variant | varchar | string | string |
updated_at | The timestamp (UTC) this row was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
snapshot_time | The timestamp (UTC) aligning with the start of the snapshot | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
events
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
transaction_id | The unique ID of the event | N | text | text | varchar | string | string |
customer_id | The ID of the customer the event applies to | N | text | text | varchar | string | string |
timestamp | The timestamp (UTC) of the event | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
event_type | The event type | N | text | text | varchar | string | string |
properties | The properties of the event | N | jsonb | variant | varchar | string | string |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
_metronome_metadata_id | Metronome metadata ID | N | text | text | varchar | string | string |
invoice
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The Metronome invoice ID | N | text | text | varchar | string | string |
status | The Metronome invoice status: FINALIZED or VOID | N | text | text | varchar | string | string |
total | The invoice total | N | decimal | decimal | decimal | numeric | decimal |
credit_type_id | The credit type ID for the invoice | N | text | text | varchar | string | string |
credit_type_name | The name of the credit type associated with the invoice | N | text | text | varchar | string | string |
customer_id | The Metronome ID of the customer | N | text | text | varchar | string | string |
plan_id | The plan ID associated with the invoice | N | text | text | varchar | string | string |
plan_name | The name of the plan associated with the invoice | N | text | text | varchar | string | string |
start_timestamp | Beginning of the usage period that this invoice covers (UTC) | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
end_timestamp | End of the usage period that this invoice covers (UTC) | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
billing_provider_invoice_id | The external invoice ID from the billing provider (e.g., Stripe) | Y | text | text | varchar | string | string |
billing_provider_type | The type of external system billing provider (e.g. Stripe) | Y | text | text | varchar | string | string |
billing_provider_invoice_created_at | The timestamp (UTC) the external invoice was created by Metronome | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
billing_provider_invoice_external_status | The status of the invoice in the external system (e.g. Stripe) | Y | text | text | varchar | string | string |
invoice_label | The categorical label of the invoice | N | text | text | varchar | string | string |
issued_at | The timestamp (UTC) the invoices was issued. | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
metadata | Metadata | Y | jsonb | variant | varchar | string | string |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
updated_at | The timestamp (UTC) this row was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
invoice_corrections
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The Metronome invoice correction ID | N | text | text | varchar | string | string |
invoice_id | The Metronome invoice ID associated with the correction | N | text | text | varchar | string | string |
base_invoice_id | The Metronome invoice ID associated with the correction | N | text | text | varchar | string | string |
reason | The reason for the correction | N | text | text | varchar | string | string |
memo | The memo for the correction | N | text | text | varchar | string | string |
sequence_number | Indicates if the correction is one of many applied to invoice | N | text | text | varchar | string | string |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
created_at | The timestamp (UTC) this correction was created | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
line_item
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The line item ID | N | text | text | varchar | string | string |
invoice_id | The Metronome invoice ID associated with the line item | N | text | text | varchar | string | string |
credit_grant_id | The credit grant ID associated with the line item | N | text | text | varchar | string | string |
credit_type_id | The credit type ID associated with the line item | N | text | text | varchar | string | string |
credit_type_name | The name of the credit type associated with the line item | N | text | text | varchar | string | string |
name | The line item description | N | text | text | varchar | string | string |
quantity | The quantity associated with the line item; this will always be 1 for invoice adjustments | Y | decimal | decimal | decimal | numeric | decimal |
total | The line item total | N | decimal | decimal | decimal | numeric | decimal |
commit_id | The commit ID associated with the line item. Only present for beta Contract Invoices | Y | text | text | varchar | string | string |
product_id | The product ID associated with the line item; this will always be NULL for invoice adjustments | Y | text | text | varchar | string | string |
group_key | The group key associated with the line item | Y | text | text | varchar | string | string |
group_value | The group value associated with the line item | Y | text | text | varchar | string | string |
unit_price | The price associated with the line item | Y | decimal | decimal | decimal | numeric | decimal |
starting_on | The timestamp (UTC) of when the line item is effective from (inclusive) | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
ending_before | The timestamp (UTC) of when the line item is effective to (exclusive) | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
pricing_group_values | Optional pricing group values array | Y | jsonb | variant | varchar | string | string |
metadata | Metadata | Y | jsonb | variant | varchar | string | string |
updated_at | The timestamp (UTC) of when the line item was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
sub_line_item
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The sub line item ID | N | text | text | varchar | string | string |
line_item_id | The line item ID associated with the sub line item | N | text | text | varchar | string | string |
name | The sub line item description | N | text | text | varchar | string | string |
quantity | The quantity associated with the sub line item | Y | decimal | decimal | decimal | numeric | decimal |
subtotal | The subtotal associated with the sub line item | Y | decimal | decimal | decimal | numeric | decimal |
charge_id | The charge ID associated with the sub line item | N | text | text | varchar | string | string |
billable_metric_id | The billable metric ID associated with the sub line item | Y | text | text | varchar | string | string |
billable_metric_name | The name of the billable metric associated with the sub line item | Y | text | text | varchar | string | string |
tiers | Information about the tiers associated with the sub line item, including sub_line_item_id , name , quantity , subtotal , updated_at , price , and starting_at | Y | jsonb | variant | varchar | string | string |
updated_at | The timestamp (UTC) this row was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
plan_charge
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | Metronome metadata ID | N | text | text | varchar | string | string |
charge_id | The ID of the plan charge | N | text | text | varchar | string | string |
name | The name of the plan charge | N | text | text | varchar | string | string |
plan_id | The ID of the plan associated with the plan charge | N | text | text | varchar | string | string |
product_id | The ID of the product associated with the plan charge | N | text | text | varchar | string | string |
product_name | The name of the product associated with the plan charge | N | text | text | varchar | string | string |
billable_metric_id | The ID of the billable metric associated with the plan charge | Y | text | text | varchar | string | string |
billable_metric_name | The name of the billable metric associated with the plan charge | Y | text | text | varchar | string | string |
start_period | The starting period of the associated plan charge | N | decimal | decimal | decimal | decimal | decimal |
credit_type_id | The credit type ID | N | text | text | varchar | string | string |
credit_type_name | The credit type name | N | text | text | varchar | string | string |
charge_type | The type of charge ("usage", "fixed", "composite", "minimum", or "seat") | N | text | text | varchar | string | string |
quantity | The default quantity of the plan charge | Y | decimal | decimal | decimal | decimal | decimal |
environment_type | The environment of the plan charge | N | text | text | varchar | string | string |
prices | The prices associated with the plan charge | N | jsonb | variant | varchar | string | string |
custom_fields | Custom fields attached to the charge | Y | jsonb | variant | varchar | string | string |
updated_at | The timestamp (UTC) of when the plan charge was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
plan
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The plan ID | N | text | text | varchar | string | string |
name | The name of the plan | N | text | text | varchar | string | string |
description | The description of the plan | N | text | text | varchar | string | string |
billing_frequency | The frequency of billing for the plan | N | text | text | varchar | string | string |
starting_on | The timestamp (UTC) this plan started | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
custom_fields | Custom fields attached to the plan | Y | jsonb | variant | varchar | string | string |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
created_at | The timestamp (UTC) of when the plan was created | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
deprecated_at | The timestamp (UTC) of when the plan was deprecated, if applicable | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
updated_at | The timestamp (UTC) of when the plan was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
product
Column name | Description | Nullable? | Postgres data type | Snowflake data type | Redshift data type | BigQuery data type | Databricks data type |
---|---|---|---|---|---|---|---|
id | The product ID | N | text | text | varchar | string | string |
name | The name of the product | N | text | text | varchar | string | string |
description | The description of the product | N | text | text | varchar | string | string |
custom_fields | Custom fields attached to the product | Y | jsonb | variant | varchar | string | string |
created_at | The timestamp (UTC) of when the product was created | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
environment_type | The Metronome environment, SANDBOX or PRODUCTION | N | text | text | varchar | string | string |
deprecated_at | The timestamp (UTC) of when the product was deprecated, if applicable | Y | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |
updated_at | The timestamp (UTC) of when the product was last updated | N | timestamptz | timestamp_tz | timestamptz | timestamp | timestamp |