# Appropriate method to calculate remaining licenses on account

**URL:** <https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341>\
**Category:** API and Webhooks\
**Created:** [September 15, 2020, 6:56pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341 "2020-09-15T18:56:30Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkumar05](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mkumar05/32/11183_2.png) [@mkumar05](https://devforum.zoom.us/u/mkumar05)\
**Post date:** [September 15, 2020, 6:56pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/1 "2020-09-15T18:56:30Z")

</div>

I wanted to validate the appropriate way to validate the number of remaining licenses in an account to troubleshoot an issue I am having with the number the formula is returning.

I have been using the following formula:

remainingLicenses = planBaseHosts - planBaseUsage + subAccountSeats

**planBaseHosts:**

- [https://marketplace.zoom.us/docs/api-reference/zoom-api/billing/getplanusage](https://marketplace.zoom.us/docs/api-reference/zoom-api/billing/getplanusage)
- [https://api.zoom.us/v2/accounts/me/plans/usage](https://api.zoom.us/v2/accounts/me/plans/usage)
- json key: [“plan\_base”][“hosts”]

**planBaseUsage:**

- [https://marketplace.zoom.us/docs/api-reference/zoom-api/billing/getplanusage](https://marketplace.zoom.us/docs/api-reference/zoom-api/billing/getplanusage)
- [https://api.zoom.us/v2/accounts/me/plans/usage](https://api.zoom.us/v2/accounts/me/plans/usage)
- json key: [“plan\_base”][“usage”]

**subAccountSeats:**

- [https://marketplace.zoom.us/docs/api-reference/zoom-api/accounts/accounts](https://marketplace.zoom.us/docs/api-reference/zoom-api/accounts/accounts)
- [https://api.zoom.us/v2/accounts](https://api.zoom.us/v2/accounts)
- json key: [“accounts”][“seats”] (loop through all accounts and add up seats)
- Note: this was added to formula after first two values in the formula didn’t zero out when Zoom reported there was zero remaining licenses.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 17, 2020, 6:05pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/2 "2020-09-17T18:05:21Z")

</div>

Hey @mkumar05,

Yes, that should be the correct formula. 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![mkumar05](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mkumar05/32/11183_2.png) [@mkumar05](https://devforum.zoom.us/u/mkumar05)\
**Post date:** [September 17, 2020, 7:33pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/3 "2020-09-17T19:33:50Z")

</div>

Thanks! What would it mean if it returns a negative number?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 18, 2020, 9:55pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/4 "2020-09-18T21:55:37Z")

</div>

Hey @mkumar05,

Can you share the values that you are using to get the negative number?

That way I can take a look! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![mkumar05](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mkumar05/32/11183_2.png) [@mkumar05](https://devforum.zoom.us/u/mkumar05)\
**Post date:** [September 18, 2020, 11:05pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/5 "2020-09-18T23:05:45Z")

</div>

Here are the values for a log a couple days ago:

I have seen the number also hit -1 sometimes when I add in the subaccount seats.

My main issue has been I can’t manually license users in the web portal when I have under 55 licenses available (but users do get a license when the are created via the SSO/SAML process), so I’m wondering if something is wrong with our numbers.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 21, 2020, 10:21pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/6 "2020-09-21T22:21:17Z")

</div>

Hey @mkumar05,

Let me investigate this and get back to you. (ZOOM-198963)

I will find out why you are getting a negative number sometimes.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![mkumar05](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mkumar05/32/11183_2.png) [@mkumar05](https://devforum.zoom.us/u/mkumar05)\
**Post date:** [September 22, 2020, 12:06am UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/7 "2020-09-22T00:06:46Z")

</div>

I found a -1 example, there were a lot of logs to dig through.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 23, 2020, 5:07pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/8 "2020-09-23T17:07:49Z")

</div>

Hey @mkumar05,

To confirm, you don’t need to include the sub account seats. The correct formula is

`hosts` - `usage`

hosts = available licenses, and usage = licenses being used

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![mkumar05](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mkumar05/32/11183_2.png) [@mkumar05](https://devforum.zoom.us/u/mkumar05)\
**Post date:** [September 23, 2020, 11:29pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/9 "2020-09-23T23:29:16Z")

</div>

Thanks! Since that is the formula, my number would be -55 or -56 at times. I have a guess as to what that means, but wanted to see if you have any direct insight.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 25, 2020, 6:11pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/10 "2020-09-25T18:11:04Z")

</div>

Hey @mkumar05,

That is strange, it should not be a negative number in most cases. What was your guess? I am happy to look into why the numbers add up this way for your account if you’d like.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![mkumar05](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mkumar05/32/11183_2.png) [@mkumar05](https://devforum.zoom.us/u/mkumar05)\
**Post date:** [September 25, 2020, 10:00pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/11 "2020-09-25T22:00:38Z")

</div>

I think we were assigned more licenses to our account than we officially had (it was something I was told may have happened). We just purchased another large batch of licenses which I am hoping will ultimately correct the issue. Alternatively it could be a bug with the way subaccount licenses alter the total number of licenses available.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 28, 2020, 8:56pm UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/12 "2020-09-28T20:56:29Z")

</div>

Hey @mkumar05,

That could be the case. Let me confirm and see. 🙂

(I have just private messaged you)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [October 29, 2020, 6:56am UTC](https://devforum.zoom.us/t/appropriate-method-to-calculate-remaining-licenses-on-account/30341/13 "2020-10-29T06:56:32Z")

</div>

Closed on October 29, 2020, 6:56am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
