> This page is for API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.spreadspace.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.spreadspace.app/_mcp/server.

# List all AR agings

GET https://api.spreadspace.app/api/borrowers/{borrower_id}/extractions/ar-agings

Lists every usable AR aging on the borrower's file. Pass `form=summary` or `form=detail` to keep one form, and `loan_id` to narrow the list to one loan. Duplicates and failed extractions are left out.

Requires the `extractions:read` scope. Rate limit: 200 requests per minute per key (the `api` lane).

Reference: https://docs.spreadspace.app/api/api-reference/ar-agings/get-ar-agings

## Authentication

- `Authorization` header (bearer token, required) — Bearer token. Use `ss_live_…` for live data or `ss_test_…` for the sandbox (test mode). See [Authentication](https://docs.spreadspace.app/api/authentication).

## Request

### Path parameters

- `borrower_id` (string, required) — The borrower's id.

### Query parameters

- `loan_id` (string, optional) — Narrow the list to one loan.
- `form` (enum, optional) — Keep one form: `summary` or `detail`.
  - Allowed values: `summary`, `detail`

### Headers

- `SpreadSpace-Version` (string, optional) — Pin the API version, e.g. `2026-10-07`. Omit to get the latest. See [Versioning](https://docs.spreadspace.app/api/versioning).

## Response

### 200

OK

- `borrower_id` (string, required) — The borrower the documents belong to.
- `agings` (list of ArAgingReportDataListItem, required) — One row per document.

## Errors

### 400 Bad Request Error

Bad request: validation failed, the cursor is malformed, or the API version is unknown.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 401 Unauthorized Error

Unauthorized: the bearer token or API key is missing or invalid.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 402 Payment Required Error

Payment required: the standard error envelope with `type` `subscription_required` when the workspace has no active or trialing subscription, or `billing_required` where a plan entitlement applies.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 403 Forbidden Error

Forbidden: authentication succeeded but the caller is not permitted to perform this action, for example an API key missing the required scope, an embed session reaching a loan it was not minted for, or a feature outside the workspace's plan.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 404 Not Found Error

Not found: the resource does not exist or is not visible to the calling tenant.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 429 Too Many Requests Error

Too many requests: the rate limit was hit, or an idempotency-key replay is still in progress.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

### 500 Internal Server Error

Internal server error: an unexpected failure. Quote the `request_id` in support tickets. A mutation sent with an `Idempotency-Key` replays this fault under that key rather than re-running; confirm the resource state before resending with a new key.

- `error` (ApiErrorBody, required) — Inner body of the canonical API error envelope.

## Types

### ArAgingReportDataListItem

One row of the Accounts Receivable Aging list: the document's identity and its extracted object.

- `extracted_document_id` (string, required) — Identifier of the extracted document.
- `document_category` (string, required) — The document category the extraction is stored under.
- `report_data` (ArAgingReportData, required) — The extracted object, in the family's shape.

### ApiErrorBody

Inner body of the canonical API error envelope.

- `type` (string, required) — Stable error type identifier. Pattern-match on this value, not the human-readable message.
- `message` (string, required) — Human-readable error message. Subject to wording changes; do not parse.
- `request_id` (string, optional, nullable) — Per-request correlation ID (matches `X-Request-ID` response header). Quote in support tickets.
- `details` (map from string to string, optional, nullable) — Structured detail. Some error types populate documented keys in every environment: a version conflict (409) carries `current_version`, the version the resource is actually at, so the client can reload and re-apply. Free-form diagnostic detail beyond those keys appears in development environments only. An `insufficient_credits` 402 carries `balance_usd`, `reserved_usd`, `in_flight_docs`, `incoming_docs` and `per_doc_reservation_usd` as decimal strings.

### ArAgingReportData

An accounts receivable aging: a summary by customer, or a detail by open invoice. The report_subtype key says which. Money is a decimal string with two decimals, in dollars.

- `report_subtype`: `summary` (Summary)
  - `anomalies` (list of string, required) — Irregularities noted on the report, in words.
  - `as_of_date` (string, required, nullable) — The aging date.
  - `company_name` (string, required, nullable) — The reporting company as printed.
  - `currency` (string, required) — Currency code; USD.
  - `customers` (list of ArAgingReportData_AgingCustomerRow, required) — One entry per counterparty.
  - `document_type` ("ar_aging", required) — Which family of document this is.
  - `grand_totals` (ArAgingReportData_AgingGrandTotals, required) — The printed grand totals.
  - `bucket_columns` (list of ArAgingReportData_AgingBucketColumn, optional, nullable) — The aging columns as the report prints them, in print order.
  - `computed_totals` (ArAgingReportData_AgingSummaryComputedTotals, optional) — The counterparty rows added together, column by column, beside the printed totals.
  - `entity_source` (string, optional) — What names the company when the report heading does not: the page image (`page_image`); absent when the heading names it.
  - `entity_source_sheet` (string, optional) — The sheet of the uploaded workbook that names the company, when this aging's own sheet does not and the workbook names exactly one company; absent otherwise.
  - `formula_census` (ArAgingReportData_AgingFormulaCensus, optional, nullable) — On a spreadsheet aging whose printed total covers only some of its rows, how many rows it covers; null otherwise.
  - `period_source` (string, optional) — Which part of the document dates the report when its printed as-of line states no date: the page image (`page_image`), the file's name (`filename`) or the file's own creation date (`file_metadata`); absent when the as-of line dates the report.
  - `signals` (list of ArAgingReportData_AgingSignal, optional) — Notes about the aging date, when any.
  - `status` (enum, optional) — `RECONCILED` when the printed grand totals equal the rows added together; `FLAGGED` otherwise.
    - Allowed values: `RECONCILED`, `FLAGGED`
- `report_subtype`: `detail` (Detail)
  - `anomalies` (list of string, required) — Irregularities noted on the report, in words.
  - `as_of_date` (string, required, nullable) — The aging date.
  - `company_name` (string, required, nullable) — The reporting company as printed.
  - `computed_totals` (ArAgingReportData_AgingDetailComputedTotals, required) — The transaction rows added together.
  - `currency` (string, required) — Currency code; USD.
  - `customer_subtotals` (list of ArAgingReportData_AgingCustomerSubtotal, required) — One entry per counterparty.
  - `document_type` ("ar_aging", required) — Which family of document this is.
  - `grand_totals` (ArAgingReportData_AgingGrandTotals, required) — The printed grand totals.
  - `status` (enum, required) — `RECONCILED` when the printed grand total equals the rows added together; `FLAGGED` otherwise.
    - Allowed values: `RECONCILED`, `FLAGGED`
  - `transactions` (list of ArAgingReportData_AgingTransactionRow, required) — One entry per open transaction.
  - `customers` (list of ArAgingReportData_AgingCustomerRow, optional) — Empty on a detail aging.
  - `entity_source` (string, optional) — What names the company when the report heading does not: the page image (`page_image`); absent when the heading names it.
  - `entity_source_sheet` (string, optional) — The sheet of the uploaded workbook that names the company, when this aging's own sheet does not and the workbook names exactly one company; absent otherwise.
  - `period_source` (string, optional) — Which part of the document dates the report when its printed as-of line states no date: the page image (`page_image`), the file's name (`filename`) or the file's own creation date (`file_metadata`); absent when the as-of line dates the report.
  - `signals` (list of ArAgingReportData_AgingSignal, optional) — Notes about the aging date, when any.

### ArAgingReportData_AgingCustomerRow

One counterparty row of a summary aging: a customer on a receivables aging, a vendor on a payables aging. A column the report prints beyond the standard tiers appears under its own bucket_ key.

- `customer_name` (string, required, nullable) — The customer, or the vendor on a payables aging.
- `customer_no` (string, optional, nullable) — The counterparty's account number, when printed.
- `terms` (string, optional, nullable) — Payment terms, when printed.
- `status_flag` (string, optional, nullable) — A status mark printed on the row, when any.
- `status` (string, optional, nullable) — The status word printed on the row, when the report has a status column.
- `current` (string, optional, nullable) — Not yet due.
- `bucket_1_30` (string, optional, nullable) — 1 to 30 days past due.
- `bucket_31_60` (string, optional, nullable) — 31 to 60 days past due.
- `bucket_61_90` (string, optional, nullable) — 61 to 90 days past due.
- `bucket_91_plus` (string, optional, nullable) — 91 or more days past due.
- `retainage` (string, optional, nullable) — Retainage held, when the report has the column.
- `prepayments` (string, optional, nullable) — Prepayments on the row, when the report has the column. A credit, counted toward the total like retainage.
- `total` (string, optional, nullable) — The row's total.
- `is_intercompany` (boolean, optional) — True when the counterparty's name shares a distinctive word with the reporting company's name.

### ArAgingReportData_AgingGrandTotals

The report's own printed totals row. Each aged column the report prints beyond the standard five carries its own key.

- `current` (string, optional, nullable) — Printed total of the current column.
- `bucket_1_30` (string, optional, nullable) — Printed total of the 1 to 30 days column.
- `bucket_31_60` (string, optional, nullable) — Printed total of the 31 to 60 days column.
- `bucket_61_90` (string, optional, nullable) — Printed total of the 61 to 90 days column.
- `bucket_91_plus` (string, optional, nullable) — Printed total of the over 90 days column.
- `retainage` (string, optional, nullable) — Printed total of the retainage column.
- `prepayments` (string, optional, nullable) — Printed total of the prepayments column.
- `grand_total` (string, optional, nullable) — The printed grand total.

### ArAgingReportData_AgingBucketColumn

One aged column as the report prints it.

- `key` (string, required) — The key the column's figures carry on each row, for example bucket_91_plus.
- `label` (string, required) — The column heading as printed.

### ArAgingReportData_AgingSummaryComputedTotals

Column sums over the report's rows, kept apart from the printed totals. Each aged column has a matching key ending in _sum.

- `total_sum` (string, required) — The rows' total, stated beside the printed grand total for comparison.
- `current_sum` (string, optional) — The rows' current total, stated beside the printed total for comparison.
- `bucket_1_30_sum` (string, optional) — The rows' 1 to 30 days total, stated beside the printed total for comparison.
- `bucket_31_60_sum` (string, optional) — The rows' 31 to 60 days total, stated beside the printed total for comparison.
- `bucket_61_90_sum` (string, optional) — The rows' 61 to 90 days total, stated beside the printed total for comparison.
- `bucket_91_plus_sum` (string, optional) — The rows' over 90 days total, stated beside the printed total for comparison.
- `retainage_sum` (string, optional) — The rows' retainage total, stated beside the printed total for comparison.
- `prepayments_sum` (string, optional) — The rows' prepayments total, stated beside the printed total for comparison.

### ArAgingReportData_AgingFormulaCensus

Present when the report is a workbook whose printed total is a cell the workbook computes itself from only some of its rows, rather than a typed value: how many rows that total covers, how many it leaves out, and what those left out add up to, so the rows and the printed total can be read together.

- `foots` (boolean, required) — Whether the rows the printed total covers add up to it.
- `rows_in_total` (integer, required) — Number of rows the printed total covers.
- `rows_outside_total` (integer, required) — Number of rows the printed total leaves out.
- `outside_sum` (string, required) — The total column of the rows the printed total leaves out, added together.

### ArAgingReportData_AgingSignal

A note about the report's as-of date.

- `severity` (enum, required) — How much weight the note carries: info or warn.
  - Allowed values: `info`, `warn`
- `code` (enum, required) — The note's identifier.
  - Allowed values: `coverage_unreadable`, `no_reporting_period`, `year_from_file_metadata`, `year_from_filename`, `year_from_page_image`, `year_matches_print_stamp`
- `detail` (string, required) — The note in words.

### ArAgingReportData_AgingDetailComputedTotals

Sums over the open items in the report, kept apart from the printed totals.

- `balance_due_sum` (string, required) — The rows' balance due total, stated beside the printed total for comparison.
- `n_transactions` (integer, required) — Number of open items in the report.

### ArAgingReportData_AgingCustomerSubtotal

One counterparty's subtotal on a detail aging.

- `customer_name` (string, required) — The customer, or the vendor on a payables aging.
- `subtotal` (string, required) — Total balance due across the counterparty's transactions.
- `is_intercompany` (boolean, optional) — True when the counterparty's name shares a distinctive word with the reporting company's name.

### ArAgingReportData_AgingTransactionRow

One open transaction on a detail aging.

- `customer_name` (string, required, nullable) — The customer, or the vendor on a payables aging.
- `transaction_type` (string, required, nullable) — The transaction's kind as printed: invoice, credit, payment.
- `transaction_number` (string, required, nullable) — The transaction's number as printed.
- `transaction_date` (string, required, nullable) — The transaction date as printed.
- `due_date` (string, required, nullable) — The due date as printed.
- `po_number` (string, required, nullable) — Purchase order number, when printed.
- `age_days` (integer, required, nullable) — Days past the transaction or due date at the aging date, as printed.
- `amount` (string, required, nullable) — The transaction's original amount.
- `balance_due` (string, required, nullable) — The open balance.
- `bucket` (enum, optional) — The aging column the row sits under, as the column's key: `current`, `bucket_1_30`, `bucket_31_60`, `bucket_61_90` or `bucket_91_plus`; null when the report prints no aging sections.
  - Allowed values: `current`, `bucket_1_30`, `bucket_31_60`, `bucket_61_90`, `bucket_91_plus`

## Examples

**Response**

```json
{
  "borrower_id": "3f9c2b1e8d7a4c5b9e0f1a2b",
  "agings": [
    {
      "extracted_document_id": "7a1d4e9c2b3f4a5d8e6c1b0f",
      "document_category": "accounts_receivable_summary",
      "report_data": {
        "report_subtype": "summary",
        "anomalies": [],
        "as_of_date": "2024-12-31",
        "company_name": "Pinnacle Manufacturing LLC",
        "currency": "USD",
        "customers": [
          {
            "customer_name": "Apex Technologies Inc",
            "current": "11814.57",
            "bucket_1_30": "6906.02",
            "bucket_31_60": "0.00",
            "bucket_61_90": "0.00",
            "bucket_91_plus": "0.00",
            "total": "18720.59"
          },
          {
            "customer_name": "Blue Harbor Solutions",
            "current": "5217.75",
            "bucket_1_30": "5278.01",
            "bucket_31_60": "3633.43",
            "bucket_61_90": "0.00",
            "bucket_91_plus": "0.00",
            "total": "14129.19"
          },
          {
            "customer_name": "Crestview Partners LLC",
            "current": "10572.34",
            "bucket_1_30": "3927.25",
            "bucket_31_60": "810.35",
            "bucket_61_90": "0.00",
            "bucket_91_plus": "216.91",
            "total": "15526.85"
          },
          {
            "customer_name": "Delta Force Industries",
            "current": "10218.44",
            "bucket_1_30": "3411.07",
            "bucket_31_60": "3940.82",
            "bucket_61_90": "0.00",
            "bucket_91_plus": "0.00",
            "total": "17570.33"
          },
          {
            "customer_name": "EaglePoint Services",
            "current": "9366.93",
            "bucket_1_30": "0.00",
            "bucket_31_60": "4206.72",
            "bucket_61_90": "0.00",
            "bucket_91_plus": "0.00",
            "total": "13573.65"
          },
          {
            "customer_name": "Frontier Logistics Co",
            "current": "9557.74",
            "bucket_1_30": "0.00",
            "bucket_31_60": "0.00",
            "bucket_61_90": "1958.53",
            "bucket_91_plus": "0.00",
            "total": "11516.27"
          },
          {
            "customer_name": "Gateway Wholesale",
            "current": "13984.08",
            "bucket_1_30": "5594.64",
            "bucket_31_60": "3281.33",
            "bucket_61_90": "2210.77",
            "bucket_91_plus": "168.52",
            "total": "25239.34"
          },
          {
            "customer_name": "Highland Consulting Group",
            "current": "8818.96",
            "bucket_1_30": "0.00",
            "bucket_31_60": "0.00",
            "bucket_61_90": "1281.53",
            "bucket_91_plus": "0.00",
            "total": "10100.49"
          },
          {
            "customer_name": "Ironwood Manufacturing",
            "current": "13425.42",
            "bucket_1_30": "2105.48",
            "bucket_31_60": "2769.17",
            "bucket_61_90": "0.00",
            "bucket_91_plus": "0.00",
            "total": "18300.07"
          },
          {
            "customer_name": "Jupiter Digital Media",
            "current": "9665.56",
            "bucket_1_30": "0.00",
            "bucket_31_60": "4060.52",
            "bucket_61_90": "0.00",
            "bucket_91_plus": "0.00",
            "total": "13726.08"
          }
        ],
        "document_type": "ar_aging",
        "grand_totals": {
          "current": "102641.79",
          "bucket_1_30": "27222.47",
          "bucket_31_60": "22702.34",
          "bucket_61_90": "5450.83",
          "bucket_91_plus": "385.43",
          "grand_total": "158402.86"
        },
        "bucket_columns": [
          {
            "key": "current",
            "label": "Current"
          },
          {
            "key": "bucket_1_30",
            "label": "1-30 Days"
          },
          {
            "key": "bucket_31_60",
            "label": "31-60 Days"
          },
          {
            "key": "bucket_61_90",
            "label": "61-90 Days"
          },
          {
            "key": "bucket_91_plus",
            "label": "90+ Days"
          }
        ]
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.spreadspace.app/api/borrowers/3f9c2b1e8d7a4c5b9e0f1a2b/extractions/ar-agings"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.spreadspace.app/api/borrowers/3f9c2b1e8d7a4c5b9e0f1a2b/extractions/ar-agings';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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://api.spreadspace.app/api/borrowers/3f9c2b1e8d7a4c5b9e0f1a2b/extractions/ar-agings"

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

	req.Header.Add("Authorization", "Bearer <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://api.spreadspace.app/api/borrowers/3f9c2b1e8d7a4c5b9e0f1a2b/extractions/ar-agings")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <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://api.spreadspace.app/api/borrowers/3f9c2b1e8d7a4c5b9e0f1a2b/extractions/ar-agings")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.spreadspace.app/api/borrowers/3f9c2b1e8d7a4c5b9e0f1a2b/extractions/ar-agings', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.spreadspace.app/api/borrowers/3f9c2b1e8d7a4c5b9e0f1a2b/extractions/ar-agings");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.spreadspace.app/api/borrowers/3f9c2b1e8d7a4c5b9e0f1a2b/extractions/ar-agings")! 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()
```