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=2019-04-01

URI Parameters

Name In Required Type Description
api-version
query True
  • string

Supported version for this document is 2019-04-01

Request Body

Name Type Description
location
  • string

The Azure Region where the reserved resource lives.

properties.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.

properties.billingPlan

Represent the billing plans.

properties.billingScopeId
  • string

Subscription that will be charged for purchasing Reservation

properties.displayName
  • string

Friendly name of the Reservation

properties.quantity
  • integer

Quantity of the SKUs that are part of the Reservation. Must be greater than zero.

properties.renew
  • boolean

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

properties.reservedResourceProperties

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

properties.reservedResourceType

The type of the resource that is being reserved.

properties.term

Represent the term of Reservation.

sku

Responses

Name Type Description
200 OK

Detailed price info for purchasing ReservationOrder

Other Status Codes

Unexpected error

Examples

Purchase

Sample Request

POST https://management.azure.com/providers/Microsoft.Capacity/calculatePrice?api-version=2019-04-01
{
  "sku": {
    "name": "standard_D1"
  },
  "location": "westus",
  "properties": {
    "reservedResourceType": "VirtualMachines",
    "billingScopeId": "/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83",
    "term": "P1Y",
    "billingPlan": "Monthly",
    "quantity": "1",
    "displayName": "TestReservationOrder",
    "appliedScopes": null,
    "appliedScopeType": "Shared",
    "reservedResourceProperties": {
      "instanceFlexibility": "On"
    }
  }
}

Sample Response

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

Definitions

AppliedScopeType

Type of the Applied Scope.

BillingCurrencyTotal

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

CalculatePriceResponse
CalculatePriceResponseProperties
Error
ErrorResponseCode
ExtendedErrorInfo
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
PricingCurrencyTotal

Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry.

PurchaseRequest
ReservationBillingPlan

Represent the billing plans.

ReservationStatusCode
ReservationTerm

Represent the term of Reservation.

ReservedResourceProperties

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

ReservedResourceType

The type of the resource that is being reserved.

SkuName

AppliedScopeType

Type of the Applied Scope.

Name Type Description
Shared
  • string
Single
  • string

BillingCurrencyTotal

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

Name Type Description
amount
  • number
currencyCode
  • string

CalculatePriceResponse

Name Type Description
properties

CalculatePriceResponseProperties

Name Type Description
billingCurrencyTotal

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

isBillingPartnerManaged
  • boolean

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

paymentSchedule

Information about payment related to a reservation order.

pricingCurrencyTotal

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.

Error

Name Type Description
error

ErrorResponseCode

Name Type Description
ActivateQuoteFailed
  • string
AppliedScopesNotAssociatedWithCommerceAccount
  • string
AuthorizationFailed
  • string
BadRequest
  • string
BillingCustomerInputError
  • string
BillingError
  • string
BillingPaymentInstrumentHardError
  • string
BillingPaymentInstrumentSoftError
  • string
BillingScopeIdCannotBeChanged
  • string
BillingTransientError
  • string
CalculatePriceFailed
  • string
CapacityUpdateScopesFailed
  • string
ClientCertificateThumbprintNotSet
  • string
CreateQuoteFailed
  • string
Forbidden
  • string
FulfillmentConfigurationError
  • string
FulfillmentError
  • string
FulfillmentOutOfStockError
  • string
FulfillmentTransientError
  • string
HttpMethodNotSupported
  • string
InternalServerError
  • string
InvalidAccessToken
  • string
InvalidFulfillmentRequestParameters
  • string
InvalidHealthCheckType
  • string
InvalidLocationId
  • string
InvalidRefundQuantity
  • string
InvalidRequestContent
  • string
InvalidRequestUri
  • string
InvalidReservationId
  • string
InvalidReservationOrderId
  • string
InvalidSingleAppliedScopesCount
  • string
InvalidSubscriptionId
  • string
InvalidTenantId
  • string
MissingAppliedScopesForSingle
  • string
MissingTenantId
  • string
NoValidReservationsToReRate
  • string
NonsupportedAccountId
  • string
NotSpecified
  • string
NotSupportedCountry
  • string
OperationCannotBePerformedInCurrentState
  • string
OperationFailed
  • string
PatchValuesSameAsExisting
  • string
PaymentInstrumentNotFound
  • string
PurchaseError
  • string
ReRateOnlyAllowedForEA
  • string
ReservationIdNotInReservationOrder
  • string
ReservationOrderCreationFailed
  • string
ReservationOrderIdAlreadyExists
  • string
ReservationOrderNotEnabled
  • string
ReservationOrderNotFound
  • string
RiskCheckFailed
  • string
RoleAssignmentCreationFailed
  • string
ServerTimeout
  • string
UnauthenticatedRequestsThrottled
  • string
UnsupportedReservationTerm
  • string

ExtendedErrorInfo

Name Type Description
code
message
  • string

ExtendedStatusInfo

Name Type Description
message
  • string

The message giving detailed information about the status code.

statusCode

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.

Name Type Description
Off
  • string
On
  • string

PaymentDetail

Information about payment related to a reservation order.

Name Type Description
billingAccount
  • string

Shows the Account that is charged for this payment.

billingCurrencyTotal

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

dueDate
  • string

Date when the payment needs to be done.

extendedStatusInfo
paymentDate
  • string

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

pricingCurrencyTotal

Amount in pricing currency. Tax not included.

status

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.

Name Type Description
Cancelled
  • string
Failed
  • string
Scheduled
  • string
Succeeded
  • string

Price

Name Type Description
amount
  • number
currencyCode
  • string

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

PricingCurrencyTotal

Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry.

Name Type Description
amount
  • number
currencyCode
  • string

PurchaseRequest

Name Type Description
location
  • string

The Azure Region where the reserved resource lives.

properties.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.

properties.billingPlan

Represent the billing plans.

properties.billingScopeId
  • string

Subscription that will be charged for purchasing Reservation

properties.displayName
  • string

Friendly name of the Reservation

properties.quantity
  • integer

Quantity of the SKUs that are part of the Reservation. Must be greater than zero.

properties.renew
  • boolean

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

properties.reservedResourceProperties

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

properties.reservedResourceType

The type of the resource that is being reserved.

properties.term

Represent the term of Reservation.

sku

ReservationBillingPlan

Represent the billing plans.

Name Type Description
Monthly
  • string
Upfront
  • string

ReservationStatusCode

Name Type Description
Active
  • string
Expired
  • string
Merged
  • string
None
  • string
PaymentInstrumentError
  • string
Pending
  • string
PurchaseError
  • string
Split
  • string
Succeeded
  • string

ReservationTerm

Represent the term of Reservation.

Name Type Description
P1Y
  • string
P3Y
  • string

ReservedResourceProperties

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

Name Type Description
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.

ReservedResourceType

The type of the resource that is being reserved.

Name Type Description
CosmosDb
  • string
RedHat
  • string
RedHatOsa
  • string
SqlDataWarehouse
  • string
SqlDatabases
  • string
SuseLinux
  • string
VMwareCloudSimple
  • string
VirtualMachines
  • string

SkuName

Name Type Description
name
  • string