# One row per commitment

> Every reservation or plan the tenant holds, one row each, with the state the cloud reports rather than one derived from the end date. A plan that starts next month is queued and one whose payment failed is neither running nor expired, and no date says either. Attributes only some services carry arrive as null rather than zero.

Source: https://docs.levelfour.ai/api-reference/commitments/get-commitments-inventory


## GET /api/v1/commitments/inventory

Every reservation or plan the tenant holds, one row each, with the state the cloud reports rather than one derived from the end date. A plan that starts next month is queued and one whose payment failed is neither running nor expired, and no date says either. Attributes only some services carry arrive as null rather than zero.

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `provider` (query, string, default `aws`)
- `instrument` (query, string, required)
- `service` (query, string, nullable)
- `state` (query, string, nullable)

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `provider` (string, required)
  - `instrument` (one of `ri`, `sp`, required)
  - `rows` (array of object, required)
    - Variant 1: InventoryReservationRow
      - `id` (string, required)
      - `account_id` (string, required)
      - `account_name` (string, required)
      - `state` (one of `active`, `queued`, `payment-pending`, `payment-failed`, `retired`, required)
      - `payment_option` (string, required)
      - `start` (string, required)
      - `end` (string, required)
      - `end_at` (string, nullable)
      - `end_is_derived` (boolean, required)
      - `term_months` (integer, required)
      - `currency` (string, nullable, required)
      - `arn` (string, nullable, required)
      - `tags` (map of string to string, nullable, required)
      - `tag` (string, nullable)
      - `product_description` (string, nullable, required)
      - `committed_monthly` (number, required)
      - `saved_monthly` (number, nullable, required)
      - `unused_monthly` (number, nullable, required)
      - `on_demand` (object, nullable)
      - `kind` (`reserved_instance`, required)
      - `service` (string, required)
      - `service_label` (string, required)
      - `resource` (string, required)
      - `qty` (integer, required)
      - `region` (string, required)
      - `fixed_price` (number, nullable, required)
      - `recurring_hourly` (number, nullable, required)
      - `usage_hourly` (number, nullable, required)
      - `offering_class` (string, nullable, required)
      - `scope` (string, nullable, required)
      - `availability_zone` (string, nullable, required)
      - `tenancy` (string, nullable, required)
      - `multi_az` (boolean, nullable, required)
      - `node_offering` (string, nullable, required)
      - `reservation_name` (string, nullable, required)
    - Variant 2: InventoryPlanRow
      - `id` (string, required)
      - `account_id` (string, required)
      - `account_name` (string, required)
      - `state` (one of `active`, `queued`, `payment-pending`, `payment-failed`, `retired`, required)
      - `payment_option` (string, required)
      - `start` (string, required)
      - `end` (string, required)
      - `end_at` (string, nullable)
      - `end_is_derived` (boolean, required)
      - `term_months` (integer, required)
      - `currency` (string, nullable, required)
      - `arn` (string, nullable, required)
      - `tags` (map of string to string, nullable, required)
      - `tag` (string, nullable)
      - `product_description` (string, nullable, required)
      - `committed_monthly` (number, required)
      - `saved_monthly` (number, nullable, required)
      - `unused_monthly` (number, nullable, required)
      - `on_demand` (object, nullable)
      - `kind` (`savings_plan`, required)
      - `plan_type` (string, required)
      - `commitment_hourly` (number, required)
      - `region` (string, nullable, required)
      - `instance_family` (string, nullable, required)
      - `product_types` (array of string, required)
      - `upfront` (number, nullable, required)
      - `recurring_hourly` (number, nullable, required)
      - `recurring_monthly` (number, nullable, required)
      - `returnable_until` (string, nullable, required)

#### Errors

- `400`: Bad Request
- `401`: Authentication Error
- `403`: Authorization Error
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

Body of `400`, `401`, `403`, `404`, `409`, `422`, `429`, `500`:

- `success` (`false`, required)
- `error` (object, required)
  - `code` (string, required)
  - `message` (string, required)
  - `details` (any)
- `timestamp` (date-time string, required)
