---
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`

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

---

[API](https://skmtc.net/azure/apis/reservations-microsoft-capacity-reservations.md) · [All operations](https://skmtc.net/azure/apis/reservations-microsoft-capacity-reservations/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/reservations-microsoft-capacity-reservations/revisions/1d4481f1bd1e/schema)
