Metronome

App · 30 actions

Run usage-based billing in Metronome: create customers, billable metrics, products, rate cards and contracts, send and read usage, grant credits, check balances and read invoices.

Actions

ActionWhat it does
Add rateSet a product's flat price on a rate card from a time on.
Archive billable metricArchive a billable metric so no new product can use it.
Archive contractPermanently end and archive a contract.
Archive customerArchive a customer.
Archive productArchive a product.
Archive rate cardArchive a rate card so no new contract can use it.
Create billable metricDefine what Metronome measures: events of one type, counted or aggregated over a property such as tokens used.
Create contractPut a customer on a rate card from a start time, so their usage is priced and invoiced.
Create creditGive a customer credit that offsets what they owe, for a period.
Create customerCreate a customer in Metronome.
Create productCreate something customers are charged for: a usage product that charges per unit of a billable metric, or a fixed product.
Create rate cardCreate a rate card, the price list contracts take their rates from.
Get billable metricGet one billable metric with its event filter and aggregation.
Get contractGet one contract of a customer with its rate card, term and credits.
Get customerGet one customer with its name, usage aliases and dates.
Get invoiceGet one invoice with its line items and total.
Get net balanceGet what a customer can still spend across all their credits and commits right now, in cents for US dollars.
Get productGet one product with its current name and billable metric.
Get ratesGet the rates a rate card has at one moment, such as now.
Get usageGet how much of a billable metric a customer used over a period.
List billable metricsList the billable metrics Metronome measures.
List contractsList a customer's contracts.
List creditsList the credits a customer has been given, with what is left of each.
List customersList customers, optionally those with one usage alias or only archived ones.
List invoicesList a customer's invoices, including the draft one Metronome keeps up to date for the current period.
List productsList products, active ones unless you choose otherwise.
List rate cardsList rate cards with their names, currencies and aliases.
Rename customerChange a customer's name.
Search usage eventsLook up reported usage events by transaction id, to see how Metronome processed them and which billable metrics they matched.
Send usage eventReport one usage event, such as an API call.

Add rate

Set a product's flat price on a rate card from a time on. Prices are in the smallest unit of the rate card's currency, such as cents.

Inputs

Rate cardrate_card_idtextRequired
The rate card. Pick one, or give its id from an earlier step.
Productproduct_idtextRequired
The product. Pick one, or give its id from an earlier step.
Price per unitpricenumberRequired
The price of one unit, in cents for US dollars.At least 0.
Startsstarting_atdate and timeRequired
When the rate takes effect. It is cut back to the start of its hour.
Endsending_beforedate and time
When the rate stops. Leave empty for no end.

Outputs

product_idtext
The product priced
rateobject
The rate that was set
rate_card_idtext
The rate card
starting_attext
When the rate starts
Example output
{
  "product_id": "c7b6080f-202f-40df-8971-45ee4f5cf842",
  "rate": {
    "credit_type": {
      "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
      "name": "USD (cents)"
    },
    "price": 5,
    "rate_type": "FLAT"
  },
  "rate_card_id": "5b2a6408-58de-4e9f-8dd1-c95fd5f192d5",
  "starting_at": "2026-01-01T00:00:00Z"
}

Archive billable metric

Archive a billable metric so no new product can use it.

Inputs

Billable metricbillable_metric_idtextRequired
The billable metric. Pick one, or give its id from an earlier step.

Outputs

archivedtrue/false
Always true once archived
billable_metric_idtext
The id of the billable metric archived
Example output
{
  "archived": true,
  "billable_metric_id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583"
}

Archive contract

Permanently end and archive a contract. This cannot be undone.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Contract IDcontract_idtextRequired
The contract's id, from 'List contracts' or 'Create contract'.
Void its invoicesvoid_invoicestrue/false
Void the contract's invoices too. On by default.Default: true.

Outputs

archivedtrue/false
Always true once archived
contract_idtext
The contract archived
invoices_voidedtrue/false
Whether its invoices were voided
Example output
{
  "archived": true,
  "contract_id": "1ecbd51b-2d10-4689-900c-95d4c904c516",
  "invoices_voided": true
}

Archive customer

Archive a customer. Metronome keeps its records for audit, and usage is no longer billed to them.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.

Outputs

archivedtrue/false
Always true once archived
customer_idtext
The id of the customer archived
Example output
{
  "archived": true,
  "customer_id": "2b89b713-b131-4928-b642-52573d1e738f"
}

Archive product

Archive a product. Rate cards stop offering it.

Inputs

Productproduct_idtextRequired
The product. Pick one, or give its id from an earlier step.

Outputs

archivedtrue/false
Always true once archived
product_idtext
The id of the product archived
Example output
{
  "archived": true,
  "product_id": "c7b6080f-202f-40df-8971-45ee4f5cf842"
}

Archive rate card

Archive a rate card so no new contract can use it.

Inputs

Rate cardrate_card_idtextRequired
The rate card. Pick one, or give its id from an earlier step.

Outputs

archivedtrue/false
Always true once archived
rate_card_idtext
The id of the rate card archived
Example output
{
  "archived": true,
  "rate_card_id": "5b2a6408-58de-4e9f-8dd1-c95fd5f192d5"
}

Create billable metric

Define what Metronome measures: events of one type, counted or aggregated over a property such as tokens used.

Inputs

NamenametextRequired
The metric's name.
Event typeevent_typetextRequired
The type of usage event to measure, as your events name it.
How to measureaggregation_typetext
How the events are combined. Defaults to the sum of a property.One of: sum (Sum of a property (default)), count (Count of events), max (Highest value of a property), latest (Latest value of a property), unique (Number of unique values of a property).
Propertyaggregation_keytext
The event property to measure, such as units or tokens. Not needed to count events.

Outputs

billable_metricobject
The new billable metric
Example output
{
  "billable_metric": {
    "id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583"
  }
}

Create contract

Put a customer on a rate card from a start time, so their usage is priced and invoiced.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Rate cardrate_card_idtextRequired
The rate card. Pick one, or give its id from an earlier step.
Startsstarting_atdate and timeRequired
When the contract starts. It is cut back to the start of its hour.
Endsending_beforedate and time
When the contract ends. Leave empty for no end.
Namenametext
A name for the contract.
Payment terms (days)net_payment_terms_daysnumber
Days the customer has to pay an invoice.From 0 to 365.

Outputs

contractobject
The new contract
Example output
{
  "contract": {
    "archived_at": "",
    "commits": [],
    "created_at": "2026-11-13T19:05:42Z",
    "credits": [],
    "custom_fields": {},
    "customer_id": "2b89b713-b131-4928-b642-52573d1e738f",
    "ending_before": "",
    "id": "1ecbd51b-2d10-4689-900c-95d4c904c516",
    "name": "Acme contract",
    "overrides": [],
    "rate_card_id": "5b2a6408-58de-4e9f-8dd1-c95fd5f192d5",
    "scheduled_charges": [],
    "starting_at": "2026-11-01T00:00:00Z",
    "subscriptions": [],
    "usage_statement_schedule": {
      "frequency": "MONTHLY"
    }
  }
}

Create credit

Give a customer credit that offsets what they owe, for a period. The amount is in the smallest unit of the currency, such as cents.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Productproduct_idtextRequired
The product the credit is recorded against, usually a fixed one.
AmountamountnumberRequired
How much credit, in cents for US dollars.At least 0.
Startsstarting_atdate and timeRequired
When the credit becomes usable.
Expiresending_beforedate and timeRequired
When the credit expires.
Namenametext
A name for the credit, shown on invoices.
Priorityprioritynumber
The credit with the lower number is used first. Defaults to 1.At least 0.

Outputs

creditobject
The new credit
customer_idtext
The customer credited
Example output
{
  "credit": {
    "id": "f05ae755-526b-4312-9b4e-3f18b2cf6cb4"
  },
  "customer_id": "2b89b713-b131-4928-b642-52573d1e738f"
}

Create customer

Create a customer in Metronome. Give the aliases your usage events use to name them, such as your own account id.

Inputs

NamenametextRequired
The customer's name, up to 160 characters.
Usage aliasesingest_aliasestext
Ids your usage events use for this customer, separated by commas. Usage sent with one of them is billed to this customer.

Outputs

customerobject
The new customer
Example output
{
  "customer": {
    "archived_at": "",
    "created_at": "2026-11-13T19:05:12Z",
    "custom_fields": {},
    "external_id": "acme",
    "id": "2b89b713-b131-4928-b642-52573d1e738f",
    "ingest_aliases": [
      "acme"
    ],
    "name": "Acme, Inc.",
    "updated_at": "2026-11-13T19:05:12Z"
  }
}

Create product

Create something customers are charged for: a usage product that charges per unit of a billable metric, or a fixed product.

Inputs

NamenametextRequired
The product's name, shown on invoices.
Typeproduct_typetext
Usage products need a billable metric. Defaults to usage.One of: USAGE (Usage: charged per unit of a billable metric (default)), FIXED (Fixed: a flat charge such as a platform fee or a credit).
Billable metricbillable_metric_idtext
What a usage product charges for. Leave empty for a fixed product.

Outputs

productobject
The new product
Example output
{
  "product": {
    "id": "c7b6080f-202f-40df-8971-45ee4f5cf842"
  }
}

Create rate card

Create a rate card, the price list contracts take their rates from. It prices in US dollars.

Inputs

NamenametextRequired
The rate card's name. Only your team sees it.
Descriptiondescriptiontext
A note about the rate card.

Outputs

rate_cardobject
The new rate card
Example output
{
  "rate_card": {
    "id": "5b2a6408-58de-4e9f-8dd1-c95fd5f192d5"
  }
}

Get billable metric

Get one billable metric with its event filter and aggregation.

Inputs

Billable metricbillable_metric_idtextRequired
The billable metric. Pick one, or give its id from an earlier step.

Outputs

billable_metricobject
The metric
Example output
{
  "billable_metric": {
    "aggregation_key": "units",
    "aggregation_type": "sum",
    "archived_at": "",
    "custom_fields": {},
    "event_type_filter": {
      "in_values": [
        "api_call"
      ]
    },
    "group_keys": [],
    "id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583",
    "name": "API calls",
    "property_filters": [
      {
        "exists": true,
        "name": "units"
      }
    ]
  }
}

Get contract

Get one contract of a customer with its rate card, term and credits.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Contract IDcontract_idtextRequired
The contract's id, from 'List contracts' or 'Create contract'.

Outputs

contractobject
The contract
Example output
{
  "contract": {
    "archived_at": "",
    "commits": [],
    "created_at": "2026-11-13T19:05:42Z",
    "credits": [],
    "custom_fields": {},
    "customer_id": "2b89b713-b131-4928-b642-52573d1e738f",
    "ending_before": "",
    "id": "1ecbd51b-2d10-4689-900c-95d4c904c516",
    "name": "Acme contract",
    "overrides": [],
    "rate_card_id": "5b2a6408-58de-4e9f-8dd1-c95fd5f192d5",
    "scheduled_charges": [],
    "starting_at": "2026-11-01T00:00:00Z",
    "subscriptions": [],
    "usage_statement_schedule": {
      "frequency": "MONTHLY"
    }
  }
}

Get customer

Get one customer with its name, usage aliases and dates.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.

Outputs

customerobject
The customer
Example output
{
  "customer": {
    "archived_at": "",
    "created_at": "2026-11-13T19:05:12Z",
    "custom_fields": {},
    "external_id": "acme",
    "id": "2b89b713-b131-4928-b642-52573d1e738f",
    "ingest_aliases": [
      "acme"
    ],
    "name": "Acme, Inc.",
    "updated_at": "2026-11-13T19:05:12Z"
  }
}

Get invoice

Get one invoice with its line items and total.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Invoice IDinvoice_idtextRequired
The invoice's id, from 'List invoices'.

Outputs

invoiceobject
The invoice
Example output
{
  "invoice": {
    "contract_id": "1ecbd51b-2d10-4689-900c-95d4c904c516",
    "credit_type": {
      "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
      "name": "USD (cents)"
    },
    "customer_id": "2b89b713-b131-4928-b642-52573d1e738f",
    "end_timestamp": "2026-12-01T00:00:00Z",
    "id": "6babcc42-11bb-59cd-8bbd-7fd32b9f2e73",
    "issued_at": "2026-12-02T00:00:00Z",
    "line_items": [
      {
        "name": "API usage",
        "quantity": 3,
        "total": 15
      }
    ],
    "start_timestamp": "2026-11-01T00:00:00Z",
    "status": "DRAFT",
    "total": 15,
    "type": "USAGE"
  }
}

Get net balance

Get what a customer can still spend across all their credits and commits right now, in cents for US dollars.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.

Outputs

balancenumber
The balance left to spend
credit_type_idtext
The currency's id
customer_idtext
The customer
Example output
{
  "balance": 485,
  "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
  "customer_id": "2b89b713-b131-4928-b642-52573d1e738f"
}

Get product

Get one product with its current name and billable metric.

Inputs

Productproduct_idtextRequired
The product. Pick one, or give its id from an earlier step.

Outputs

productobject
The product
Example output
{
  "product": {
    "archived_at": "",
    "current": {
      "billable_metric_id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583",
      "created_at": "2026-11-13T19:05:26Z",
      "name": "API usage",
      "tags": []
    },
    "custom_fields": {},
    "id": "c7b6080f-202f-40df-8971-45ee4f5cf842",
    "initial": {
      "billable_metric_id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583",
      "created_at": "2026-11-13T19:05:26Z",
      "name": "API usage",
      "tags": []
    },
    "type": "USAGE",
    "updates": []
  }
}

Get rates

Get the rates a rate card has at one moment, such as now.

Inputs

Rate cardrate_card_idtextRequired
The rate card. Pick one, or give its id from an earlier step.
Atatdate and time
The moment to read the rates at. Defaults to now.
Page sizelimitnumber
How many to return, 1 to 100. Metronome's default is used if empty.From 1 to 100.
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

countnumber
How many on this page
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
rateslist
The rates in force
Example output
{
  "count": 1,
  "next_page": "",
  "rates": [
    {
      "ending_before": "",
      "entitled": true,
      "product_id": "c7b6080f-202f-40df-8971-45ee4f5cf842",
      "product_name": "API usage",
      "product_tags": [],
      "rate": {
        "credit_type": {
          "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
          "name": "USD (cents)"
        },
        "price": 5,
        "rate_type": "FLAT"
      },
      "starting_at": "2026-01-01T00:00:00Z"
    }
  ]
}

Get usage

Get how much of a billable metric a customer used over a period.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Billable metricbillable_metric_idtextRequired
The billable metric. Pick one, or give its id from an earlier step.
Fromstarting_ondateRequired
The first day of the period (UTC).
Untilending_beforedate
The day the period ends, not included. Defaults to the day after 'From'.
Group bywindow_sizetext
How to split the period. Defaults to one value per day.One of: day (One value per day (default)), hour (One value per hour), none (One value for the whole period).
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

countnumber
How many on this page
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
totalnumber
The sum of all windows shown
usagelist
The usage per window
Example output
{
  "count": 1,
  "next_page": "",
  "total": 3,
  "usage": [
    {
      "billable_metric_id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583",
      "billable_metric_name": "API calls",
      "customer_id": "2b89b713-b131-4928-b642-52573d1e738f",
      "end_timestamp": "2026-11-14T00:00:00Z",
      "groups": {},
      "start_timestamp": "2026-11-13T00:00:00Z",
      "value": 3
    }
  ]
}

List billable metrics

List the billable metrics Metronome measures.

Inputs

Include archivedinclude_archivedtrue/false
Also list archived ones. Off by default.
Page sizelimitnumber
How many to return, 1 to 100. Metronome's default is used if empty.From 1 to 100.
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

billable_metricslist
The billable metrics
countnumber
How many on this page
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
Example output
{
  "billable_metrics": [
    {
      "aggregation_key": "units",
      "aggregation_type": "sum",
      "archived_at": "",
      "custom_fields": {},
      "event_type_filter": {
        "in_values": [
          "api_call"
        ]
      },
      "group_keys": [],
      "id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583",
      "name": "API calls",
      "property_filters": [
        {
          "exists": true,
          "name": "units"
        }
      ]
    }
  ],
  "count": 1,
  "next_page": ""
}

List contracts

List a customer's contracts.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Include archivedinclude_archivedtrue/false
Also list archived ones. Off by default.
Page sizelimitnumber
How many to return, 1 to 20.From 1 to 20.
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

contractslist
The contracts
countnumber
How many on this page
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
Example output
{
  "contracts": [
    {
      "archived_at": "",
      "commits": [],
      "created_at": "2026-11-13T19:05:42Z",
      "credits": [],
      "custom_fields": {},
      "customer_id": "2b89b713-b131-4928-b642-52573d1e738f",
      "ending_before": "",
      "id": "1ecbd51b-2d10-4689-900c-95d4c904c516",
      "name": "Acme contract",
      "overrides": [],
      "rate_card_id": "5b2a6408-58de-4e9f-8dd1-c95fd5f192d5",
      "scheduled_charges": [],
      "starting_at": "2026-11-01T00:00:00Z",
      "subscriptions": [],
      "usage_statement_schedule": {
        "frequency": "MONTHLY"
      }
    }
  ],
  "count": 1,
  "next_page": ""
}

List credits

List the credits a customer has been given, with what is left of each.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Include archivedinclude_archivedtrue/false
Also list archived ones. Off by default.
Page sizelimitnumber
How many to return, 1 to 100. Metronome's default is used if empty.From 1 to 100.
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

countnumber
How many on this page
creditslist
The credits
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
Example output
{
  "count": 1,
  "credits": [
    {
      "access_schedule": {
        "schedule_items": []
      },
      "archived_at": "",
      "balance": 500,
      "created_at": "2026-11-13T19:06:30Z",
      "id": "f05ae755-526b-4312-9b4e-3f18b2cf6cb4",
      "name": "Welcome credit",
      "priority": 1,
      "product": {
        "id": "c7b6080f-202f-40df-8971-45ee4f5cf842",
        "name": "Platform credit"
      },
      "type": "CREDIT"
    }
  ],
  "next_page": ""
}

List customers

List customers, optionally those with one usage alias or only archived ones.

Inputs

Usage aliasingest_aliastext
Only the customer that usage events name with this id.
Only archivedonly_archivedtrue/false
List only archived customers. Off by default.
Page sizelimitnumber
How many to return, 1 to 100. Metronome's default is used if empty.From 1 to 100.
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

countnumber
How many on this page
customerslist
The customers
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
Example output
{
  "count": 1,
  "customers": [
    {
      "archived_at": "",
      "created_at": "2026-11-13T19:05:12Z",
      "custom_fields": {},
      "external_id": "acme",
      "id": "2b89b713-b131-4928-b642-52573d1e738f",
      "ingest_aliases": [
        "acme"
      ],
      "name": "Acme, Inc.",
      "updated_at": "2026-11-13T19:05:12Z"
    }
  ],
  "next_page": ""
}

List invoices

List a customer's invoices, including the draft one Metronome keeps up to date for the current period.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
Statusstatustext
Only invoices with this status.One of: DRAFT, FINALIZED, VOID.
Fromstarting_ondate
Only invoices for periods starting on or after this day.
Untilending_beforedate
Only invoices for periods ending before this day.
Ordersorttext
Sort by date. Defaults to oldest first.One of: date_asc (Oldest first (default)), date_desc (Newest first).
Page sizelimitnumber
How many to return, 1 to 100. Metronome's default is used if empty.From 1 to 100.
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

countnumber
How many on this page
invoiceslist
The invoices
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
Example output
{
  "count": 1,
  "invoices": [
    {
      "contract_id": "1ecbd51b-2d10-4689-900c-95d4c904c516",
      "credit_type": {
        "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
        "name": "USD (cents)"
      },
      "customer_id": "2b89b713-b131-4928-b642-52573d1e738f",
      "end_timestamp": "2026-12-01T00:00:00Z",
      "id": "6babcc42-11bb-59cd-8bbd-7fd32b9f2e73",
      "issued_at": "2026-12-02T00:00:00Z",
      "line_items": [
        {
          "name": "API usage",
          "quantity": 3,
          "total": 15
        }
      ],
      "start_timestamp": "2026-11-01T00:00:00Z",
      "status": "DRAFT",
      "total": 15,
      "type": "USAGE"
    }
  ],
  "next_page": ""
}

List products

List products, active ones unless you choose otherwise.

Inputs

Which productsarchive_filtertext
Active, archived or all products. Defaults to active.One of: NOT_ARCHIVED (Active products (default)), ARCHIVED (Archived products), ALL (All products).
Page sizelimitnumber
How many to return, 1 to 100. Metronome's default is used if empty.From 1 to 100.
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

countnumber
How many on this page
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
productslist
The products
Example output
{
  "count": 1,
  "next_page": "",
  "products": [
    {
      "archived_at": "",
      "current": {
        "billable_metric_id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583",
        "created_at": "2026-11-13T19:05:26Z",
        "name": "API usage",
        "tags": []
      },
      "custom_fields": {},
      "id": "c7b6080f-202f-40df-8971-45ee4f5cf842",
      "initial": {
        "billable_metric_id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583",
        "created_at": "2026-11-13T19:05:26Z",
        "name": "API usage",
        "tags": []
      },
      "type": "USAGE",
      "updates": []
    }
  ]
}

List rate cards

List rate cards with their names, currencies and aliases.

Inputs

Page sizelimitnumber
How many to return, 1 to 100. Metronome's default is used if empty.From 1 to 100.
Next page tokennext_pagetext
The 'next_page' from an earlier page, to get the page after it.

Outputs

countnumber
How many on this page
next_pagetext
Pass as 'Next page token' for the next page; empty on the last one
rate_cardslist
The rate cards
Example output
{
  "count": 1,
  "next_page": "",
  "rate_cards": [
    {
      "aliases": [],
      "created_at": "2026-11-13T19:05:27Z",
      "custom_fields": {},
      "description": "List prices",
      "fiat_credit_type": {
        "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
        "name": "USD (cents)"
      },
      "id": "5b2a6408-58de-4e9f-8dd1-c95fd5f192d5",
      "name": "Standard pricing"
    }
  ]
}

Rename customer

Change a customer's name.

Inputs

Customercustomer_idtextRequired
The customer. Pick one, or give its id from an earlier step.
New namenametextRequired
The customer's new name, up to 160 characters.

Outputs

customerobject
The renamed customer
Example output
{
  "customer": {
    "archived_at": "",
    "created_at": "2026-11-13T19:05:12Z",
    "custom_fields": {},
    "external_id": "acme",
    "id": "2b89b713-b131-4928-b642-52573d1e738f",
    "ingest_aliases": [
      "acme"
    ],
    "name": "Acme, Inc.",
    "updated_at": "2026-11-13T19:05:12Z"
  }
}

Search usage events

Look up reported usage events by transaction id, to see how Metronome processed them and which billable metrics they matched. Events show up within seconds.

Inputs

Transaction IDstransaction_idstextRequired
One or more transaction ids, separated by commas.

Outputs

countnumber
How many were found
eventslist
The events found
Example output
{
  "count": 1,
  "events": [
    {
      "billable_metrics": [
        {
          "id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583",
          "name": "API calls"
        }
      ],
      "customer_id": "acme",
      "event_type": "api_call",
      "id": "e037d447-0523-401b-98f9-66449c56702b",
      "is_duplicate": false,
      "matched_customer": {
        "id": "2b89b713-b131-4928-b642-52573d1e738f",
        "name": "Acme, Inc."
      },
      "processed_at": "2026-11-13T12:00:05Z",
      "properties": {
        "units": "3"
      },
      "timestamp": "2026-11-13T12:00:00Z",
      "transaction_id": "tx-1"
    }
  ]
}

Send usage event

Report one usage event, such as an API call. An event with a transaction id Metronome has seen is not counted twice.

Inputs

Customercustomer_idtextRequired
The customer, or the usage alias their events are named with.
Event typeevent_typetextRequired
The type of event, matching a billable metric's event type.
When it happenedtimestampdate and time
When the usage happened. Defaults to now.
Propertiespropertiesobject
Values the event carries, such as units set to 3. Values the billable metric measures go here as text.
Transaction IDtransaction_idtext
A unique id for this event. Leave empty to make one; reuse one to avoid counting an event twice.

Outputs

acceptedtrue/false
True once Metronome took it
customer_idtext
The customer named
event_typetext
The event type
timestamptext
When the usage happened
transaction_idtext
The event's transaction id
Example output
{
  "accepted": true,
  "customer_id": "acme",
  "event_type": "api_call",
  "timestamp": "2026-11-13T12:00:00Z",
  "transaction_id": "tx-1"
}

On this page