Share via


Return - Post

Return a reservation and get refund information.

POST https://management.azure.com/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return?api-version=2022-11-01

URI Parameters

Name In Required Type Description
reservationOrderId
path True

string

Order Id of the reservation

api-version
query True

string

Supported version.

Request Body

Name Type Description
properties

RefundRequestProperties

Properties needed for refund request including the session id from calculate refund, the scope, the reservation to be returned and the return reason.

Responses

Name Type Description
200 OK

ReservationOrderResponse

The resource has been returned

202 Accepted

RefundResponse

Detailed refund info of a reservation

Headers

Location: string

Other Status Codes

Error

Unexpected error

Examples

Return a reservation

Sample request

POST https://management.azure.com/providers/Microsoft.Capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/return?api-version=2022-11-01

{
  "properties": {
    "sessionId": "10000000-aaaa-bbbb-cccc-200000000000",
    "scope": "Reservation",
    "reservationToReturn": {
      "reservationId": "/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000",
      "quantity": 1
    },
    "returnReason": "PurchasedWrongProduct"
  }
}

Sample response

{
  "id": "/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004",
  "type": "Microsoft.Capacity/reservationOrders",
  "name": "50000000-aaaa-bbbb-cccc-100000000004",
  "etag": 7,
  "properties": {
    "displayName": "cabri",
    "requestDateTime": "2017-08-30T03:49:19.0252126Z",
    "createdDateTime": "2017-08-30T03:51:49.8083758Z",
    "expiryDate": "2018-08-30",
    "expiryDateTime": "2018-08-30T03:51:49.8083758Z",
    "term": "P1Y",
    "billingPlan": "Monthly",
    "provisioningState": "Succeeded",
    "reservations": [
      {
        "id": "/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000"
      }
    ],
    "originalQuantity": 7
  }
}
Location: https://management.azure.com/providers/Microsoft.Capacity/reservationorders/50000000-aaaa-bbbb-cccc-100000000004?api-version=2022-11-01
{
  "id": "/providers/Microsoft.Capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000000",
  "properties": {
    "sessionId": "10000000-aaaa-bbbb-cccc-200000000000",
    "quantity": 1,
    "billingRefundAmount": {
      "currencyCode": "GBP",
      "amount": 20.52
    },
    "pricingRefundAmount": {
      "currencyCode": "USD",
      "amount": 24.68
    },
    "policyResult": {
      "properties": {
        "consumedRefundsTotal": {
          "currencyCode": "USD",
          "amount": 83.69
        },
        "maxRefundLimit": {
          "currencyCode": "USD",
          "amount": 50000
        },
        "policyErrors": []
      }
    },
    "billingInformation": {
      "billingPlan": "Upfront",
      "completedTransactions": 1,
      "totalTransactions": 1,
      "billingCurrencyTotalPaidAmount": {
        "currencyCode": "GBP",
        "amount": 24
      },
      "billingCurrencyProratedAmount": {
        "currencyCode": "GBP",
        "amount": 3.48
      },
      "billingCurrencyRemainingCommitmentAmount": {
        "currencyCode": "GBP",
        "amount": 0
      }
    }
  }
}

Definitions

Name Description
AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup

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.

createdByType

The type of identity that created the resource.

Error

Error information

ErrorResponseCode

Error code describing the reason that service is not able to process the incoming request

ExtendedErrorInfo

Extended error information including error code and error message

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.

Kind

Resource Provider type to be reserved.

PaymentDetail

Information about payment related to a reservation order.

PaymentStatus

Describes whether the payment is completed, failed, cancelled or scheduled in the future.

Price

Pricing information containing the amount and the currency code

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.

ProvisioningState

Represent the current state of the Reservation.

PurchaseRequest

The request for reservation purchase

RefundBillingInformation

billing information

RefundPolicyError

error details

RefundPolicyResult

Refund policy result

RefundPolicyResultProperty

Refund policy result property

RefundRequest

Request containing information needed for returning reservation.

RefundRequestProperties

Properties needed for refund request including the session id from calculate refund, the scope, the reservation to be returned and the return reason.

RefundResponse

The response of refund request containing refund information of reservation

RefundResponseProperties

The refund properties of reservation

RenewPropertiesResponse

The renew properties for a reservation.

ReservationBillingPlan

Represent the billing plans.

ReservationMergeProperties

Properties of reservation merge

ReservationOrderBillingPlanInformation

Information describing the type of billing plan for this reservation.

ReservationOrderResponse

Details of a reservation order being returned.

ReservationResponse

The definition of the reservation.

ReservationSplitProperties

Properties of reservation split

ReservationsProperties

The properties of the reservations

ReservationStatusCode
ReservationSwapProperties

Properties of reservation swap

ReservationTerm

Represent the term of reservation.

ReservationToReturn

Reservation to return

ReservationUtilizationAggregates

The aggregate values of reservation utilization

ReservedResourceProperties

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

ReservedResourceType

The type of the resource that is being reserved. In addition to below types we have also added the following: OpenAIPTU, MDC, Sentinel.

SkuName

The name of sku

systemData

Metadata pertaining to creation and last modification of the resource.

Utilization

Reservation utilization

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.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

Error

Error information

Name Type Description
error

ExtendedErrorInfo

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

ErrorResponseCode

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

ReservationStatusCode

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

Kind

Resource Provider type to be reserved.

Value Description
Microsoft.Compute

PaymentDetail

Information about payment related to a reservation order.

Name Type Description
billingAccount

string

Shows the Account that is charged for this payment.

billingCurrencyTotal

Price

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

ExtendedStatusInfo

paymentDate

string (date)

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

pricingCurrencyTotal

Price

Amount in pricing currency. Tax not included.

status

PaymentStatus

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.

ProvisioningState

Represent the current state of the Reservation.

Value Description
Creating
PendingResourceHold
ConfirmedResourceHold
PendingBilling
ConfirmedBilling
Created
Succeeded
Cancelled
Expired
BillingFailed
Failed
Split
Merged

PurchaseRequest

The request for reservation purchase

Name Type Default value Description
location

string

The Azure region where the reserved resource lives.

properties.appliedScopeProperties

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

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

ReservationBillingPlan

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

ReservedResourceProperties

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

properties.reservedResourceType

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

ReservationTerm

Represent the term of reservation.

sku

SkuName

The name of sku

RefundBillingInformation

billing information

Name Type Description
billingCurrencyProratedAmount

Price

Pricing information containing the amount and the currency code

billingCurrencyRemainingCommitmentAmount

Price

Pricing information containing the amount and the currency code

billingCurrencyTotalPaidAmount

Price

Pricing information containing the amount and the currency code

billingPlan

ReservationBillingPlan

Represent the billing plans.

completedTransactions

integer (int32)

The number of completed transactions in this reservation's payment

totalTransactions

integer (int32)

The number of total transactions in this reservation's payment

RefundPolicyError

error details

Name Type Description
code

ErrorResponseCode

Error code describing the reason that service is not able to process the incoming request

message

string

RefundPolicyResult

Refund policy result

Name Type Description
properties

RefundPolicyResultProperty

Refund policy result property

RefundPolicyResultProperty

Refund policy result property

Name Type Description
consumedRefundsTotal

Price

Pricing information containing the amount and the currency code

maxRefundLimit

Price

Pricing information containing the amount and the currency code

policyErrors

RefundPolicyError[]

Refund Policy errors

RefundRequest

Request containing information needed for returning reservation.

Name Type Description
properties

RefundRequestProperties

Properties needed for refund request including the session id from calculate refund, the scope, the reservation to be returned and the return reason.

RefundRequestProperties

Properties needed for refund request including the session id from calculate refund, the scope, the reservation to be returned and the return reason.

Name Type Description
reservationToReturn

ReservationToReturn

Reservation to return

returnReason

string

The reason of returning the reservation

scope

string

The scope of the refund, e.g. Reservation

sessionId

string

SessionId that was returned by CalculateRefund API.

RefundResponse

The response of refund request containing refund information of reservation

Name Type Description
id

string

Fully qualified identifier of the reservation being returned

properties

RefundResponseProperties

The refund properties of reservation

RefundResponseProperties

The refund properties of reservation

Name Type Description
billingInformation

RefundBillingInformation

billing information

billingRefundAmount

Price

Pricing information containing the amount and the currency code

policyResult

RefundPolicyResult

Refund policy result

pricingRefundAmount

Price

Pricing information containing the amount and the currency code

quantity

integer (int32)

Quantity to be returned

sessionId

string

Refund session identifier

RenewPropertiesResponse

The renew properties for a reservation.

Name Type Description
billingCurrencyTotal

BillingCurrencyTotal

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

pricingCurrencyTotal

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.

purchaseProperties

PurchaseRequest

The request for reservation purchase

ReservationBillingPlan

Represent the billing plans.

Value Description
Upfront
Monthly

ReservationMergeProperties

Properties of reservation merge

Name Type Description
mergeDestination

string

Reservation resource id Created due to the merge. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}

mergeSources

string[]

Resource ids of the source reservation's merged to form this reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}

ReservationOrderBillingPlanInformation

Information describing the type of billing plan for this reservation.

Name Type Description
nextPaymentDueDate

string (date)

For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off.

pricingCurrencyTotal

Price

Amount of money to be paid for the Order. Tax is not included.

startDate

string (date)

Date when the billing plan has started.

transactions

PaymentDetail[]

Information about payment related to a reservation order.

ReservationOrderResponse

Details of a reservation order being returned.

Name Type Description
etag

integer (int32)

id

string

Identifier of the reservation

name

string

Name of the reservation

properties.benefitStartTime

string (date-time)

This is the DateTime when the reservation benefit started.

properties.billingPlan

ReservationBillingPlan

Represent the billing plans.

properties.createdDateTime

string (date-time)

This is the DateTime when the reservation was created.

properties.displayName

string

Friendly name for user to easily identified the reservation.

properties.expiryDate

string (date)

This is the date when the reservation will expire.

properties.expiryDateTime

string (date-time)

This is the date-time when the reservation will expire.

properties.originalQuantity

integer (int32)

Total Quantity of the skus purchased in the reservation.

properties.planInformation

ReservationOrderBillingPlanInformation

Information describing the type of billing plan for this reservation.

properties.provisioningState

ProvisioningState

Current state of the reservation.

properties.requestDateTime

string (date-time)

This is the DateTime when the reservation was initially requested for purchase.

properties.reservations

ReservationResponse[]

The definition of the reservation.

properties.reviewDateTime

string (date-time)

This is the date-time when the Azure Hybrid Benefit needs to be reviewed.

properties.term

ReservationTerm

Represent the term of reservation.

systemData

systemData

Metadata pertaining to creation and last modification of the resource.

type

string

Type of resource. "Microsoft.Capacity/reservations"

ReservationResponse

The definition of the reservation.

Name Type Description
etag

integer (int32)

id

string (arm-id)

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

kind

Kind

Resource Provider type to be reserved.

location

string

The Azure region where the reserved resource lives.

name

string

The name of the resource

properties

ReservationsProperties

The properties associated to this reservation

sku

SkuName

The sku information associated to this reservation

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

ReservationSplitProperties

Properties of reservation split

Name Type Description
splitDestinations

string[]

List of destination resource id that are created due to split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}

splitSource

string

Resource id of the reservation from which this is split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}

ReservationsProperties

The properties of the reservations

Name Type Default value Description
appliedScopeProperties

AppliedScopeProperties

Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup

appliedScopeType

AppliedScopeType

The applied scope type

appliedScopes

string[]

The list of applied scopes

archived

boolean

Indicates if the reservation is archived

benefitStartTime

string (date-time)

This is the DateTime when the reservation benefit started.

billingPlan

ReservationBillingPlan

The billing plan options available for this sku.

billingScopeId

string

Subscription that will be charged for purchasing reservation or savings plan

capabilities

string

Capabilities of the reservation

displayName

string

Friendly name for user to easily identify the reservation

displayProvisioningState

string

The provisioning state of the reservation for display, e.g. Succeeded

effectiveDateTime

string (date-time)

DateTime of the reservation starting when this version is effective from.

expiryDate

string (date)

This is the date when the reservation will expire.

expiryDateTime

string (date-time)

This is the date-time when the reservation will expire.

extendedStatusInfo

ExtendedStatusInfo

The message giving detailed information about the status code.

instanceFlexibility

InstanceFlexibility

Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility.

lastUpdatedDateTime

string (date-time)

DateTime of the last time the reservation was updated.

mergeProperties

ReservationMergeProperties

Properties of reservation merge

provisioningState

ProvisioningState

Current state of the reservation.

provisioningSubState

string

The provisioning sub-state of the reservation, e.g. Succeeded

purchaseDate

string (date)

This is the date when the reservation was purchased.

purchaseDateTime

string (date-time)

This is the date-time when the reservation was purchased.

quantity

integer (int32)

Quantity of the skus that are part of the reservation.

renew

boolean

False

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

renewDestination

string

Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.

renewProperties

RenewPropertiesResponse

The renew properties for a reservation.

renewSource

string

Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.

reservedResourceType

ReservedResourceType

The type of the resource that is being reserved.

reviewDateTime

string (date-time)

This is the date-time when the Azure Hybrid Benefit needs to be reviewed.

skuDescription

string

Description of the sku in english.

splitProperties

ReservationSplitProperties

Properties of reservation split

swapProperties

ReservationSwapProperties

Properties of reservation swap

term

ReservationTerm

Represent the term of reservation.

userFriendlyAppliedScopeType

string

The applied scope type of the reservation for display, e.g. Shared

userFriendlyRenewState

string

The renew state of the reservation for display, e.g. On

utilization

Utilization

Reservation utilization

ReservationStatusCode

Value Description
None
Pending
Processing
Active
PurchaseError
PaymentInstrumentError
Split
Merged
Expired
Succeeded

ReservationSwapProperties

Properties of reservation swap

Name Type Description
swapDestination

string

Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}

swapSource

string

Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}

ReservationTerm

Represent the term of reservation.

Value Description
P1Y
P3Y
P5Y

ReservationToReturn

Reservation to return

Name Type Description
quantity

integer (int32)

Quantity to be returned. Must be greater than zero.

reservationId

string

Fully qualified identifier of the reservation being returned

ReservationUtilizationAggregates

The aggregate values of reservation utilization

Name Type Description
grain

number

The grain of the aggregate

grainUnit

string

The grain unit of the aggregate

value

number

The aggregate value

valueUnit

string

The aggregate value unit

ReservedResourceProperties

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

Name Type Description
instanceFlexibility

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

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

Utilization

Reservation utilization

Name Type Description
aggregates

ReservationUtilizationAggregates[]

The array of aggregates of a reservation's utilization

trend

string

last 7 day utilization trend for a reservation