

# Offerings: purchase offering


## URI


`/prod/offerings/offeringId/purchase`

## HTTP methods


### POST


**Operation ID:** `PurchaseOffering`


**Path parameters**  

| Name | Type | Required | Description | 
| --- |--- |--- |--- |
| offeringId | String | True |  | 


**Responses**  

| Status code | Response model | Description | 
| --- |--- |--- |
| 201 | PurchaseOfferingResultModel | 201 response | 
| 400 | InvalidRequest | 400 response | 
| 403 | AccessDenied | 403 response | 
| 404 | ResourceNotFound | 404 response | 
| 409 | ResourceConflict | 409 response | 
| 429 | LimitExceeded | 429 response | 
| 500 | InternalServiceError | 500 response | 
| 502 | BadGatewayException | 502 response | 
| 504 | GatewayTimeoutException | 504 response | 

## Schemas


### Request bodies


#### POST schema
POST

```
{
  "count": integer,
  "name": "string",
  "requestId": "string",
  "start": "string",
  "tags": {
  }
}
```

### Response bodies


#### PurchaseOfferingResultModel schema
PurchaseOfferingResultModel

```
{
  "reservation": {
    "arn": "string",
    "count": integer,
    "currencyCode": "string",
    "duration": integer,
    "durationUnits": enum,
    "end": "string",
    "fixedPrice": number,
    "name": "string",
    "offeringDescription": "string",
    "offeringId": "string",
    "offeringType": enum,
    "region": "string",
    "reservationId": "string",
    "resourceSpecification": {
      "channelClass": enum,
      "codec": enum,
      "maximumBitrate": enum,
      "maximumFramerate": enum,
      "resolution": enum,
      "resourceType": enum,
      "specialFeature": enum,
      "videoQuality": enum
    },
    "start": "string",
    "state": enum,
    "tags": {
    },
    "usagePrice": number
  }
}
```

#### InvalidRequest schema
InvalidRequest

```
{
  "message": "string"
}
```

#### AccessDenied schema
AccessDenied

```
{
  "message": "string"
}
```

#### ResourceNotFound schema
ResourceNotFound

```
{
  "message": "string"
}
```

#### ResourceConflict schema
ResourceConflict

```
{
  "message": "string"
}
```

#### LimitExceeded schema
LimitExceeded

```
{
  "message": "string"
}
```

#### InternalServiceError schema
InternalServiceError

```
{
  "message": "string"
}
```

#### BadGatewayException schema
BadGatewayException

```
{
  "message": "string"
}
```

#### GatewayTimeoutException schema
GatewayTimeoutException

```
{
  "message": "string"
}
```

## Properties


### AccessDenied



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| message | string | False |  | 

### BadGatewayException



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| message | string | False |  | 

### ChannelClass


A standard channel has two encoding pipelines and a single pipeline channel only has one.
+ `STANDARD`
+ `SINGLE_PIPELINE`

### GatewayTimeoutException



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| message | string | False |  | 

### InternalServiceError



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| message | string | False |  | 

### InvalidRequest



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| message | string | False |  | 

### LimitExceeded



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| message | string | False |  | 

### OfferingDurationUnits


Units for duration, e.g. 'MONTHS'
+ `MONTHS`

### OfferingType


Offering type, e.g. 'NO\$1UPFRONT'
+ `NO_UPFRONT`

### PurchaseOffering


PurchaseOffering request


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| count | integerMinimum: 1 | True | Number of resources | 
| name | string | False | Name for the new reservation | 
| requestId | string | False | Unique request ID to be specified. This is needed to prevent retries from creating multiple resources. | 
| start | string | False | Requested reservation start time (UTC) in ISO-8601 format. The specified time must be between the first day of the current month and one year from now. If no value is given, the default is now. | 
| tags | [Tags](#offerings-offeringid-purchase-model-tags) | False | A collection of key-value pairs | 

### PurchaseOfferingResultModel


PurchaseOffering response


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| reservation | [Reservation](#offerings-offeringid-purchase-model-reservation) | False |  | 

### Reservation


Reserved resources available to use


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| arn | string | False | Unique reservation ARN, e.g. 'arn:aws:medialive:us-west-2:123456789012:reservation:1234567' | 
| count | integer | False | Number of reserved resources | 
| currencyCode | string | False | Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g. 'USD' | 
| duration | integer | False | Lease duration, e.g. '12' | 
| durationUnits | [OfferingDurationUnits](#offerings-offeringid-purchase-model-offeringdurationunits) | False | Units for duration, e.g. 'MONTHS' | 
| end | string | False | Reservation UTC end date and time in ISO-8601 format, e.g. '2019-03-01T00:00:00' | 
| fixedPrice | number | False | One-time charge for each reserved resource, e.g. '0.0' for a NO\$1UPFRONT offering | 
| name | string | False | User specified reservation name | 
| offeringDescription | string | False | Offering description, e.g. 'HD AVC output at 10-20 Mbps, 30 fps, and standard VQ in US West (Oregon)' | 
| offeringId | string | False | Unique offering ID, e.g. '87654321' | 
| offeringType | [OfferingType](#offerings-offeringid-purchase-model-offeringtype) | False | Offering type, e.g. 'NO\$1UPFRONT' | 
| region | string | False | AWS Region, e.g. 'us-west-2' | 
| reservationId | string | False | Unique reservation ID, e.g. '1234567' | 
| resourceSpecification | [ReservationResourceSpecification](#offerings-offeringid-purchase-model-reservationresourcespecification) | False | Resource configuration details | 
| start | string | False | Reservation UTC start date and time in ISO-8601 format, e.g. '2018-03-01T00:00:00' | 
| state | [ReservationState](#offerings-offeringid-purchase-model-reservationstate) | False | Current state of reservation, e.g. 'ACTIVE' | 
| tags | [Tags](#offerings-offeringid-purchase-model-tags) | False | A collection of key-value pairs | 
| usagePrice | number | False | Recurring usage charge for each reserved resource, e.g. '157.0' | 

### ReservationCodec


Codec, 'MPEG2', 'AVC', 'HEVC', or 'AUDIO'
+ `MPEG2`
+ `AVC`
+ `HEVC`
+ `AUDIO`
+ `LINK`

### ReservationMaximumBitrate


Maximum bitrate in megabits per second
+ `MAX_10_MBPS`
+ `MAX_20_MBPS`
+ `MAX_50_MBPS`

### ReservationMaximumFramerate


Maximum framerate in frames per second (Outputs only)
+ `MAX_30_FPS`
+ `MAX_60_FPS`

### ReservationResolution


Resolution based on lines of vertical resolution; SD is less than 720 lines, HD is 720 to 1080 lines, FHD is 1080 lines, UHD is greater than 1080 lines 
+ `SD`
+ `HD`
+ `FHD`
+ `UHD`

### ReservationResourceSpecification


Resource configuration (codec, resolution, bitrate, ...)


| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| channelClass | [ChannelClass](#offerings-offeringid-purchase-model-channelclass) | False | Channel class, e.g. 'STANDARD' | 
| codec | [ReservationCodec](#offerings-offeringid-purchase-model-reservationcodec) | False | Codec, e.g. 'AVC' | 
| maximumBitrate | [ReservationMaximumBitrate](#offerings-offeringid-purchase-model-reservationmaximumbitrate) | False | Maximum bitrate, e.g. 'MAX\$120\$1MBPS' | 
| maximumFramerate | [ReservationMaximumFramerate](#offerings-offeringid-purchase-model-reservationmaximumframerate) | False | Maximum framerate, e.g. 'MAX\$130\$1FPS' (Outputs only) | 
| resolution | [ReservationResolution](#offerings-offeringid-purchase-model-reservationresolution) | False | Resolution, e.g. 'HD' | 
| resourceType | [ReservationResourceType](#offerings-offeringid-purchase-model-reservationresourcetype) | False | Resource type, 'INPUT', 'OUTPUT', 'MULTIPLEX', or 'CHANNEL' | 
| specialFeature | [ReservationSpecialFeature](#offerings-offeringid-purchase-model-reservationspecialfeature) | False | Special feature, e.g. 'AUDIO\$1NORMALIZATION' (Channels only) | 
| videoQuality | [ReservationVideoQuality](#offerings-offeringid-purchase-model-reservationvideoquality) | False | Video quality, e.g. 'STANDARD' (Outputs only) | 

### ReservationResourceType


Resource type, 'INPUT', 'OUTPUT', 'MULTIPLEX', or 'CHANNEL'
+ `INPUT`
+ `OUTPUT`
+ `MULTIPLEX`
+ `CHANNEL`

### ReservationSpecialFeature


Special features, 'ADVANCED\$1AUDIO' 'AUDIO\$1NORMALIZATION' 'MGHD' or 'MGUHD'
+ `ADVANCED_AUDIO`
+ `AUDIO_NORMALIZATION`
+ `MGHD`
+ `MGUHD`

### ReservationState


Current reservation state
+ `ACTIVE`
+ `EXPIRED`
+ `CANCELED`
+ `DELETED`

### ReservationVideoQuality


Video quality, e.g. 'STANDARD' (Outputs only)
+ `STANDARD`
+ `ENHANCED`
+ `PREMIUM`

### ResourceConflict



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| message | string | False |  | 

### ResourceNotFound



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| message | string | False |  | 

### Tags



| Property | Type | Required | Description | 
| --- |--- |--- |--- |
| `*` | string | False |  | 

## See also


For more information about using this API in one of the language-specific AWS SDKs and references, see the following:

### PurchaseOffering

+ [AWS Command Line Interface V2](/goto/cli2/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for .NET V4](/goto/DotNetSDKV4/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for C\$1\$1](/goto/SdkForCpp/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for Go v2](/goto/SdkForGoV2/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for Java V2](/goto/SdkForJavaV2/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for JavaScript V3](/goto/SdkForJavaScriptV3/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for Kotlin](/goto/SdkForKotlin/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for PHP V3](/goto/SdkForPHPV3/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for Python](/goto/boto3/medialive-2017-10-14/PurchaseOffering)
+ [AWS SDK for Ruby V3](/goto/SdkForRubyV3/medialive-2017-10-14/PurchaseOffering)