Manage License-based Assets
Programatically add or remove licenses for your Google Workspace or Office 365 subscriptions
Customers with active Google 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 Workspace, or Microsoft Office 365 licenses with an easy to use RESTful API.
API ReferenceThe Assets API reference is available at https://developer.doit.com/reference/assets
Required PermissionsLicenses 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 the assets managed by DoiT.
You can filter the list by using one or more of the following parameters:
Parameter | Description |
---|---|
|
Supported filter keys:
|
Sample assets.list Request to list all managed Google Cloud billing accounts and active Google Workspace subscriptions:
curl --location --request GET 'https://api.doit.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_KEYReplace "YOUR_API_KEY" with your actual API key as explained at Get 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.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.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 parameterQuantity 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.
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 9 days ago