# What a new reservation or Savings Plan would cost and save

> Quotes one purchase the organization does not hold yet, a NewPurchase with an optional lookback_days of 30 or 60. basis is usage when the buying account's payer already runs the target: a reservation is replayed over its family's daily on-demand hours in units of the class bought and priced at the on-demand rate measured on the bill; a plan is replayed at the organization's own rates, as GET /purchase-simulation does, on any term and payment AWS sells it on. Otherwise basis is full_use: every hour used, against the price list's on-demand rate where it has one, and at face (no saving) where it has none, which is always the case for a plan. upfront, recurring_monthly, commitment_monthly and term_total are the offering's list price; over_automation_cap says Automated Savings would refuse the term total. A reservation quoted on usage also answers unused_units and left_on_demand_units, what it leaves unused and on demand an hour in reservations of the class bought. The offering is the one named, or the cheapest sold on those terms. A plan quoted without an offering_id is priced on its commitment, term and payment option without reading the catalogue, and its offering_id is null. 422 when AWS sells nothing on those terms, and for a Database plan other than 12 months No Upfront; 502 when every connected account refused the offerings lookup. Buys nothing.

Source: https://docs.levelfour.ai/api-reference/commitments/post-commitments-purchase-simulation


## POST /api/v1/commitments/purchase-simulation

Quotes one purchase the organization does not hold yet, a NewPurchase with an optional lookback_days of 30 or 60. basis is usage when the buying account's payer already runs the target: a reservation is replayed over its family's daily on-demand hours in units of the class bought and priced at the on-demand rate measured on the bill; a plan is replayed at the organization's own rates, as GET /purchase-simulation does, on any term and payment AWS sells it on. Otherwise basis is full_use: every hour used, against the price list's on-demand rate where it has one, and at face (no saving) where it has none, which is always the case for a plan. upfront, recurring_monthly, commitment_monthly and term_total are the offering's list price; over_automation_cap says Automated Savings would refuse the term total. A reservation quoted on usage also answers unused_units and left_on_demand_units, what it leaves unused and on demand an hour in reservations of the class bought. The offering is the one named, or the cheapest sold on those terms. A plan quoted without an offering_id is priced on its commitment, term and payment option without reading the catalogue, and its offering_id is null. 422 when AWS sells nothing on those terms, and for a Database plan other than 12 months No Upfront; 502 when every connected account refused the offerings lookup. Buys nothing.

### Authentication

Send `Authorization: Bearer <token>`.

### Request body

Required. Content type `application/json`.

- Variant 1: ReservationQuoteRequest
  - `kind` (`reserved_instance`, required)
  - `service` (one of `ec2`, `rds`, `elasticache`, `opensearch`, `redshift`, `memorydb`, required)
  - `region` (string, required)
  - `engine` (string, nullable)
  - `deployment` (one of `single_az`, `multi_az`, nullable)
  - `offering_class` (one of `standard`, `convertible`, nullable)
  - `tenancy` (one of `default`, `dedicated`, nullable)
  - `resource` (string, required)
  - `quantity` (integer, required)
  - `term_months` (one of `12`, `36`, required)
  - `payment_option` (one of `no_upfront`, `partial_upfront`, `all_upfront`, required)
  - `offering_id` (string, nullable)
  - `buying_account_id` (string, required)
  - `lookback_days` (one of `30`, `60`, default `60`)
- Variant 2: PlanQuoteRequest
  - `kind` (`savings_plan`, required)
  - `plan_type` (one of `compute`, `database`, `ec2_instance`, required)
  - `instance_family` (string, nullable)
  - `region` (string, nullable)
  - `commitment_hourly` (number, required)
  - `term_months` (one of `12`, `36`, required)
  - `payment_option` (one of `no_upfront`, `partial_upfront`, `all_upfront`, required)
  - `offering_id` (string, nullable)
  - `buying_account_id` (string, required)
  - `lookback_days` (one of `30`, `60`, default `60`)

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `basis` (one of `usage`, `full_use`, required)
  - `offering_id` (string, nullable, required): The offering priced. Null for a Savings Plan quoted without one: a plan costs its commitment on its term and payment option, so it is priced on those without reading the catalogue
  - `currency` (string, required)
  - `term_months` (integer, required)
  - `payment_option` (string, required)
  - `upfront` (number, required)
  - `recurring_monthly` (number, required)
  - `commitment_monthly` (number, required)
  - `term_total` (number, required)
  - `covered_on_demand_monthly` (number, required)
  - `left_on_demand_monthly` (number, required)
  - `unused_monthly` (number, required)
  - `unused_units` (number, nullable): Reservations of the class bought left unused, an hour on average over the window. Null at full use and for a Savings Plan
  - `left_on_demand_units` (number, nullable): Usage left on demand, an hour on average over the window, in reservations of the class bought. Null at full use and for a Savings Plan
  - `net_savings_monthly` (number, required)
  - `savings_pct` (number, required)
  - `coverage_before_pct` (number, nullable, required)
  - `coverage_after_pct` (number, nullable, required)
  - `utilization_pct` (number, nullable, required)
  - `break_even_months` (integer, nullable, required)
  - `capacity` (number, required)
  - `over_automation_cap` (boolean, required)
  - `pool` (object, nullable, required)
    - `window` (object, required)
      - `first_day` (date string, required)
      - `last_day` (date string, required)
      - `days` (integer, required)
      - `missing_days` (integer, required)
      - `last_loaded` (date string, required)
    - `recommended` (number, nullable, required)
    - `recommended_capacity` (number, nullable, required)
    - `already_covered_monthly` (number, required)
    - `agreed_hourly` (number, default `0`)
  - `series` (array of object, required)
    - `day` (date string, required)
    - `used` (number, 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)
