Reservation Order - Calculate

Calculate price for a ReservationOrder.
Calculate price for placing a ReservationOrder.

POST https://management.azure.com/providers/Microsoft.Capacity/calculatePrice?api-version=2022-11-01

URI Parameters

Name In Required Type Description
api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
location

string

The Azure region where the reserved resource lives.

properties.appliedScopeProperties

AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup

properties.appliedScopeType

AppliedScopeType

Type of the Applied Scope.

properties.appliedScopes

string[]

List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.

properties.billingPlan

ReservationBillingPlan

Represent the billing plans.

properties.billingScopeId

string

Subscription that will be charged for purchasing reservation or savings plan

properties.displayName

string

Friendly name of the reservation

properties.quantity

integer (int32)

Quantity of the skus that are part of the reservation.

properties.renew

boolean

Setting this to true will automatically purchase a new reservation on the expiration date time.

properties.reservedResourceProperties

PurchaseRequestPropertiesReservedResourceProperties

Properties specific to each reserved resource type. Not required if not applicable.

properties.reservedResourceType

ReservedResourceType

The type of the resource that is being reserved. In addition to below types we have also added the following: OpenAIPTU, MDC, Sentinel.

properties.reviewDateTime

string (date-time)

This is the date-time when the Azure hybrid benefit needs to be reviewed.

properties.term

ReservationTerm

Represent the term of reservation.

sku

SkuName

The name of sku

Responses

Name Type Description
200 OK

CalculatePriceResponse

The request has succeeded.

Other Status Codes

Error

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

CalculatePrice

Sample request

POST https://management.azure.com/providers/Microsoft.Capacity/calculatePrice?api-version=2022-11-01

{
  "location": "westus",
  "properties": {
    "appliedScopeType": "Shared",
    "appliedScopes": null,
    "billingPlan": "Monthly",
    "billingScopeId": "/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83",
    "displayName": "TestReservationOrder",
    "quantity": 1,
    "reservedResourceProperties": {
      "instanceFlexibility": "On"
    },
    "reservedResourceType": "VirtualMachines",
    "term": "P1Y"
  },
  "sku": {
    "name": "standard_D1"
  }
}

Sample response

{
  "properties": {
    "billingCurrencyTotal": {
      "amount": 46,
      "currencyCode": "USD"
    },
    "paymentSchedule": [
      {
        "billingCurrencyTotal": {
          "amount": 40,
          "currencyCode": "EUR"
        },
        "dueDate": "2019-05-14",
        "pricingCurrencyTotal": {
          "amount": 46,
          "currencyCode": "USD"
        }
      },
      {
        "dueDate": "2019-06-14",
        "pricingCurrencyTotal": {
          "amount": 46,
          "currencyCode": "USD"
        }
      },
      {
        "dueDate": "2019-07-14",
        "pricingCurrencyTotal": {
          "amount": 46,
          "currencyCode": "USD"
        }
      }
    ],
    "pricingCurrencyTotal": {
      "amount": 46,
      "currencyCode": "USD"
    },
    "reservationOrderId": "6d9cec54-7de8-abcd-9de7-80f5d634f2d2",
    "skuDescription": "standard_D1",
    "skuTitle": "Reserved VM Instance, Standard_D1, US West, 1 Year"
  }
}

Definitions

Name Description
AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup

AppliedScopeType

Type of the Applied Scope.

CalculatePriceResponse

The response of calculate price for reservation.

CalculatePriceResponseProperties

Properties for calculate price response

CalculatePriceResponsePropertiesBillingCurrencyTotal

Currency and amount that customer will be charged in customer's local currency. Tax is not included.

CalculatePriceResponsePropertiesPricingCurrencyTotal

Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.

Error

Error information

ErrorResponseCode

Error code describing the reason that service is not able to process the incoming request

ExtendedErrorInfo

Extended error information including error code and error message

ExtendedStatusInfo
InstanceFlexibility

Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.

PaymentDetail

Information about payment related to a reservation order.

PaymentStatus

Describes whether the payment is completed, failed, cancelled or scheduled in the future.

Price

Pricing information containing the amount and the currency code

PurchaseRequest

The request for reservation purchase

PurchaseRequestPropertiesReservedResourceProperties

Properties specific to each reserved resource type. Not required if not applicable.

ReservationBillingPlan

Represent the billing plans.

ReservationStatusCode
ReservationTerm

Represent the term of reservation.

ReservedResourceType

The type of the resource that is being reserved. In addition to below types we have also added the following: OpenAIPTU, MDC, Sentinel.

SkuName

The name of sku

AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup

Name Type Description
displayName

string

Display name

managementGroupId

string

Fully-qualified identifier of the management group where the benefit must be applied.

resourceGroupId

string

Fully-qualified identifier of the resource group.

subscriptionId

string

Fully-qualified identifier of the subscription.

tenantId

string

Tenant ID where the savings plan should apply benefit.

AppliedScopeType

Type of the Applied Scope.

Value Description
Single

Single

Shared

Shared

ManagementGroup

ManagementGroup

CalculatePriceResponse

The response of calculate price for reservation.

Name Type Description
properties

CalculatePriceResponseProperties

Properties for calculate price response

CalculatePriceResponseProperties

Properties for calculate price response

Name Type Description
billingCurrencyTotal

CalculatePriceResponsePropertiesBillingCurrencyTotal

Currency and amount that customer will be charged in customer's local currency. Tax is not included.

grandTotal

number (double)

Total amount in pricing currency.

isBillingPartnerManaged

boolean

True if billing is managed by Microsoft Partner. Used only for CSP accounts.

isTaxIncluded

boolean

Whether or not tax is included in grand total

netTotal

number (double)

Net total amount in pricing currency.

paymentSchedule

PaymentDetail[]

Information about payment related to a reservation order.

pricingCurrencyTotal

CalculatePriceResponsePropertiesPricingCurrencyTotal

Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.

reservationOrderId

string

GUID that represents reservation order that can be placed after calculating price.

skuDescription

string

Description of sku that is being purchased.

skuTitle

string

Title of sku that is being purchased.

taxTotal

number (double)

Tax amount in pricing currency.

CalculatePriceResponsePropertiesBillingCurrencyTotal

Currency and amount that customer will be charged in customer's local currency. Tax is not included.

Name Type Description
amount

number (double)

Amount in pricing currency. Tax is not included.

currencyCode

string

The ISO 4217 3-letter currency code for the currency used by this purchase record.

CalculatePriceResponsePropertiesPricingCurrencyTotal

Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.

Name Type Description
amount

number (float)

currencyCode

string

The ISO 4217 3-letter currency code for the currency used by this purchase record.

Error

Error information

Name Type Description
error

ExtendedErrorInfo

Extended error information including error code and error message

ErrorResponseCode

Error code describing the reason that service is not able to process the incoming request

Value Description
NotSpecified

NotSpecified

InternalServerError

InternalServerError

ServerTimeout

ServerTimeout

AuthorizationFailed

AuthorizationFailed

BadRequest

BadRequest

ClientCertificateThumbprintNotSet

ClientCertificateThumbprintNotSet

InvalidRequestContent

InvalidRequestContent

OperationFailed

OperationFailed

HttpMethodNotSupported

HttpMethodNotSupported

InvalidRequestUri

InvalidRequestUri

MissingTenantId

MissingTenantId

InvalidTenantId

InvalidTenantId

InvalidReservationOrderId

InvalidReservationOrderId

InvalidReservationId

InvalidReservationId

ReservationIdNotInReservationOrder

ReservationIdNotInReservationOrder

ReservationOrderNotFound

ReservationOrderNotFound

InvalidSubscriptionId

InvalidSubscriptionId

InvalidAccessToken

InvalidAccessToken

InvalidLocationId

InvalidLocationId

UnauthenticatedRequestsThrottled

UnauthenticatedRequestsThrottled

InvalidHealthCheckType

InvalidHealthCheckType

Forbidden

Forbidden

BillingScopeIdCannotBeChanged

BillingScopeIdCannotBeChanged

AppliedScopesNotAssociatedWithCommerceAccount

AppliedScopesNotAssociatedWithCommerceAccount

PatchValuesSameAsExisting

PatchValuesSameAsExisting

RoleAssignmentCreationFailed

RoleAssignmentCreationFailed

ReservationOrderCreationFailed

ReservationOrderCreationFailed

ReservationOrderNotEnabled

ReservationOrderNotEnabled

CapacityUpdateScopesFailed

CapacityUpdateScopesFailed

UnsupportedReservationTerm

UnsupportedReservationTerm

ReservationOrderIdAlreadyExists

ReservationOrderIdAlreadyExists

RiskCheckFailed

RiskCheckFailed

CreateQuoteFailed

CreateQuoteFailed

ActivateQuoteFailed

ActivateQuoteFailed

NonsupportedAccountId

NonsupportedAccountId

PaymentInstrumentNotFound

PaymentInstrumentNotFound

MissingAppliedScopesForSingle

MissingAppliedScopesForSingle

NoValidReservationsToReRate

NoValidReservationsToReRate

ReRateOnlyAllowedForEA

ReRateOnlyAllowedForEA

OperationCannotBePerformedInCurrentState

OperationCannotBePerformedInCurrentState

InvalidSingleAppliedScopesCount

InvalidSingleAppliedScopesCount

InvalidFulfillmentRequestParameters

InvalidFulfillmentRequestParameters

NotSupportedCountry

NotSupportedCountry

InvalidRefundQuantity

InvalidRefundQuantity

PurchaseError

PurchaseError

BillingCustomerInputError

BillingCustomerInputError

BillingPaymentInstrumentSoftError

BillingPaymentInstrumentSoftError

BillingPaymentInstrumentHardError

BillingPaymentInstrumentHardError

BillingTransientError

BillingTransientError

BillingError

BillingError

FulfillmentConfigurationError

FulfillmentConfigurationError

FulfillmentOutOfStockError

FulfillmentOutOfStockError

FulfillmentTransientError

FulfillmentTransientError

FulfillmentError

FulfillmentError

CalculatePriceFailed

CalculatePriceFailed

AppliedScopesSameAsExisting

AppliedScopesSameAsExisting

SelfServiceRefundNotSupported

SelfServiceRefundNotSupported

RefundLimitExceeded

RefundLimitExceeded

ExtendedErrorInfo

Extended error information including error code and error message

Name Type Description
code

ErrorResponseCode

Error code describing the reason that service is not able to process the incoming request

message

string

ExtendedStatusInfo

Name Type Description
message

string

The message giving detailed information about the status code.

statusCode

ReservationStatusCode

InstanceFlexibility

Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.

Value Description
On

On

Off

Off

PaymentDetail

Information about payment related to a reservation order.

Name Type Description
billingAccount

string

Shows the Account that is charged for this payment.

billingCurrencyTotal

Price

Amount charged in Billing currency. Tax not included. Is null for future payments

dueDate

string (date)

Date when the payment needs to be done.

extendedStatusInfo

ExtendedStatusInfo

paymentDate

string (date)

Date when the transaction is completed. Is null when it is scheduled.

pricingCurrencyTotal

Price

Amount in pricing currency. Tax not included.

status

PaymentStatus

Describes whether the payment is completed, failed, cancelled or scheduled in the future.

PaymentStatus

Describes whether the payment is completed, failed, cancelled or scheduled in the future.

Value Description
Succeeded

Succeeded

Failed

Failed

Scheduled

Scheduled

Cancelled

Cancelled

Price

Pricing information containing the amount and the currency code

Name Type Description
amount

number (double)

currencyCode

string

The ISO 4217 3-letter currency code for the currency used by this purchase record.

PurchaseRequest

The request for reservation purchase

Name Type Default value Description
location

string

The Azure region where the reserved resource lives.

properties.appliedScopeProperties

AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup

properties.appliedScopeType

AppliedScopeType

Type of the Applied Scope.

properties.appliedScopes

string[]

List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.

properties.billingPlan

ReservationBillingPlan

Represent the billing plans.

properties.billingScopeId

string

Subscription that will be charged for purchasing reservation or savings plan

properties.displayName

string

Friendly name of the reservation

properties.quantity

integer (int32)

Quantity of the skus that are part of the reservation.

properties.renew

boolean

False

Setting this to true will automatically purchase a new reservation on the expiration date time.

properties.reservedResourceProperties

PurchaseRequestPropertiesReservedResourceProperties

Properties specific to each reserved resource type. Not required if not applicable.

properties.reservedResourceType

ReservedResourceType

The type of the resource that is being reserved. In addition to below types we have also added the following: OpenAIPTU, MDC, Sentinel.

properties.reviewDateTime

string (date-time)

This is the date-time when the Azure hybrid benefit needs to be reviewed.

properties.term

ReservationTerm

Represent the term of reservation.

sku

SkuName

The name of sku

PurchaseRequestPropertiesReservedResourceProperties

Properties specific to each reserved resource type. Not required if not applicable.

Name Type Description
instanceFlexibility

InstanceFlexibility

Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.

ReservationBillingPlan

Represent the billing plans.

Value Description
Upfront

Upfront

Monthly

Monthly

ReservationStatusCode

Value Description
None

None

Pending

Pending

Processing

Processing

Active

Active

PurchaseError

PurchaseError

PaymentInstrumentError

PaymentInstrumentError

Split

Split

Merged

Merged

Expired

Expired

Succeeded

Succeeded

ReservationTerm

Represent the term of reservation.

Value Description
P1Y

P1Y

P3Y

P3Y

P5Y

P5Y

ReservedResourceType

The type of the resource that is being reserved. In addition to below types we have also added the following: OpenAIPTU, MDC, Sentinel.

Value Description
VirtualMachines

VirtualMachines

SqlDatabases

SqlDatabases

SuseLinux

SuseLinux

CosmosDb

CosmosDb

RedHat

RedHat

SqlDataWarehouse

SqlDataWarehouse

VMwareCloudSimple

VMwareCloudSimple

RedHatOsa

RedHatOsa

Databricks

Databricks

AppService

AppService

ManagedDisk

ManagedDisk

BlockBlob

BlockBlob

RedisCache

RedisCache

AzureDataExplorer

AzureDataExplorer

MySql

MySql

MariaDb

MariaDb

PostgreSql

PostgreSql

DedicatedHost

DedicatedHost

SapHana

SapHana

SqlAzureHybridBenefit

SqlAzureHybridBenefit

AVS

AVS

DataFactory

DataFactory

NetAppStorage

NetAppStorage

AzureFiles

AzureFiles

SqlEdge

SqlEdge

VirtualMachineSoftware

VirtualMachineSoftware

SkuName

The name of sku

Name Type Description
name

string