Creating a Microsoft 365 Subscription for a Registered Microsoft Account
This section describes how to create a Microsoft 365 subscription for a registered Microsoft account of a customer account.
To create a Microsoft 365 subscription for a registered Microsoft account of a customer account, create a sales order as described in the Platform SDK Guide.
If the customer account that you are going to create this sales order for has several Microsoft accounts, you must specify the Microsoft account that the new Microsoft 365 subscription will be bound to. To do this, obtain the internal identifier of the target Microsoft account, as described in Obtaining the Internal Identifier of a Microsoft Account, and specify it in the ms_account_id parameter of the parameters array, as shown below.
"parameters": [
{
"aps": {
"type": "APS_TYPE_ID_OF_TENANT_RESOURCE"
},
"ms_account_id": "GUID"
}
]
Note: To prepare the APS type ID of an APS resource, use the instructions in Obtaining APS Type IDs.
After creating this sales order, the following events happen:
- In your system, a Microsoft 365 subscription is created for the customer account. This Microsoft 365 subscription is bound to the Microsoft account.
- In the Microsoft cloud, one or more cloud subscriptions are created for the Microsoft account, depending on the resources and limits of the Microsoft 365 subscription.
Important: Creating orders is a custom operation. The user whose key and secret you use to access the APS REST API must have http://www.odin.com/billing/order-management and POST in its list of allowed operations.
Example
HTTP Request
POST https://example.com/aps/2/services/order-manager/orders
{
"type": "SALES",
"accountId": "0b0daf96-5f45-406b-a664-e7401ea75fd4",
"paymentMethodId": "0",
"products": [
{
"planId": "dd93d155-cfaf-4418-b0e7-abdb819f9858",
"period": {
"unit": "YEARS",
"duration": 1
},
"resources": [
{
"resourceId": "d60766de-3857-4a27-a65e-dad9d346b42d",
"amount": 2
}
],
"parameters": []
}
]
}
HTTP Response
{
"orderId": "329288d1-9814-4444-ad90-ceb3d83694cd",
"paymentCreationResult": {
"paymentId": 3
}
}