Manage License-based Assets
Programatically add or remove licenses for your Google G Suite (Workspace) or Office 365 subscriptions
Customers with active Google G Suite (now Workspace) or Microsoft Office 365 subscriptions can provision additional licenses for their domains. Customers on flexible (not annual) subscriptions can also decrease the number of their licenses.
Assets API is a programmatic way to increase or decrease your Google G Suite/Workspace or Microsoft Office 365 licenses with an easy to use RESTful API.
API Reference
The Assets API reference is available at https://developer.doit-intl.com/reference/assets
Required Permissions
Licenses Manager permissions (part of
IT Manager
built-in role)
Licenses API has the following methods:
assets.list
The assets.list method provides a list of all managed by DoiT International assets.
You can filter the list by using one or more of the following parameters:
Parameter | Description |
---|---|
|
Supported filter keys:
Learn more about how to properly use filter *.list requests. |
Sample assets.list Request to list all managed Google Cloud billing accounts and active G Suite/Workspace subscriptions:
curl --location --request GET 'https://api.doit-intl.com/billing/v1/assets?filter=type:g-suite|type:google-cloud' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data-raw ''
your-api-key
Always replace "your-api-key" with your actual API key as explained at Getting Started
Sample assets.list Response:
{
"assets": [
{
"id": "amazon-web-services-028115051195",
"type": "amazon-web-services",
"licenseQty": "N/A",
"assetName": "my-aws-account (028115051195)",
"url": "https://app.doit-intl.com/customers/2Gi0e4pPA3wsfJNOOohW/assets/amazon-web-services"
},
{
"id": "g-suite-1834534158",
"type": "g-suite",
"licenseQty": "850",
"assetName": "G Suite Business (mydomain.com)",
"url": "https://app.doit-intl.com/customers/2Gi0e4pPA3wsfJNOOohW/assets/g-suite"
},
{
"id": "g-suite-849299858",
"type": "g-suite",
"licenseQty": "0",
"assetName": "Cloud Identity Free (mydomain.com)",
"url": "https://app.doit-intl.com/customers/2Gi0e4pPA3wsfJNOOohW/assets/g-suite"
},
{
"id": "google-cloud-01FE64-BB73DE-4BA1D8",
"type": "google-cloud",
"licenseQty": "N/A",
"assetName": "doit.mybillingaccount.com (21FE64-BB93DE-4BA1D8)",
"url": "https://app.doit-intl.com/customers/2Gi0e4pPA3wsfJNOOohW/assets/google-cloud"
}
]
}
assets.patch
Update the asset to have more or fewer licenses. While you can always add more licenses, you won't be able to decrease the number of licenses for annual/commitment subscriptions.
Sample assets.patch Request:
curl --location --request PATCH 'https://api.doit-intl.com/billing/v1/assets/g-suite-1834534158' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data-raw '"quantity": 855'
How to use licenseQty parameter
Quantity in the scope of
assets.patch
means how many licences you'd like your subscription to have AFTER a successful patch operation. For example, if your subscription has 850 licenses and you set the quantity to 855, you're effectively adding 5 licenses.
your-api-key
Always replace "your-api-key" with your actual API key as explained at Getting Started
Sample assets.patch Response:
{
"id": "g-suite-1834534158",
"type": "g-suite",
"properties": {
"customerDomain": "mydomain.com",
"customerID": "C02q3hlmm",
"reseller": "[email protected]",
"subscription": {
"BillingMethod": "ONLINE",
"CreationTime": 1566204362147,
"PurchaseOrderID": "",
"ResourceUIURL": "https://www.google.com/a/cpanel/mydomain.com/AdminHome#DomainSettings/notab=1\u0026subtab=subscriptions",
"SkuID": "Google-Apps-For-Business",
"SkuName": "G Suite Basic",
"Status": "ACTIVE",
"ID": "950157319",
"Plan": {
"CommitmentInterval": null,
"IsCommitmentPlan": false,
"PlanName": "FLEXIBLE"
},
"RenewalSettings": null,
"Seats": {
"LicensedNumberOfSeats": 8,
"MaximumNumberOfSeats": 9,
"NumberOfSeats": 0
}
},
"settings": null
}
}
Response Body
If successful, the response body contains an instance of Asset
object
{
"id": string,
"type": string,
"properties": {
"customerDomain": string,
"customerID": string,
"reseller": string,
"subscription": {
"BillingMethod": string,
"CreationTime": number,
"PurchaseOrderID": string,
"ResourceUIURL": string,
"SkuID": string,
"SkuName": string,
"Status": string,
"ID": string,
"Plan": {
"CommitmentInterval": boolean,
"IsCommitmentPlan": boolean,
"PlanName": string"
},
"RenewalSettings": null,
"Seats": {
"LicensedNumberOfSeats": number,
"MaximumNumberOfSeats": number,
"NumberOfSeats": number
}
},
"settings": null
}
}
Response Body Fields
Field | Description |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'properties.subscription.PurchaseOrderID' |
|
'properties.subscription.ResourceUIURL' |
|
'properties.subscription.SkuID' |
|
'properties.subscription.SkuName' |
|
'properties.subscription.Status' |
|
'properties.subscription.ID' |
|
| part of ( |
|
|
Updated over 1 year ago