Get the billing report (internal)

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.usehearsay.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "integrations MCP server": {
    "url": "https://docs.usehearsay.com/mcp"
  }
}

Close
POST /billing/report

Returns the organization's billing charges in a date window, grouped by case, with charged, plan-included, waived or voided, failed and refunded totals; the window defaults to the current billing period up to now and can be limited to some cases. With format: 'pdf' it renders the report as a PDF and returns the stored file and a time-limited download URL instead of the data. Requires an org admin, owner or billing role; returns 404 while billing reports are turned off and 400 for a start date after the end date or more than 50,000 rows.

Headers

  • organization string Required

    id of the selected (active) organization

application/json

Body Required

  • caseIds array[string]

    Defaults to all cases

  • startDate string(date-time)

    Defaults to the start of the organization's current billing cadence period

  • endDate string(date-time)

    Defaults to now

  • format string

    Values are json or pdf. Default value is json.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      One of:
    • statusCode number Required
    • timestamp string(date-time) Required
POST /billing/report
curl \
 --request POST 'http://api.example.com/billing/report' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --header "organization: string" \
 --data '{
  "caseIds": [
    "string"
  ],
  "startDate": "2026-05-04T09:42:00Z",
  "endDate": "2026-05-04T09:42:00Z",
  "format": "json"
}'
Request examples
# Headers
organization: string

# Payload
{
  "caseIds": [
    "string"
  ],
  "startDate": "2026-05-04T09:42:00Z",
  "endDate": "2026-05-04T09:42:00Z",
  "format": "json"
}
Response examples (200)
{
  "data": {
    "organizations": [
      {
        "organizationId": "65a1b2c3d4e5f6a7b8c9d0e3",
        "organizationName": "Acme Legal",
        "tier": "firm",
        "billingMode": "payg",
        "onCaseBilling": true,
        "window": {
          "startDate": "2026-01-01T00:00:00.000Z",
          "endDate": "2026-01-15T10:15:00.000Z"
        },
        "cases": [
          {
            "caseId": "65a1b2c3d4e5f6a7b8c9d0e2",
            "caseName": "Smith v. Jones",
            "rows": [
              {
                "date": "2026-01-15T10:15:00.000Z",
                "skuKey": "collection.phone",
                "description": "Phone collection",
                "quantity": 1,
                "unitAmountCents": 17900,
                "amountCents": 17900,
                "status": "INVOICED",
                "invoiceId": "in_1PExample"
              }
            ],
            "subtotalChargedCents": 17900,
            "subtotalInformationalCents": 0
          }
        ],
        "totalChargedCents": 42300,
        "totalInformationalCents": 5000,
        "totalNonChargeableCents": 0,
        "totalFailedCents": 0,
        "totalRefundedCents": 0
      }
    ],
    "grandTotalChargedCents": 42300
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}