# Savings Plans and Reserved Instances to buy, sized on the daily bill

> The uncovered base, as /uncovered returns it, beside one proposal per payer and plan type at 12 months No Upfront. Each proposal offers three profiles sized on the daily CUR floor, net of the commitment already bought or agreed, capped by AWS's own recommendation, and replayed over the last 60 complete days. Free to every organization; reads cached rates and offerings and never calls AWS. raised is null until a proposal can be raised as a purchase. schedule lists every tranche of each purchase schedule with a month still to come: its day, its size, where it stands and why it last shrank or was skipped. reservations lists the new Reserved Instances LevelFour would buy for on-demand usage no Savings Plan covers, each sized on the 10th percentile day, quoted on the cached offering at the guardrails' term, and flagged quota_blocked when the RDS reserved instance quota cannot hold it.

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


## GET /api/v1/commitments/purchase-plan

The uncovered base, as /uncovered returns it, beside one proposal per payer and plan type at 12 months No Upfront. Each proposal offers three profiles sized on the daily CUR floor, net of the commitment already bought or agreed, capped by AWS's own recommendation, and replayed over the last 60 complete days. Free to every organization; reads cached rates and offerings and never calls AWS. raised is null until a proposal can be raised as a purchase. schedule lists every tranche of each purchase schedule with a month still to come: its day, its size, where it stands and why it last shrank or was skipped. reservations lists the new Reserved Instances LevelFour would buy for on-demand usage no Savings Plan covers, each sized on the 10th percentile day, quoted on the cached offering at the guardrails' term, and flagged quota_blocked when the RDS reserved instance quota cannot hold it.

### Authentication

Send `Authorization: Bearer <token>`.

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `provider` (`aws`, required)
  - `uncovered` (array of object, required)
    - `service` (string, required)
    - `organization_id` (string, required)
    - `payer_account_id` (string, required)
    - `plan_type` (one of `compute`, `database`, required)
    - `platform` (string, required)
    - `on_demand_hourly_avg` (number, required)
    - `on_demand_hourly_min` (number, required)
    - `volatility_ratio` (number, required)
    - `recommended_kind` (string, nullable, required)
    - `suggested_commitment_hourly` (number, required)
    - `grain` (one of `daily`, `hourly`, required)
    - `source` (one of `cur`, `cost_explorer_recommendation`, required)
    - `window_days` (integer, required)
    - `fetched_on` (date string, nullable)
  - `proposals` (array of object, required)
    - `grain` (`daily`, default `daily`)
    - `source` (`cur`, default `cur`)
    - `basis` (`public_on_demand`, default `public_on_demand`)
    - `currency` (`USD`, default `USD`)
    - `payer_account_id` (string, nullable, required)
    - `plan_type` (one of `compute`, `database`, required)
    - `term_months` (integer, required)
    - `payment_option` (one of `all_upfront`, `partial_upfront`, `no_upfront`, required)
    - `unavailable_reason` (one of `schema_pending`, `no_cur`, `insufficient_history`, `rates_pending`, `payer_not_connected`, `no_on_demand_equivalent`, nullable, required)
    - `window` (object, nullable, required)
      - `first_day` (date string, required)
      - `last_day` (date string, required)
      - `days` (integer, required)
      - `missing_days` (integer, required)
      - `last_loaded` (date string, required)
    - `caveats` (array of string, required)
    - `profiles` (object, nullable)
      - `conservative` (object, required)
      - `balanced` (object, required)
      - `max_savings` (object, required)
    - `profiles_inverted` (boolean, default `false`)
    - `guards` (array of object)
      - `name` (string, required)
      - `limit` (number, required)
      - `applied` (boolean, required)
      - `basis` (string, required)
    - `aws` (object, nullable)
      - `hourly_commitment_to_purchase` (number, required)
      - `cap` (number, required)
      - `cap_basis` (one of `direct`, `converted_from_12_no_upfront`, required)
      - `cap_applied` (boolean, required)
      - `lookback_days` (integer, required)
      - `fetched_on` (date string, required)
      - `generated_at` (date-time string, required)
      - `min_hourly_on_demand` (number, nullable, required)
      - `avg_hourly_on_demand` (number, nullable, required)
      - `estimated_utilization_pct` (number, nullable, required)
      - `estimated_monthly_savings` (number, nullable, required)
      - `basis_check_pct` (number, nullable, required)
      - `basis_check_flagged` (boolean, required)
      - `gap` (array of object, required)
    - `ledger` (array of object)
      - `source` (one of `queued_plan`, `recent_plan`, `accepted_purchase`, `recent_reservation`, `renewal_growth`, required)
      - `reference` (string, required)
      - `commitment_hourly` (number, nullable, required)
      - `on_demand_hourly` (number, nullable, required)
      - `scope` (object, nullable, required)
      - `effective_from` (date string, nullable, required)
    - `ledger_hourly` (number, default `0`)
    - `stale_claims` (array of object)
      - `reference` (string, required)
      - `commitment_hourly` (number, nullable, required)
      - `on_demand_hourly` (number, nullable)
      - `accepted_days_ago` (integer, required)
    - `unmapped_holders` (array of string)
    - `window_changes` (array of object)
      - `reference` (string, required)
      - `kind` (string, required)
      - `change` (one of `started`, `ended`, required)
      - `day` (date string, required)
    - `excluded` (array of object)
      - `reason` (string, required)
      - `on_demand_daily` (number, required)
    - `recommended_profile` (`balanced`, nullable, required)
    - `raised` (object, nullable)
      - `recommendation_id` (string, required)
      - `commitment_hourly` (number, required)
      - `profile` (one of `conservative`, `balanced`, `max_savings`, nullable, required)
      - `created_at` (date-time string, required)
      - `quantity` (integer, nullable): How many reservations a reservation purchase buys
  - `schedule` (array of object)
    - `id` (string, required)
    - `schedule_id` (string, required)
    - `payer_account_id` (string, required)
    - `plan_type` (one of `compute`, `database`, required)
    - `profile` (one of `conservative`, `balanced`, `max_savings`, required)
    - `tranche_number` (integer, required)
    - `tranches_total` (integer, required)
    - `tranche_month` (date string, required)
    - `scheduled_for` (date string, required)
    - `commitment_hourly` (number, required)
    - `status` (one of `planned`, `awaiting_decision`, `accepted`, `released`, `buying`, `active`, `failed`, `rejected`, `skipped`, `cancelled`, required)
    - `reason` (string, required)
    - `reason_detail` (object, required)
    - `recommendation_id` (string, nullable, required)
    - `resized_at` (date-time string, nullable, required)
  - `reservations` (array of object)
    - `id` (string, required)
    - `payer_account_id` (string, required)
    - `buying_account_id` (string, required)
    - `target` (object, required): What a reservation is bought for: the service and where its usage runs.
      - `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, nullable, required)
    - `quantity` (integer, nullable, required)
    - `term_months` (integer, required)
    - `payment_option` (string, required)
    - `offering_id` (string, nullable, required)
    - `quote` (object, nullable, 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)
      - `series` (array of object, required)
    - `window` (object, nullable, required)
      - `first_day` (date string, required)
      - `last_day` (date string, required)
      - `days` (integer, required)
      - `missing_days` (integer, required)
      - `last_loaded` (date string, required)
    - `note` (one of `licensed_engine`, `size_flexible`, nullable, required)
    - `unavailable_reason` (one of `no_cur`, `insufficient_history`, `catalog_pending`, `no_offering`, nullable, required)
    - `raised` (object, nullable)
      - `recommendation_id` (string, required)
      - `commitment_hourly` (number, required)
      - `profile` (one of `conservative`, `balanced`, `max_savings`, nullable, required)
      - `created_at` (date-time string, required)
      - `quantity` (integer, nullable): How many reservations a reservation purchase buys
    - `quota_blocked` (boolean, default `false`)

#### 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)
