> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# Retrieve a statement

GET https://%7BYour_Space_Name%7D.signalwire.com/api/space/billing_statement

Returns one month's statement as JSON: the totals for the month, company-wide usage by
kind, and usage per project. Filter the breakdown with `kind` and `project`.
`/api/space/billing_statement.json` returns the same response. For the
same statement as a file, use
[Download a statement as CSV](/docs/apis/rest/space/billing/get-billing-statement-csv)
or [Download a statement as PDF](/docs/apis/rest/space/billing/get-billing-statement-pdf).

The statement is computed on request from the usage reporting pipeline, so the
response is `502` when that pipeline is unavailable.

#### Permissions

Authenticate with a [Personal access token](/docs/apis/authorization#personal-access-tokens) whose holder is an owner or admin of the space. A project API token is not accepted on this endpoint, and a Personal access token has no scopes: the holder's role in the space is the whole authorization decision.

Reference: https://signalwire.com/docs/apis/rest/space/billing/get-billing-statement

## Authentication

- `Authorization` header (basic auth, required) — Personal access token authentication for space-wide administration. Send HTTP Basic auth with an empty username and the Personal access token as the password. A Personal access token carries your own authority rather than a project's: it is created from your user menu in the Dashboard, is prefixed `pat_`, and has no scopes. The holder must be an owner or admin of the space named by the subdomain, and the token acts only on that space. Example: ``` Authorization: Basic base64(:pat_...) ```

## Request

### Query parameters

- `month` (string, required) — The calendar month, as `YYYY-MM`. A month before the space existed is rejected with `month_precedes_space_creation`, and a future month with `month_is_in_the_future`.
- `kind` (list of string, optional) — Return only these usage kinds in `usage_by_kind` and in each project's breakdown. Repeat the parameter for each kind.
- `project` (list of string, optional) — Restrict the per-project breakdown to these project ids. Repeat the parameter for each project.

## Response

### 200

The request has succeeded.

- `type` (enum, required) — The object type. Always `billing_statement`.
  - Allowed values: `billing_statement`
- `month` (string, required) — The calendar month the statement covers, as `YYYY-MM`.
- `summary` (object, required) — The totals for the month.
  - `usage_in_microdollars` (long, required) — Usage charges in microdollars.
  - `usage_in_dollars` (double, required) — Usage charges in US dollars.
  - `carrier_fees_in_microdollars` (long, required) — Carrier fees in microdollars.
  - `carrier_fees_in_dollars` (double, required) — Carrier fees in US dollars.
  - `taxes_in_microdollars` (long, required) — Taxes in microdollars.
  - `taxes_in_dollars` (double, required) — Taxes in US dollars.
  - `adjustments` (list of object, required) — The balance adjustments recorded in the month, one entry per adjustment kind.
    - `kind` (string, required) — A stable code for the kind of usage or adjustment.
    - `description` (string, required) — A description of the kind.
    - `amount_in_microdollars` (long, required) — The amount in microdollars.
    - `amount_in_dollars` (double, required) — The same amount in US dollars.
- `usage_by_kind` (list of object, required) — Company-wide usage broken down by kind.
  - `kind` (string, required) — A stable code for the kind of usage or adjustment.
  - `description` (string, required) — A description of the kind.
  - `amount_in_microdollars` (long, required) — The amount in microdollars.
  - `amount_in_dollars` (double, required) — The same amount in US dollars.
- `projects` (list of object, required) — Usage per project, each with its own breakdown by kind.
  - `id` (string, required) — The unique identifier of the project.
  - `name` (string, required, nullable) — The name of the project. Can be `null`.
  - `amount_in_microdollars` (long, required) — The project's total in microdollars.
  - `amount_in_dollars` (double, required) — The same total in US dollars.
  - `usage_by_kind` (list of object, required) — The project's usage broken down by kind.
    - `kind` (string, required) — A stable code for the kind of usage or adjustment.
    - `description` (string, required) — A description of the kind.
    - `amount_in_microdollars` (long, required) — The amount in microdollars.
    - `amount_in_dollars` (double, required) — The same amount in US dollars.

## Errors

### 401 Unauthorized Error

The credential is missing, unknown, or revoked; its holder is not a member of the space in the subdomain; the member is not an owner or admin; or billing for this space is not managed in the space itself, which is the case for a space purchased through a cloud marketplace and for a suspended or deactivated space. A space deactivated for nonpayment keeps the billing endpoints so that its outstanding balance can be settled. The body is the plain text `Unauthorized`. An unverified space instead receives the JSON body `{"message": "Please validate a phone number to access your account."}` on every endpoint under `/api/space`.

- `message` (string, required) — States that a phone number must be validated for the space before it can use the API.

### 422 Unprocessable Entity Error

`month` is not formatted `YYYY-MM` (`invalid_month`), is before the month the space was created (`month_precedes_space_creation`), or is after the current month (`month_is_in_the_future`).

- `errors` (list of object, required) — List of validation errors.
  - `type` (string, required) — The category of error.
  - `code` (string, required) — A specific error code.
  - `message` (string, required) — A description of what caused the error.
  - `url` (string, required) — A link to documentation about this error.
  - `attribute` (string, optional, nullable) — The request parameter that caused the error, if applicable.

### 500 Internal Server Error

An internal server error occurred.

- `error` (enum, required)
  - Allowed values: `Internal Server Error`

### 502 Bad Gateway Error

An upstream billing or usage reporting service was unavailable. The body is empty; retry later.

- `any`

## Examples

**Response**

```json
{
  "type": "billing_statement",
  "month": "2026-07",
  "summary": {
    "usage_in_microdollars": 4820000,
    "usage_in_dollars": 4.82,
    "carrier_fees_in_microdollars": 120000,
    "carrier_fees_in_dollars": 0.12,
    "taxes_in_microdollars": 0,
    "taxes_in_dollars": 0,
    "adjustments": [
      {
        "kind": "pstn_outbound",
        "description": "Outbound Voice Minutes",
        "amount_in_microdollars": 4820000,
        "amount_in_dollars": 4.82
      }
    ]
  },
  "usage_by_kind": [
    {
      "kind": "pstn_outbound",
      "description": "Outbound Voice Minutes",
      "amount_in_microdollars": 4820000,
      "amount_in_dollars": 4.82
    }
  ],
  "projects": [
    {
      "id": "4d5e6f70-8192-4a3b-8c4d-5e6f70819234",
      "name": "Root Project",
      "amount_in_microdollars": 4820000,
      "amount_in_dollars": 4.82,
      "usage_by_kind": [
        {
          "kind": "pstn_outbound",
          "description": "Outbound Voice Minutes",
          "amount_in_microdollars": 4820000,
          "amount_in_dollars": 4.82
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/space/billing_statement"

querystring = {"month":"month"}

response = requests.get(url, params=querystring, auth=("<username>", "<personal_access_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/space/billing_statement?month=month';
const credentials = btoa("<username>:<personal_access_token>");

const options = {
  method: 'GET',
  headers: {Authorization: `Basic ${credentials}`}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{your_space_name}.signalwire.com/api/space/billing_statement?month=month"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<personal_access_token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{your_space_name}.signalwire.com/api/space/billing_statement?month=month")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<personal_access_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{your_space_name}.signalwire.com/api/space/billing_statement?month=month")
  .basicAuth("<username>", "<personal_access_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/space/billing_statement?month=month', [
  'headers' => [
  ],
    'auth' => ['<username>', '<personal_access_token>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/space/billing_statement?month=month");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<personal_access_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<personal_access_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/space/billing_statement?month=month")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```