# Buy a released purchase now instead of after its hold

> A new purchase released to Automated Savings waits up to 24 hours before LevelFour sends it to AWS, so it can still be cancelled. This ends the wait: the executor sends it on its next run, within about five minutes. Organization admins only. Answers where the purchase stands; calling it again changes nothing. 409 purchase_not_held for a purchase that is not released to Automated Savings, tranche_keeps_its_day for a tranche of a purchase schedule, purchase_cancelled once it was cancelled, and purchase_already_sent once it was sent. 404 for an id that is no purchase.

Source: https://docs.levelfour.ai/api-reference/commitments/post-commitments-purchase-by-id-buy-now


## POST /api/v1/commitments/purchase/{recommendation_id}/buy-now

A new purchase released to Automated Savings waits up to 24 hours before LevelFour sends it to AWS, so it can still be cancelled. This ends the wait: the executor sends it on its next run, within about five minutes. Organization admins only. Answers where the purchase stands; calling it again changes nothing. 409 purchase_not_held for a purchase that is not released to Automated Savings, tranche_keeps_its_day for a tranche of a purchase schedule, purchase_cancelled once it was cancelled, and purchase_already_sent once it was sent. 404 for an id that is no purchase.

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `recommendation_id` (path, string, required)

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `recommendation_id` (string, required)
  - `payer_account_id` (string, required)
  - `plan_type` (one of `compute`, `database` or `ec2_instance`, nullable, required): Null for a reservation
  - `term_months` (integer, required)
  - `payment_option` (one of `all_upfront`, `partial_upfront`, `no_upfront`, required)
  - `commitment_hourly` (number, nullable, required): Null for a reservation
  - `profile` (one of `conservative`, `balanced`, `max_savings`, nullable, required)
  - `capped_by` (array of string, required)
  - `monthly_savings` (number, required)
  - `grain` (`daily`, nullable, required): Null when no usage was replayed to price the purchase
  - `source` (`cur`, nullable, required)
  - `created_by` (string, nullable)
  - `created_at` (string, required)
  - `rebindable` (boolean, default `false`)
  - `kind` (one of `reserved_instance`, `savings_plan`, nullable): Null on a plan raised from its proposal, before either instrument had terms
  - `origin` (one of `recommended`, `custom`, nullable)
  - `target` (object, nullable): The ReservationTarget or PlanTarget the purchase was raised for
  - `resource` (string, nullable): The class a reservation buys
  - `quantity` (integer, nullable): How many reservations it buys
  - `offering_id` (string, nullable)
  - `quote` (object, nullable): The PurchaseQuoteData it was raised on, without its series
  - `draft` (boolean, default `false`): Raised before anybody asked for a decision on it. A draft is its raiser's alone: out of every list and total until it is accepted or requested
  - `draft_expires_at` (string, nullable): When a draft dies unless it is accepted or requested first. Null for a purchase that is no draft
  - `buying_account_id` (string, required)
  - `schedule_id` (string, nullable)
  - `tranche_number` (integer, nullable)
  - `tranches_total` (integer, nullable)
  - `buy_after_utc` (string, nullable)
  - `verified_active_at` (string, nullable): When the executor saw AWS report the plan active
  - `execution` (object, required)
    - `status` (one of `not_started`, `in_progress`, `active`, `queued`, `payment_failed`, `failed`, `indeterminate`, `scheduled`, `cancelled_before_purchase`, `returned`, `cancelled`, required)
    - `provider_state` (string, nullable): AWS's own state for the plan, once it was sent
    - `purchase_id` (string, nullable): The Savings Plan id AWS answered with
    - `error` (string, nullable)
    - `starts_at` (string, nullable): When AWS starts a plan it was asked to queue. Only purchases sent before LevelFour stopped queueing inside AWS carry one.
    - `send_at` (string, nullable): When LevelFour sends a released purchase to AWS: once its hold ends, or on its scheduled day for a tranche. Until then it reads scheduled, and it can be bought now or cancelled.
    - `can_buy_now` (boolean, default `false`): The caller may end its hold now: an organization admin, on a new purchase released to Automated Savings that is still held and was not sent.
    - `can_cancel` (boolean, default `false`): The caller may cancel it now: an organization admin or the member who raised or requested it, while it was not sent to AWS.
  - `bought_outside` (object, nullable): The plan of the same type and term bought outside LevelFour that stopped this one
    - `plan_id` (string, required)
    - `started_on` (string, nullable)
  - `trigger_info` (object, nullable)
  - `execution_steps` (array of object)
    - `step_id` (string, required)
    - `label` (string, required)
    - `status` (one of `done`, `pending`, `warning`, `in_progress`, `failed`, required)
    - `duration_seconds` (integer, nullable)
    - `parent_step_id` (string, nullable)
  - `execution_logs` (array of object)
    - `step_id` (string, required)
    - `label` (string, required)
    - `status` (one of `done`, `pending`, `warning`, `in_progress`, `failed`, required)
    - `commands` (array of object)
      - `order` (integer, required)
      - `command` (string, required)
      - `output` (string, nullable)

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