Hi,
I am attempting to increase the prepaid units for one of our licenses using the Graph API as part of an automation. However, I am receiving an error message:
{
"error": {
"code": "Request_BadRequest",
"message": "Invalid value specified for property 'lockedOut' of resource 'LicenseUnitsDetail'.",
"details": [
{
"code": "InvalidValue",
"message": "Invalid value specified for property 'lockedOut' of resource 'LicenseUnitsDetail'.",
"target": "lockedOut"
}
],
"innerError": {
"date": "2023-08-22T08:10:10",
"request-id": "0b08cf4c-86d2-4409-9b25-33c0281ccd44",
"client-request-id": "5348d351-df7a-0e5f-19fd-805996cc36b3"
}
}
}
This is the request I am sending:
PATCH https://graph.microsoft.com/v1.0/subscribedSkus/*$id*
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscribedSkus(prepaidUnits)/$entity",
"prepaidUnits": {
"enabled": 16,
"suspended": 0,
"warning": 0,
"lockedOut": 0
}
}
I have also tried the same request using PowerShell, here is my code:
$body = "{
`"prepaidUnits`": {
`"enabled`": 16,
`"lockedOut`": 0,
`"suspended`": 0,
`"warning`": 0
}
}"
$patch = Invoke-RestMethod -Uri $patchurl -Method Patch -Body $body -Headers $Header -ContentType $contentType
Can someone help me figure out what I am missing?
I have checked that the subscribedSku entity has the property "prepaidUnits" of type graph.licenseUnitsDetail which has this structure: https://learn.microsoft.com/en-us/graph/api/resources/licenseunitsdetail?view=graph-rest-1.0#json-representation