Billing

Get Monthly Spending

Changed on

Get monthly spending metrics for a year.

Authenticate with either a Cognito JWT or an sk-… API key.

Parameters:

  • year: Year to get spending for (defaults to current year)
  • mode:
    • gross: Only count usage charges
    • net: Include refunds in calculation

Returns 12 months of data including months with zero spending.

get/api/v1/billing/spending

Request

  • The document declares no server URL.
  • Auth
    • OAuth 2
      Authorization codehttps://auth.mor.org/oauth2/authorize
      Token URLhttps://auth.mor.org/oauth2/token
      Scopesaws.cognito.signin.user.admin, openid, email, profile
    • or HTTP bearer

Query parameters

yearinteger

Year for spending data (defaults to current year)

mode'gross' | 'net'

Spending calculation mode.

Response

Successful Response

yearinteger required
mode'gross' | 'net' required

Spending calculation mode.

totalstring required

Total spending for the year

currencystring

Changes