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 |
|
Supported version. |
Request Body
Name | Type | Description |
---|---|---|
location |
|
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 |
|
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 |
|
Subscription that will be charged for purchasing reservation or savings plan |
properties.displayName |
|
Friendly name of the reservation |
properties.quantity |
|
Quantity of the skus that are part of the reservation. |
properties.renew |
|
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.reviewDateTime |
|
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
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. |
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 |
|
Display name |
managementGroupId |
|
Fully-qualified identifier of the management group where the benefit must be applied. |
resourceGroupId |
|
Fully-qualified identifier of the resource group. |
subscriptionId |
|
Fully-qualified identifier of the subscription. |
tenantId |
|
Tenant ID where the savings plan should apply benefit. |
AppliedScopeType
Type of the Applied Scope.
Name | Type | Description |
---|---|---|
ManagementGroup |
|
|
Shared |
|
|
Single |
|
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 |
|
|
currencyCode |
|
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 |
|
Total amount in pricing currency. |
isBillingPartnerManaged |
|
True if billing is managed by Microsoft Partner. Used only for CSP accounts. |
isTaxIncluded |
|
Whether or not tax is included in grand total |
netTotal |
|
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 |
|
GUID that represents reservation order that can be placed after calculating price. |
skuDescription |
|
Description of sku that is being purchased. |
skuTitle |
|
Title of sku that is being purchased. |
taxTotal |
|
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
Name | Type | Description |
---|---|---|
ActivateQuoteFailed |
|
|
AppliedScopesNotAssociatedWithCommerceAccount |
|
|
AppliedScopesSameAsExisting |
|
|
AuthorizationFailed |
|
|
BadRequest |
|
|
BillingCustomerInputError |
|
|
BillingError |
|
|
BillingPaymentInstrumentHardError |
|
|
BillingPaymentInstrumentSoftError |
|
|
BillingScopeIdCannotBeChanged |
|
|
BillingTransientError |
|
|
CalculatePriceFailed |
|
|
CapacityUpdateScopesFailed |
|
|
ClientCertificateThumbprintNotSet |
|
|
CreateQuoteFailed |
|
|
Forbidden |
|
|
FulfillmentConfigurationError |
|
|
FulfillmentError |
|
|
FulfillmentOutOfStockError |
|
|
FulfillmentTransientError |
|
|
HttpMethodNotSupported |
|
|
InternalServerError |
|
|
InvalidAccessToken |
|
|
InvalidFulfillmentRequestParameters |
|
|
InvalidHealthCheckType |
|
|
InvalidLocationId |
|
|
InvalidRefundQuantity |
|
|
InvalidRequestContent |
|
|
InvalidRequestUri |
|
|
InvalidReservationId |
|
|
InvalidReservationOrderId |
|
|
InvalidSingleAppliedScopesCount |
|
|
InvalidSubscriptionId |
|
|
InvalidTenantId |
|
|
MissingAppliedScopesForSingle |
|
|
MissingTenantId |
|
|
NoValidReservationsToReRate |
|
|
NonsupportedAccountId |
|
|
NotSpecified |
|
|
NotSupportedCountry |
|
|
OperationCannotBePerformedInCurrentState |
|
|
OperationFailed |
|
|
PatchValuesSameAsExisting |
|
|
PaymentInstrumentNotFound |
|
|
PurchaseError |
|
|
ReRateOnlyAllowedForEA |
|
|
RefundLimitExceeded |
|
|
ReservationIdNotInReservationOrder |
|
|
ReservationOrderCreationFailed |
|
|
ReservationOrderIdAlreadyExists |
|
|
ReservationOrderNotEnabled |
|
|
ReservationOrderNotFound |
|
|
RiskCheckFailed |
|
|
RoleAssignmentCreationFailed |
|
|
SelfServiceRefundNotSupported |
|
|
ServerTimeout |
|
|
UnauthenticatedRequestsThrottled |
|
|
UnsupportedReservationTerm |
|
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 |
|
ExtendedStatusInfo
Name | Type | Description |
---|---|---|
message |
|
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 |
|
|
On |
|
PaymentDetail
Information about payment related to a reservation order.
Name | Type | Description |
---|---|---|
billingAccount |
|
Shows the Account that is charged for this payment. |
billingCurrencyTotal |
Amount charged in Billing currency. Tax not included. Is null for future payments |
|
dueDate |
|
Date when the payment needs to be done. |
extendedStatusInfo | ||
paymentDate |
|
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 |
|
|
Failed |
|
|
Scheduled |
|
|
Succeeded |
|
Price
Pricing information containing the amount and the currency code
Name | Type | Description |
---|---|---|
amount |
|
|
currencyCode |
|
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 |
|
|
currencyCode |
|
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 |
|
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 |
|
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 |
|
Subscription that will be charged for purchasing reservation or savings plan |
|
properties.displayName |
|
Friendly name of the reservation |
|
properties.quantity |
|
Quantity of the skus that are part of the reservation. |
|
properties.renew |
|
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. |
||
properties.reviewDateTime |
|
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.
Name | Type | Description |
---|---|---|
Monthly |
|
|
Upfront |
|
ReservationStatusCode
Name | Type | Description |
---|---|---|
Active |
|
|
Expired |
|
|
Merged |
|
|
None |
|
|
PaymentInstrumentError |
|
|
Pending |
|
|
Processing |
|
|
PurchaseError |
|
|
Split |
|
|
Succeeded |
|
ReservationTerm
Represent the term of reservation.
Name | Type | 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.
Name | Type | Description |
---|---|---|
AVS |
|
|
AppService |
|
|
AzureDataExplorer |
|
|
AzureFiles |
|
|
BlockBlob |
|
|
CosmosDb |
|
|
DataFactory |
|
|
Databricks |
|
|
DedicatedHost |
|
|
ManagedDisk |
|
|
MariaDb |
|
|
MySql |
|
|
NetAppStorage |
|
|
PostgreSql |
|
|
RedHat |
|
|
RedHatOsa |
|
|
RedisCache |
|
|
SapHana |
|
|
SqlAzureHybridBenefit |
|
|
SqlDataWarehouse |
|
|
SqlDatabases |
|
|
SqlEdge |
|
|
SuseLinux |
|
|
VMwareCloudSimple |
|
|
VirtualMachineSoftware |
|
|
VirtualMachines |
|
SkuName
The name of sku
Name | Type | Description |
---|---|---|
name |
|