SMAO API Documentation

Get organization billing summary

Returns usage and current license plan for one MSP or customer organization. Historical plan-window proration is not performed.

GET
/organizations/{organizationId}/billing-summary
AuthorizationBearer <token>

In: header

Path Parameters

organizationIdstring
Match^[a-fA-F0-9]{24}$

Query Parameters

fromstring

Start date in YYYY-MM-DD. Future dates are rejected. Usage endpoints allow up to 365 days; billing-summary allows up to 31 days.

Formatdate
tostring

End date in YYYY-MM-DD. Future dates are rejected. Usage endpoints allow up to 365 days; billing-summary allows up to 31 days.

Formatdate

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://api.smao.ai/api/distributor/v2/organizations/string/billing-summary?from=2019-08-24&to=2019-08-24"
{
  "status": "success",
  "organization": {
    "id": "string",
    "type": "msp",
    "name": "string",
    "industry": "string",
    "timezone": "string",
    "channelPartner": "string",
    "externalOrganizationId": "string",
    "parentOrganizationId": "string",
    "status": "active",
    "blockedReason": "string",
    "ownerEmail": "string",
    "externalLicenseId": "string",
    "license": {
      "id": "string",
      "externalLicenseId": "string",
      "status": "available",
      "owningOrganizationId": "string",
      "assignedOrganizationId": "string",
      "plan": {
        "id": "string",
        "slug": "string",
        "name": "string",
        "commitment": "none",
        "currency": "string",
        "baseFee": 0
      },
      "assignedAt": "2019-08-24T14:15:22Z",
      "disabledAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z"
    },
    "createdAt": "2019-08-24T14:15:22Z"
  },
  "license": {
    "id": "string",
    "externalLicenseId": "string",
    "status": "available",
    "owningOrganizationId": "string",
    "assignedOrganizationId": "string",
    "plan": {
      "id": "string",
      "slug": "string",
      "name": "string",
      "commitment": "none",
      "currency": "string",
      "baseFee": 0
    },
    "assignedAt": "2019-08-24T14:15:22Z",
    "disabledAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "window": {
    "from": "2019-08-24",
    "to": "2019-08-24"
  },
  "plan": {
    "id": "string",
    "slug": "string",
    "name": "string",
    "commitment": "none",
    "currency": "string",
    "baseFee": 0
  },
  "usage": {
    "callMinutes": {
      "included": 0,
      "used": 0,
      "overage": 0,
      "costPerUnit": 0,
      "overageCost": 0,
      "callCount": 0,
      "messageCount": 0
    },
    "forwardingMinutes": {
      "included": 0,
      "used": 0,
      "overage": 0,
      "costPerUnit": 0,
      "overageCost": 0,
      "callCount": 0,
      "messageCount": 0
    },
    "sms": {
      "included": 0,
      "used": 0,
      "overage": 0,
      "costPerUnit": 0,
      "overageCost": 0,
      "callCount": 0,
      "messageCount": 0
    },
    "whatsapp": {
      "included": 0,
      "used": 0,
      "overage": 0,
      "costPerUnit": 0,
      "overageCost": 0,
      "callCount": 0,
      "messageCount": 0
    },
    "additionalAssistants": {
      "included": 0,
      "used": 0,
      "overage": 0,
      "costPerUnit": 0,
      "overageCost": 0,
      "callCount": 0,
      "messageCount": 0
    }
  },
  "totals": {
    "totalOverageCost": 0,
    "currency": "string"
  }
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}

{
  "status": "error",
  "errorCode": "RATE_LIMITED",
  "message": "Too many requests for this API key."
}
{
  "status": "error",
  "errorCode": "VALIDATION_ERROR",
  "message": "string"
}

{
  "status": "error",
  "errorCode": "RATE_LIMIT_UNAVAILABLE",
  "message": "Rate limit storage is unavailable. Try again later."
}