# What AWS sells for a reservation or Savings Plan target

> The catalogue one field at a time. choices lists, for every field of the target, the values sold given every field before it, in the order each narrows the next: service, region, engine, deployment, offering_class, tenancy and resource for a reservation, plan_type, instance_family and region for a plan. A field the service does not use has no choices and must be left out. complete says the target is whole; offers then lists every offering sold for it, priced per unit (a reservation, or a dollar an hour of a plan) beside the public on-demand rate where the price list has one. EC2 is read one instance type at a time, so its offers wait for resource. Regions are where the organization's accounts live, hold commitments, run anything or opted in; classes are those it runs and those the catalogue sells. Every page AWS returns is kept a day, fetched_at says when it was read. AWS is read through the role of the optional buying_account_id, the account the purchase would be bought in, then its payer's, then every other connected account's, payers first, passing over a role AWS refuses to assume. 422 for a value the service does not sell; 502 when every connected account refused the offerings lookup.

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


## GET /api/v1/commitments/offerings

The catalogue one field at a time. choices lists, for every field of the target, the values sold given every field before it, in the order each narrows the next: service, region, engine, deployment, offering_class, tenancy and resource for a reservation, plan_type, instance_family and region for a plan. A field the service does not use has no choices and must be left out. complete says the target is whole; offers then lists every offering sold for it, priced per unit (a reservation, or a dollar an hour of a plan) beside the public on-demand rate where the price list has one. EC2 is read one instance type at a time, so its offers wait for resource. Regions are where the organization's accounts live, hold commitments, run anything or opted in; classes are those it runs and those the catalogue sells. Every page AWS returns is kept a day, fetched_at says when it was read. AWS is read through the role of the optional buying_account_id, the account the purchase would be bought in, then its payer's, then every other connected account's, payers first, passing over a role AWS refuses to assume. 422 for a value the service does not sell; 502 when every connected account refused the offerings lookup.

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `kind` (query, one of `reserved_instance`, `savings_plan`, required)
- `service` (query, one of `ec2`, `rds`, `elasticache`, `opensearch`, `redshift`, `memorydb`, nullable)
- `region` (query, string, nullable)
- `engine` (query, string, nullable)
- `deployment` (query, one of `single_az`, `multi_az`, nullable)
- `offering_class` (query, one of `standard`, `convertible`, nullable)
- `tenancy` (query, one of `default`, `dedicated`, nullable)
- `plan_type` (query, one of `compute`, `database`, `ec2_instance`, nullable)
- `instance_family` (query, string, nullable)
- `resource` (query, string, nullable)
- `buying_account_id` (query, string, nullable)

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required): What the catalog sells for a target: the choices for every field, and the offers once it is whole.
  - `choices` (map of string to array of string, required)
  - `complete` (boolean, required)
  - `offers` (array of object, required)
    - `offering_id` (string, required)
    - `resource` (string, nullable, required)
    - `term_months` (integer, required)
    - `payment_option` (string, required)
    - `currency` (string, required)
    - `upfront` (number, required)
    - `recurring_hourly` (number, required)
    - `term_total` (number, required)
    - `effective_hourly` (number, required)
    - `on_demand_hourly` (number, nullable, required)
    - `offering_class` (one of `standard`, `convertible`, nullable, required)
    - `multi_az` (boolean, nullable, required)
  - `fetched_at` (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)
