Get current metered usage for the organization
GET
/api/v1/billing/usage
const url = 'https://api.yggy.tech/api/v1/billing/usage';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.yggy.tech/api/v1/billing/usage \ --header 'Authorization: Bearer <token>'Returns usage for metered Stripe subscription items in the current billing period.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Usage list
Media type application/json
object
usage
required
Array<object>
object
label
required
string
current
required
number
limit
required
number | null
percent
required
number | null
unit
required
string | null
costCents
required
Cost in smallest currency unit (cents)
number | null
currency
required
Currency code (e.g. eur, usd)
string | null
color
required
Hex color for this dimension
string
totalCostCents
required
Sum of all costCents
number
currency
required
Currency code (same for all items)
string | null
spendPolicy
required
object
overageMode
required
Stop at the extra budget, or keep billing usage without a limit
string
extraBudgetCents
required
Monthly amount in minor units allowed beyond the included pool, shared by credits and storage
integer
Example
{ "spendPolicy": { "overageMode": "stop" }, "staffGrant": { "plan": "free", "creditCap": "unlimited" }}No active organization
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Not authenticated
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}Server error
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
required
string
details
Example
{ "success": false, "error": { "code": "INTERNAL_ERROR" }}