SMAO API Documentation
Billing

Get billing summary for a single organization

Returns usage for the requested date window compared against the organization's current subscription plan. The date range must not exceed 31 days. Usage is compared against the plan's included allowances and any overages are calculated with the plan's per-unit overage cost.

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

Long-lived distributor API key scoped to a channel partner on the shared smao instance.

In: header

Path Parameters

organizationIdstring

MongoDB ObjectId of the organization.

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

Query Parameters

fromstring

Start date in YYYY-MM-DD format, inclusive.

Formatdate
tostring

End date in YYYY-MM-DD format, inclusive.

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/v1/organizations/string/billing-summary?from=2019-08-24&to=2019-08-24"
{
  "status": "success",
  "organization": {
    "id": "69c175970f3e28310926a1aa",
    "name": "Acme GmbH",
    "externalCustomerId": "SYN-4711",
    "externalContractId": "CON-2026-0001"
  },
  "window": {
    "from": "2026-03-01",
    "to": "2026-03-31"
  },
  "plan": {
    "id": "6967b1c7138bed3e7f6bf7e6",
    "slug": "advanced",
    "name": "Advanced",
    "commitment": "monthly",
    "currency": "EUR",
    "baseFee": 6900
  },
  "usage": {
    "callMinutes": {
      "included": 500,
      "used": 623,
      "overage": 123,
      "costPerUnit": 15,
      "overageCost": 1845,
      "callCount": 247
    },
    "forwardingMinutes": {
      "included": 100,
      "used": 45,
      "overage": 0,
      "costPerUnit": 25,
      "overageCost": 0,
      "callCount": 18
    },
    "sms": {
      "included": 200,
      "used": 312,
      "overage": 112,
      "costPerUnit": 10,
      "overageCost": 1120,
      "messageCount": 298
    },
    "whatsapp": {
      "included": 100,
      "used": 0,
      "overage": 0,
      "costPerUnit": 5,
      "overageCost": 0,
      "messageCount": 0
    },
    "additionalAssistants": {
      "included": 3,
      "used": 5,
      "overage": 2,
      "costPerUnit": 990,
      "overageCost": 1980
    }
  },
  "totals": {
    "totalOverageCost": 4945,
    "currency": "EUR"
  }
}
{
  "status": "error",
  "errorCode": "INVALID_DATE_RANGE",
  "message": "from and to must be valid YYYY-MM-DD values"
}
{
  "status": "error",
  "errorCode": "INVALID_DATE_RANGE",
  "message": "from and to must be valid YYYY-MM-DD values"
}
{
  "status": "error",
  "errorCode": "INVALID_DATE_RANGE",
  "message": "from and to must be valid YYYY-MM-DD values"
}
{
  "status": "error",
  "errorCode": "INVALID_DATE_RANGE",
  "message": "from and to must be valid YYYY-MM-DD values"
}

{
  "status": "error",
  "errorCode": "RATE_LIMITED",
  "message": "Too many requests for this API key."
}
{
  "status": "error",
  "errorCode": "INVALID_DATE_RANGE",
  "message": "from and to must be valid YYYY-MM-DD values"
}

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