diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/billing.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/billing.json index 95c0890e34e7..0af8d52cbe50 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/billing.json +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/billing.json @@ -1400,6 +1400,54 @@ } } }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/validateTransferEligibility": { + "post": { + "x-ms-examples": { + "SubscriptionTransferValidateSuccess": { + "$ref": "./examples/ValidateSubscriptionTransferSuccess.json" + }, + "SubscriptionTransferValidateFailure": { + "$ref": "./examples/ValidateSubscriptionTransferFailure.json" + } + }, + "operationId": "BillingSubscriptions_ValidateTransfer", + "description": "Validates the transfer of billing subscriptions across invoice sections.", + "parameters": [ + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/invoiceSectionNameParameter" + }, + { + "$ref": "#/parameters/billingSubscriptionNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TransferBillingSubscriptionRequestProperties" + }, + "description": "Parameters supplied to the Transfer Billing Subscription operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ValidateSubscriptionTransferEligibilityResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products": { "get": { "tags": [ @@ -1611,6 +1659,54 @@ } } }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/validateTransferEligibility": { + "post": { + "x-ms-examples": { + "SubscriptionTransferValidateSuccess": { + "$ref": "./examples/ValidateProductTransferSuccess.json" + }, + "SubscriptionTransferValidateFailure": { + "$ref": "./examples/ValidateProductTransferFailure.json" + } + }, + "operationId": "Products_ValidateTransfer", + "description": "Validates the transfer of products across invoice sections.", + "parameters": [ + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/invoiceSectionNameParameter" + }, + { + "$ref": "#/parameters/productNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TransferProductRequestProperties" + }, + "description": "Parameters supplied to the Transfer Products operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ValidateProductTransferEligibilityResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions": { "get": { "tags": [ @@ -3691,8 +3787,12 @@ "description": "The properties of the product to initiate a transfer.", "properties": { "destinationInvoiceSectionId": { - "description": "Destination invoice section id.", - "type": "string" + "type": "string", + "description": "The destination invoice section id." + }, + "destinationBillingProfileId": { + "type": "string", + "description": "The destination billing profile id." } } }, @@ -3735,9 +3835,64 @@ "destinationInvoiceSectionId": { "type": "string", "description": "The destination invoice section id." + }, + "destinationBillingProfileId": { + "type": "string", + "description": "The destination billing profile id." + } + } + }, + "ValidateSubscriptionTransferEligibilityResult": { + "type": "object", + "description": "Result of the transfer eligibility validation.", + "properties": { + "isTransferEligible": { + "description": "Specifies whether the transfer is eligible or not.", + "type": "boolean", + "readOnly": true + }, + "errorDetails": { + "description": "Validation error details.", + "$ref": "#/definitions/ValidateSubscriptionTransferEligibilityError" + } + } + }, + "ValidateSubscriptionTransferEligibilityError": { + "type": "object", + "description": "Error details of the transfer eligibility validation", + "properties": { + "code": { + "description": "Error code for the product transfer validation.", + "$ref": "#/definitions/SubscriptionTransferValidationErrorCode" + }, + "message": { + "description": "The error message.", + "type": "string" + }, + "details": { + "description": "Detailed error message explaining the error.", + "type": "string" } } }, + "SubscriptionTransferValidationErrorCode": { + "type": "string", + "description": "Error code of the transfer validation response.", + "enum": [ + "InvalidSource", + "SubscriptionNotActive", + "InsufficientPermissionOnSource", + "InsufficientPermissionOnDestination", + "DestinationBillingProfilePastDue", + "SubscriptionTypeNotSupported", + "CrossBillingAccountNotAllowed", + "NotAvailableForDestinationMarket" + ], + "x-ms-enum": { + "name": "subscriptionTransferValidationErrorCode", + "modelAsString": true + } + }, "UpdateAutoRenewOperationSummary": { "type": "object", "description": "Summary of cancel product operation", @@ -4738,6 +4893,58 @@ } } }, + "ValidateProductTransferEligibilityResult": { + "type": "object", + "description": "Result of the product transfer eligibility validation.", + "properties": { + "isTransferEligible": { + "description": "Specifies whether the transfer is eligible or not.", + "type": "boolean", + "readOnly": true + }, + "errorDetails": { + "description": "Validation error details.", + "$ref": "#/definitions/ValidateProductTransferEligibilityError" + } + } + }, + "ValidateProductTransferEligibilityError": { + "type": "object", + "description": "Error details of the product transfer eligibility validation.", + "properties": { + "code": { + "description": "Error code for the product transfer validation.", + "$ref": "#/definitions/ProductTransferValidationErrorCode" + }, + "message": { + "description": "The error message.", + "type": "string" + }, + "details": { + "description": "Detailed error message explaining the error.", + "type": "string" + } + } + }, + "ProductTransferValidationErrorCode": { + "type": "string", + "description": "Error code of the transfer validation response.", + "enum": [ + "InvalidSource", + "ProductNotActive", + "InsufficientPermissionOnSource", + "InsufficientPermissionOnDestination", + "DestinationBillingProfilePastDue", + "ProductTypeNotSupported", + "CrossBillingAccountNotAllowed", + "NotAvailableForDestinationMarket", + "OneTimePurchaseProductTransferNotAllowed" + ], + "x-ms-enum": { + "name": "productTransferValidationErrorCode", + "modelAsString": true + } + }, "BillingSubscriptionsListResult": { "description": "Result of listing billing subscriptions summary.", "properties": { diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/TransferBillingSubscription.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/TransferBillingSubscription.json index e9558c7d3d8b..28691c89e30f 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/TransferBillingSubscription.json +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/TransferBillingSubscription.json @@ -5,7 +5,8 @@ "invoiceSectionName": "{invoiceSectionName}", "billingSubscriptionName": "{billingSubscriptionName}", "parameters": { - "destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{newInvoiceSectionName}" + "destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{newInvoiceSectionName}", + "destinationBillingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{newBillingProfileName}" } }, "responses": { diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/TransferProduct.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/TransferProduct.json index adcce68ee2c7..dc49de699f96 100644 --- a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/TransferProduct.json +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/TransferProduct.json @@ -5,7 +5,8 @@ "invoiceSectionName": "{invoiceSectionName}", "productName": "{productName}", "parameters": { - "destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{newInvoiceSectionName}" + "destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{newInvoiceSectionName}", + "destinationBillingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{newBillingProfileName}" } }, "responses": { diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateProductTransferFailure.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateProductTransferFailure.json new file mode 100644 index 000000000000..de33919caad3 --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateProductTransferFailure.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "api-version": "2018-11-01-preview", + "billingAccountName": "{billingAccountName}", + "invoiceSectionName": "{invoiceSectionName}", + "productName": "{productName}", + "parameters": { + "destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{newInvoiceSectionName}", + "destinationBillingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{newBillingProfileName}" + } + }, + "responses": { + "200": { + "body": { + "isTransferEligible": false, + "errorDetails": { + "code" : "ProductTypeNotSupported", + "message" : "Product '{productName}' is not allowed to be transferred." + } + } + } + } +} \ No newline at end of file diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateProductTransferSuccess.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateProductTransferSuccess.json new file mode 100644 index 000000000000..7edb141ae853 --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateProductTransferSuccess.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2018-11-01-preview", + "billingAccountName": "{billingAccountName}", + "invoiceSectionName": "{invoiceSectionName}", + "productName": "{productName}", + "parameters": { + "destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{newInvoiceSectionName}", + "destinationBillingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{newBillingProfileName}" + } + }, + "responses": { + "200": { + "body": { + "isTransferEligible": true + } + } + } +} \ No newline at end of file diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateSubscriptionTransferFailure.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateSubscriptionTransferFailure.json new file mode 100644 index 000000000000..e0004f41cd19 --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateSubscriptionTransferFailure.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "api-version": "2018-11-01-preview", + "billingAccountName": "{billingAccountName}", + "invoiceSectionName": "{invoiceSectionName}", + "billingSubscriptionName": "{billingSubscriptionName}", + "parameters": { + "destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{newInvoiceSectionName}", + "destinationBillingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{newBillingProfileName}" + } + }, + "responses": { + "200": { + "body": { + "isTransferEligible": false, + "errorDetails": { + "code" : "SubscriptionNotActive", + "message" : "Invoice Sections can only be changed for active subscriptions." + } + } + } + } +} \ No newline at end of file diff --git a/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateSubscriptionTransferSuccess.json b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateSubscriptionTransferSuccess.json new file mode 100644 index 000000000000..c5e93cf366ec --- /dev/null +++ b/specification/billing/resource-manager/Microsoft.Billing/preview/2018-11-01-preview/examples/ValidateSubscriptionTransferSuccess.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2018-11-01-preview", + "billingAccountName": "{billingAccountName}", + "invoiceSectionName": "{invoiceSectionName}", + "billingSubscriptionName": "{billingSubscriptionName}", + "parameters": { + "destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{newInvoiceSectionName}", + "destinationBillingProfileId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{newBillingProfileName}" + } + }, + "responses": { + "200": { + "body": { + "isTransferEligible": true + } + } + } +} \ No newline at end of file