---
title: "Calculate the refund amount of a reservation order."
method: POST
path: "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund"
tags: ["CalculateRefund"]
---

# Calculate the refund amount of a reservation order.

`POST /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund`

## Request

- Base URL: `https://management.azure.com`
- URL: `https://management.azure.com/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund`
- Auth: none declared

Calculate price for returning `Reservations` if there are no policy errors.

## Path parameters

- `reservationOrderId` string, required

## Query parameters

- `api-version` string, required

## Request body

- CalculateRefundRequest
  - `id` string: Fully qualified identifier of the reservation order being returned
  - `properties` CalculateRefundRequestProperties
    - `scope` string: The scope of the refund, e.g. Reservation
    - `reservationToReturn` ReservationToReturn: Reservation to return
      - `reservationId` string: Fully qualified identifier of the Reservation being returned
      - `quantity` integer: Quantity to be returned. Must be greater than zero.

## Response `200`

Detailed refund info of a reservation

- CalculateRefundResponse
  - `id` string: Fully qualified identifier of the reservation being returned
  - `properties` RefundResponseProperties
    - `sessionId` string: Refund session identifier
    - `quantity` integer: Quantity to be returned
    - `billingRefundAmount` Price
      - `currencyCode` string: The ISO 4217 3-letter currency code for the currency used by this purchase record.
      - `amount` number, double
    - `pricingRefundAmount` Price
      - `currencyCode` string: The ISO 4217 3-letter currency code for the currency used by this purchase record.
      - `amount` number, double
    - `policyResult` RefundPolicyResult: Refund policy result
      - `properties` RefundPolicyResultProperty: Refund policy result property
        - `consumedRefundsTotal` Price
          - `currencyCode` string: The ISO 4217 3-letter currency code for the currency used by this purchase record.
          - `amount` number, double
        - `maxRefundLimit` Price
          - `currencyCode` string: The ISO 4217 3-letter currency code for the currency used by this purchase record.
          - `amount` number, double
        - `policyErrors` RefundPolicyError[]: Refund Policy errors
          - `code` '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'
          - `message` string
    - `billingInformation` RefundBillingInformation: billing information
      - `billingPlan` 'Upfront' | 'Monthly': Represent the billing plans.
      - `completedTransactions` integer: The number of completed transactions in this reservation's payment
      - `totalTransactions` integer: The number of total transactions in this reservation's payment
      - `billingCurrencyTotalPaidAmount` Price
        - `currencyCode` string: The ISO 4217 3-letter currency code for the currency used by this purchase record.
        - `amount` number, double
      - `billingCurrencyProratedAmount` Price
        - `currencyCode` string: The ISO 4217 3-letter currency code for the currency used by this purchase record.
        - `amount` number, double
      - `billingCurrencyRemainingCommitmentAmount` Price
        - `currencyCode` string: The ISO 4217 3-letter currency code for the currency used by this purchase record.
        - `amount` number, double

## Other responses

- `default`: Unexpected error

## Changes

- **2026-07-13** (2017-11-01) `11a19365e7ac`: 1 info
  - endpoint added
- **2026-07-13** (2017-11-01) `e016e4a47b3d`: 1 warning
  - deleted the `query` request parameter `api-version`

[Operation history](https://skmtc.dev/azure/apis/reservations-microsoft-capacity-reservations/changes/providers/Microsoft.Capacity/reservationOrders/:reservationOrderId/calculateRefund/post.md)

---

[API](https://skmtc.dev/azure/apis/reservations-microsoft-capacity-reservations.md) - [All operations](https://skmtc.dev/azure/apis/reservations-microsoft-capacity-reservations/llms.txt) - [OpenAPI document](https://skmtc.dev/azure/apis/reservations-microsoft-capacity-reservations/revisions/11a19365e7ac?raw)
