# Metronome

> 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.

App · 30 actions. Web page: https://docs.lodol.com/docs/integrations/metronome

## Actions

### 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 card (`rate_card_id`, text, required): The rate card. Pick one, or give its id from an earlier step.
- Product (`product_id`, text, required): The product. Pick one, or give its id from an earlier step.
- Price per unit (`price`, number, required): The price of one unit, in cents for US dollars. At least 0.
- Starts (`starting_at`, date and time, required): When the rate takes effect. It is cut back to the start of its hour.
- Ends (`ending_before`, date and time): When the rate stops. Leave empty for no end.

**Outputs**

- `product_id` (text): The product priced
- `rate` (object): The rate that was set
- `rate_card_id` (text): The rate card
- `starting_at` (text): When the rate starts

**Example output**

```json
{
  "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 metric (`billable_metric_id`, text, required): The billable metric. Pick one, or give its id from an earlier step.

**Outputs**

- `archived` (true/false): Always true once archived
- `billable_metric_id` (text): The id of the billable metric archived

**Example output**

```json
{
  "archived": true,
  "billable_metric_id": "c1dba5ef-8919-4dfb-b9df-5a51f9774583"
}
```

### Archive contract

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

**Inputs**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Contract ID (`contract_id`, text, required): The contract's id, from 'List contracts' or 'Create contract'.
- Void its invoices (`void_invoices`, true/false): Void the contract's invoices too. On by default. Default: `true`.

**Outputs**

- `archived` (true/false): Always true once archived
- `contract_id` (text): The contract archived
- `invoices_voided` (true/false): Whether its invoices were voided

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.

**Outputs**

- `archived` (true/false): Always true once archived
- `customer_id` (text): The id of the customer archived

**Example output**

```json
{
  "archived": true,
  "customer_id": "2b89b713-b131-4928-b642-52573d1e738f"
}
```

### Archive product

Archive a product. Rate cards stop offering it.

**Inputs**

- Product (`product_id`, text, required): The product. Pick one, or give its id from an earlier step.

**Outputs**

- `archived` (true/false): Always true once archived
- `product_id` (text): The id of the product archived

**Example output**

```json
{
  "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 card (`rate_card_id`, text, required): The rate card. Pick one, or give its id from an earlier step.

**Outputs**

- `archived` (true/false): Always true once archived
- `rate_card_id` (text): The id of the rate card archived

**Example output**

```json
{
  "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**

- Name (`name`, text, required): The metric's name.
- Event type (`event_type`, text, required): The type of usage event to measure, as your events name it.
- How to measure (`aggregation_type`, text): 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).
- Property (`aggregation_key`, text): The event property to measure, such as units or tokens. Not needed to count events.

**Outputs**

- `billable_metric` (object): The new billable metric

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Rate card (`rate_card_id`, text, required): The rate card. Pick one, or give its id from an earlier step.
- Starts (`starting_at`, date and time, required): When the contract starts. It is cut back to the start of its hour.
- Ends (`ending_before`, date and time): When the contract ends. Leave empty for no end.
- Name (`name`, text): A name for the contract.
- Payment terms (days) (`net_payment_terms_days`, number): Days the customer has to pay an invoice. From 0 to 365.

**Outputs**

- `contract` (object): The new contract

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Product (`product_id`, text, required): The product the credit is recorded against, usually a fixed one.
- Amount (`amount`, number, required): How much credit, in cents for US dollars. At least 0.
- Starts (`starting_at`, date and time, required): When the credit becomes usable.
- Expires (`ending_before`, date and time, required): When the credit expires.
- Name (`name`, text): A name for the credit, shown on invoices.
- Priority (`priority`, number): The credit with the lower number is used first. Defaults to 1. At least 0.

**Outputs**

- `credit` (object): The new credit
- `customer_id` (text): The customer credited

**Example output**

```json
{
  "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**

- Name (`name`, text, required): The customer's name, up to 160 characters.
- Usage aliases (`ingest_aliases`, text): Ids your usage events use for this customer, separated by commas. Usage sent with one of them is billed to this customer.

**Outputs**

- `customer` (object): The new customer

**Example output**

```json
{
  "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**

- Name (`name`, text, required): The product's name, shown on invoices.
- Type (`product_type`, text): 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 metric (`billable_metric_id`, text): What a usage product charges for. Leave empty for a fixed product.

**Outputs**

- `product` (object): The new product

**Example output**

```json
{
  "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**

- Name (`name`, text, required): The rate card's name. Only your team sees it.
- Description (`description`, text): A note about the rate card.

**Outputs**

- `rate_card` (object): The new rate card

**Example output**

```json
{
  "rate_card": {
    "id": "5b2a6408-58de-4e9f-8dd1-c95fd5f192d5"
  }
}
```

### Get billable metric

Get one billable metric with its event filter and aggregation.

**Inputs**

- Billable metric (`billable_metric_id`, text, required): The billable metric. Pick one, or give its id from an earlier step.

**Outputs**

- `billable_metric` (object): The metric

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Contract ID (`contract_id`, text, required): The contract's id, from 'List contracts' or 'Create contract'.

**Outputs**

- `contract` (object): The contract

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.

**Outputs**

- `customer` (object): The customer

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Invoice ID (`invoice_id`, text, required): The invoice's id, from 'List invoices'.

**Outputs**

- `invoice` (object): The invoice

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.

**Outputs**

- `balance` (number): The balance left to spend
- `credit_type_id` (text): The currency's id
- `customer_id` (text): The customer

**Example output**

```json
{
  "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**

- Product (`product_id`, text, required): The product. Pick one, or give its id from an earlier step.

**Outputs**

- `product` (object): The product

**Example output**

```json
{
  "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 card (`rate_card_id`, text, required): The rate card. Pick one, or give its id from an earlier step.
- At (`at`, date and time): The moment to read the rates at. Defaults to now.
- Page size (`limit`, number): How many to return, 1 to 100. Metronome's default is used if empty. From 1 to 100.
- Next page token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many on this page
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one
- `rates` (list): The rates in force

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Billable metric (`billable_metric_id`, text, required): The billable metric. Pick one, or give its id from an earlier step.
- From (`starting_on`, date, required): The first day of the period (UTC).
- Until (`ending_before`, date): The day the period ends, not included. Defaults to the day after 'From'.
- Group by (`window_size`, text): 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 token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many on this page
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one
- `total` (number): The sum of all windows shown
- `usage` (list): The usage per window

**Example output**

```json
{
  "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 archived (`include_archived`, true/false): Also list archived ones. Off by default.
- Page size (`limit`, number): How many to return, 1 to 100. Metronome's default is used if empty. From 1 to 100.
- Next page token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `billable_metrics` (list): The billable metrics
- `count` (number): How many on this page
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Include archived (`include_archived`, true/false): Also list archived ones. Off by default.
- Page size (`limit`, number): How many to return, 1 to 20. From 1 to 20.
- Next page token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `contracts` (list): The contracts
- `count` (number): How many on this page
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Include archived (`include_archived`, true/false): Also list archived ones. Off by default.
- Page size (`limit`, number): How many to return, 1 to 100. Metronome's default is used if empty. From 1 to 100.
- Next page token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many on this page
- `credits` (list): The credits
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one

**Example output**

```json
{
  "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 alias (`ingest_alias`, text): Only the customer that usage events name with this id.
- Only archived (`only_archived`, true/false): List only archived customers. Off by default.
- Page size (`limit`, number): How many to return, 1 to 100. Metronome's default is used if empty. From 1 to 100.
- Next page token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many on this page
- `customers` (list): The customers
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- Status (`status`, text): Only invoices with this status. One of: `DRAFT`, `FINALIZED`, `VOID`.
- From (`starting_on`, date): Only invoices for periods starting on or after this day.
- Until (`ending_before`, date): Only invoices for periods ending before this day.
- Order (`sort`, text): Sort by date. Defaults to oldest first. One of: `date_asc` (Oldest first (default)), `date_desc` (Newest first).
- Page size (`limit`, number): How many to return, 1 to 100. Metronome's default is used if empty. From 1 to 100.
- Next page token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many on this page
- `invoices` (list): The invoices
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one

**Example output**

```json
{
  "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 products (`archive_filter`, text): Active, archived or all products. Defaults to active. One of: `NOT_ARCHIVED` (Active products (default)), `ARCHIVED` (Archived products), `ALL` (All products).
- Page size (`limit`, number): How many to return, 1 to 100. Metronome's default is used if empty. From 1 to 100.
- Next page token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many on this page
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one
- `products` (list): The products

**Example output**

```json
{
  "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 size (`limit`, number): How many to return, 1 to 100. Metronome's default is used if empty. From 1 to 100.
- Next page token (`next_page`, text): The 'next_page' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many on this page
- `next_page` (text): Pass as 'Next page token' for the next page; empty on the last one
- `rate_cards` (list): The rate cards

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer. Pick one, or give its id from an earlier step.
- New name (`name`, text, required): The customer's new name, up to 160 characters.

**Outputs**

- `customer` (object): The renamed customer

**Example output**

```json
{
  "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 IDs (`transaction_ids`, text, required): One or more transaction ids, separated by commas.

**Outputs**

- `count` (number): How many were found
- `events` (list): The events found

**Example output**

```json
{
  "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**

- Customer (`customer_id`, text, required): The customer, or the usage alias their events are named with.
- Event type (`event_type`, text, required): The type of event, matching a billable metric's event type.
- When it happened (`timestamp`, date and time): When the usage happened. Defaults to now.
- Properties (`properties`, object): Values the event carries, such as units set to 3. Values the billable metric measures go here as text.
- Transaction ID (`transaction_id`, text): A unique id for this event. Leave empty to make one; reuse one to avoid counting an event twice.

**Outputs**

- `accepted` (true/false): True once Metronome took it
- `customer_id` (text): The customer named
- `event_type` (text): The event type
- `timestamp` (text): When the usage happened
- `transaction_id` (text): The event's transaction id

**Example output**

```json
{
  "accepted": true,
  "customer_id": "acme",
  "event_type": "api_call",
  "timestamp": "2026-11-13T12:00:00Z",
  "transaction_id": "tx-1"
}
```
