> 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.

# List payment history

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

Lists the balance adjustments recorded for the space: top-ups, auto top-ups, and
credits or debits applied by SignalWire. Narrow the range with `created_after` and
`created_before`. Results are paged; follow the `links.next` URL for the next page,
which carries the filters and the `page_token` for you.

#### 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/list-payment-history

## 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

- `created_after` (string, optional) — Return only adjustments recorded after this date (`YYYY-MM-DD`) or ISO 8601 timestamp.
- `created_before` (string, optional) — Return only adjustments recorded before this date (`YYYY-MM-DD`) or ISO 8601 timestamp.
- `page_size` (integer, optional, default: 50) — The number of results per page.
- `page_number` (integer, optional, default: 0) — The page index. Any value above 0 also requires `page_token`.
- `page_token` (string, optional) — The cursor for any page after the first, taken from the `links.next` URL of the previous response.

## Response

### 200

The request has succeeded.

- `links` (object, required) — Pagination links for the list. The `created_after` and `created_before` filters are preserved in each link.
  - `self` (string, required) — The link to the current page.
  - `first` (string, required) — The link to the first page.
  - `next` (string, optional) — The link to the next page. Only present when more results exist.
  - `prev` (string, optional) — The link to the previous page. Only present when a previous page exists.
- `data` (list of object, required) — The balance adjustments on this page.
  - `type` (enum, required) — The object type. Always `balance_adjustment`.
    - Allowed values: `balance_adjustment`
  - `id` (string, required) — The unique identifier of the adjustment.
  - `kind` (string, required) — The kind of adjustment, for example `balance_top_up`, `auto_balance_top_up`, `balance_credit_by_signalwire`, `balance_debit_by_signalwire`, `coupon_code_credit`, or `sign_up_free_credit`.
  - `amount_in_microdollars` (long, required) — The signed amount in microdollars. Credits and debits carry the sign they were recorded with.
  - `amount` (double, required) — The same amount in US dollars.
  - `created_at` (datetime, required) — The date and time when the adjustment was recorded.
  - `payment_method_last4` (string, required, nullable) — The last four digits of the card that was charged, or `null` when the adjustment was not charged to a card.

## 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

`page_number` is above 0 without a `page_token` (`page_token_required_for_next_page`), or the `page_token` is not one this endpoint issued (`page_token_is_invalid`); or `created_after` or `created_before` is not a date or timestamp.

- `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`

## Examples

**Response**

```json
{
  "links": {
    "self": "/api/space/members?page_number=0&page_size=50",
    "first": "/api/space/members?page_size=50",
    "next": "/api/space/members?page_number=1&page_size=50&page_token=PA9f8e7d6c-5b4a-4321-8765-fedcba987654",
    "prev": "/api/space/members?page_number=0&page_size=50&page_token=PA9f8e7d6c-5b4a-4321-8765-fedcba987654"
  },
  "data": [
    {
      "type": "balance_adjustment",
      "id": "6f708192-a3b4-4c5d-9e6f-708192a3b4c5",
      "kind": "balance_top_up",
      "amount_in_microdollars": 25000000,
      "amount": 25,
      "created_at": "2026-08-20T14:19:00Z",
      "payment_method_last4": "4242"
    }
  ]
}
```

**SDK Code**

```python
import requests

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

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

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/space/payment_history';
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/payment_history"

	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/payment_history")

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/payment_history")
  .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/payment_history', [
  '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/payment_history");
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/payment_history")! 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()
```