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 |
Supported version. |
Request Body
Name | Type | Description |
---|---|---|
location |
string |
The Azure region where the reserved resource lives. |
properties.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 |
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 |
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 |
Properties specific to each reserved resource type. Not required if not applicable. |
|
properties.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 |
Represent the term of reservation. |
|
sku |
The name of sku |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Detailed price info for purchasing |
|
Other Status Codes |
Unexpected error |
Examples
CalculatePrice
Sample request
POST https://management.azure.com/providers/Microsoft.Capacity/calculatePrice?api-version=2022-11-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
Name | Description |
---|---|
Applied |
Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup |
Applied |
Type of the Applied Scope. |
Billing |
Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. |
Calculate |
The response of calculate price for reservation. |
Calculate |
Properties for calculate price response |
Error |
Error information |
Error |
Error code describing the reason that service is not able to process the incoming request |
Extended |
Extended error information including error code and error message |
Extended |
|
Instance |
Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. |
Payment |
Information about payment related to a reservation order. |
Payment |
Describes whether the payment is completed, failed, cancelled or scheduled in the future. |
Price |
Pricing information containing the amount and the currency code |
Pricing |
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. |
Purchase |
The request for reservation purchase |
Reservation |
Represent the billing plans. |
Reservation |
|
Reservation |
Represent the term of reservation. |
Reserved |
Properties specific to each reserved resource type. Not required if not applicable. |
Reserved |
The type of the resource that is being reserved. In addition to below types we have also added the following: OpenAIPTU, MDC, Sentinel. |
Sku |
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 | |
Shared | |
ManagementGroup |
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 |
The ISO 4217 3-letter currency code for the currency used by this purchase record. |
CalculatePriceResponse
The response of calculate price for reservation.
Name | Type | Description |
---|---|---|
properties |
Properties for calculate price response |
CalculatePriceResponseProperties
Properties for calculate price response
Name | Type | Description |
---|---|---|
billingCurrencyTotal |
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 |
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. |
taxTotal |
number (double) |
Tax amount in pricing currency. |
Error
Error information
Name | Type | Description |
---|---|---|
error |
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 | |
InternalServerError | |
ServerTimeout | |
AuthorizationFailed | |
BadRequest | |
ClientCertificateThumbprintNotSet | |
InvalidRequestContent | |
OperationFailed | |
HttpMethodNotSupported | |
InvalidRequestUri | |
MissingTenantId | |
InvalidTenantId | |
InvalidReservationOrderId | |
InvalidReservationId | |
ReservationIdNotInReservationOrder | |
ReservationOrderNotFound | |
InvalidSubscriptionId | |
InvalidAccessToken | |
InvalidLocationId | |
UnauthenticatedRequestsThrottled | |
InvalidHealthCheckType | |
Forbidden | |
BillingScopeIdCannotBeChanged | |
AppliedScopesNotAssociatedWithCommerceAccount | |
PatchValuesSameAsExisting | |
RoleAssignmentCreationFailed | |
ReservationOrderCreationFailed | |
ReservationOrderNotEnabled | |
CapacityUpdateScopesFailed | |
UnsupportedReservationTerm | |
ReservationOrderIdAlreadyExists | |
RiskCheckFailed | |
CreateQuoteFailed | |
ActivateQuoteFailed | |
NonsupportedAccountId | |
PaymentInstrumentNotFound | |
MissingAppliedScopesForSingle | |
NoValidReservationsToReRate | |
ReRateOnlyAllowedForEA | |
OperationCannotBePerformedInCurrentState | |
InvalidSingleAppliedScopesCount | |
InvalidFulfillmentRequestParameters | |
NotSupportedCountry | |
InvalidRefundQuantity | |
PurchaseError | |
BillingCustomerInputError | |
BillingPaymentInstrumentSoftError | |
BillingPaymentInstrumentHardError | |
BillingTransientError | |
BillingError | |
FulfillmentConfigurationError | |
FulfillmentOutOfStockError | |
FulfillmentTransientError | |
FulfillmentError | |
CalculatePriceFailed | |
AppliedScopesSameAsExisting | |
SelfServiceRefundNotSupported | |
RefundLimitExceeded |
ExtendedErrorInfo
Extended error information including error code and error message
Name | Type | Description |
---|---|---|
code |
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 |
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 | |
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 |
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 | ||
paymentDate |
string (date) |
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.
Value | Description |
---|---|
Succeeded | |
Failed | |
Scheduled | |
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. |
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 |
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 |
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 |
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 |
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 |
Properties specific to each reserved resource type. Not required if not applicable. |
||
properties.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 |
Represent the term of reservation. |
||
sku |
The name of sku |
ReservationBillingPlan
Represent the billing plans.
Value | Description |
---|---|
Upfront | |
Monthly |
ReservationStatusCode
Value | Description |
---|---|
None | |
Pending | |
Processing | |
Active | |
PurchaseError | |
PaymentInstrumentError | |
Split | |
Merged | |
Expired | |
Succeeded |
ReservationTerm
Represent the term of reservation.
Value | Description |
---|---|
P1Y | |
P3Y | |
P5Y |
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. In addition to below types we have also added the following: OpenAIPTU, MDC, Sentinel.
Value | Description |
---|---|
VirtualMachines | |
SqlDatabases | |
SuseLinux | |
CosmosDb | |
RedHat | |
SqlDataWarehouse | |
VMwareCloudSimple | |
RedHatOsa | |
Databricks | |
AppService | |
ManagedDisk | |
BlockBlob | |
RedisCache | |
AzureDataExplorer | |
MySql | |
MariaDb | |
PostgreSql | |
DedicatedHost | |
SapHana | |
SqlAzureHybridBenefit | |
AVS | |
DataFactory | |
NetAppStorage | |
AzureFiles | |
SqlEdge | |
VirtualMachineSoftware |
SkuName
The name of sku
Name | Type | Description |
---|---|---|
name |
string |