> ## Documentation Index
> Fetch the complete documentation index at: https://getlago.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate cards

> Price products with lago v2 rate-cards and add effective-dated rates with lago v2 rate-card-rates.

| Command | Description |
| - | - |
| `v2 rate-cards create` | Create a rate card for a product or product filter, optionally with its first rates. |
| `v2 rate-cards get <code>` | Retrieve a rate card. `--expands` takes `active_rate`, `rates`, `taxes`, `product`, `product_filter`. |
| `v2 rate-cards list` | List rate cards. Filters: `--product-code`, `--product-filter-code`, `--code`, `--search-term`. |
| `v2 rate-cards update <code>` | Partial update. Also `patch`. |
| `v2 rate-cards delete <code>` | Delete an unused rate card and its rates. Confirmation-gated. |
| `v2 rate-card-rates create <rate_card_code>` | Add a rate after the active one. |
| `v2 rate-card-rates get\|update\|delete <rate_card_code> <code>` | Read, edit or delete one rate. `delete` is confirmation-gated. |
| `v2 rate-card-rates list <rate_card_code>` | Every rate of the card, newest `effective_from` first. Not paginated. |

## rate-cards create

| Flag | Description |
| - | - |
| `--name`, `--code`, `--currency`, `--product-code` | Required. |
| `--product-filter-code` | Price only the usage matching this filter of the product. |
| `--billing-timing` | `arrears` or `advance`. |
| `--proration` | Whether fees are prorated. |
| `--rates` | JSON array of initial rates. A failure rolls back the card and its rates. |
| `--tax-codes` | JSON array of tax codes. An empty array clears them. |
| `--applied-pricing-unit-code` | Price in a pricing unit instead of the currency. |
| `--display-on-invoice`, `--regroup-paid-fees`, `--description` | Optional. |

Product and product filter are fixed at creation. Once any rate exists, `currency`, `applied_pricing_unit_code`, `billing_timing`, `proration`, `regroup_paid_fees` and `display_on_invoice` cannot change. Code and currency cannot change while the card is attached to a plan or Contract. Tax assignments stay editable.

## rate-card-rates create

| Flag | Description |
| - | - |
| `--code` | Unique within the rate card. Required. |
| `--effective-from` | Required. Not before today in the organization timezone, unique on the card, and after the active rate. |
| `--rate-model` | `standard`, `graduated`, `package`, `percentage`, `volume`, `graduated_percentage`, `custom`, `dynamic`. Required. |
| `--rate-properties` | JSON configuration for the model. `standard` needs `amount`, `package` also needs `package_size`. |
| `--billing-interval-unit`, `--billing-interval-count` | `day`, `week`, `month` or `year`. The unit is required. The count defaults to 1. |
| `--min-amount-cents` | Minimum charge. Arrears only. |
| `--applied-pricing-unit-conversion-rate` | Required when the card uses a pricing unit. |

Rates are history. Only pending rates can be deleted. Active rates reject changes to `effective_from`, `rate_model`, `min_amount_cents` and the billing interval, and terminated rates are frozen. To change a price, add a rate with a later `effective_from`.

See [rate cards](https://getlago.com/docs/v2/guide/rate-cards/overview.md), [rates](https://getlago.com/docs/v2/guide/rate-cards/rates.md) and [pricing models](https://getlago.com/docs/v2/guide/rate-cards/pricing-models/overview.md).

```bash create with a rate theme={"dark"}
lago v2 rate-cards create --name "API calls USD" --code api_calls_usd \
  --product-code api_calls_product --currency USD \
  --billing-timing arrears --proration false \
  --rates '[{"code":"calls_standard","effective_from":"2027-01-01T00:00:00Z","rate_model":"standard","rate_properties":{"amount":"0.01"},"billing_interval_unit":"month","billing_interval_count":1}]'
```

```bash filter-scoped card theme={"dark"}
lago v2 rate-cards create --name "API calls EU USD" --code api_calls_eu_usd \
  --product-code api_calls_product --product-filter-code api_calls_eu \
  --currency USD --billing-timing arrears --proration false \
  --rates '[{"code":"calls_eu_standard","effective_from":"2027-01-01T00:00:00Z","rate_model":"standard","rate_properties":{"amount":"0.015"},"billing_interval_unit":"month"}]'
```

```bash add a price change theme={"dark"}
lago v2 rate-card-rates create api_calls_usd --input '{
  "rate": {
    "code": "calls_2027_07",
    "effective_from": "2027-07-01T00:00:00Z",
    "rate_model": "graduated",
    "rate_properties": {
      "graduated_ranges": [
        {"to_value": "10000", "per_unit_amount": "0.01", "flat_amount": "0"},
        {"to_value": null, "per_unit_amount": "0.008", "flat_amount": "0"}
      ]
    },
    "billing_interval_unit": "month"
  }
}'
```

```bash read theme={"dark"}
lago v2 rate-cards get api_calls_usd --expands active_rate,rates
lago v2 rate-card-rates list api_calls_usd --query 'rates[].{code: code, status: status, from: effective_from}'
```

```bash delete a pending rate theme={"dark"}
lago v2 rate-card-rates delete api_calls_usd calls_2027_07 --confirm calls_2027_07
```

```text create theme={"dark"}
LAGO_ID  1a901a90-1a90-1a90-1a90-1a901a901a90
CODE     api_calls_usd
NAME     API calls USD
```

```json rate-card-rates list (query) theme={"dark"}
[
  {
    "code": "calls_2027_07",
    "from": "2027-07-01T00:00:00Z",
    "status": "pending"
  },
  {
    "code": "calls_standard",
    "from": "2027-01-01T00:00:00Z",
    "status": "active"
  }
]
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.