> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cedarai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Revenue Reporting API

> Pull your railroad's nightly accounting reports — Waybill Extract, Freight Billing, Daily Settlements, Funds Transfers and Interchanges — as JSON, for any range of reporting days.

The Revenue Reporting API returns the same rows as the nightly accounting files Cedar delivers to your SFTP folder, as JSON you can request on demand. Ask for any range of reporting days, filter by car or waybill, and page through the results.

> [!NOTE]
>
> The rows for a day are the rows of that day's file, in the same order. Only the formatting differs: real dates and times instead of fixed-width text, dollar amounts instead of cents, and spelled-out values instead of codes. Each row also carries fields the files do not have, such as CIF numbers, addresses, SPLC/FSAC codes and commodity names.

## Endpoints

| Endpoint | Returns | The date range filters on |
| - | - | - |
| `GET /revenue/reporting/waybill-extract` | Revenue ledger transactions: ratings, estimates, adjustments, overcharges, write-offs, and deletions of transactions sent earlier | The transaction date |
| `GET /revenue/reporting/freight-billing` | Finalized freight bills, invoice voids, credit memos and credit memo voids | The billing date |
| `GET /revenue/reporting/daily-settlements` | Funds-transfer lines from the Railinc Daily Settlement Reports | The settlement report date |
| `GET /revenue/reporting/funds-transfers` | The same funds-transfer lines, selected by the month the funds move | The transfer month |
| `GET /revenue/reporting/interchanges` | Cars received from, or delivered to, a connecting railroad | The interchange event date |

The base URL is `https://api-lg-k.arms.cedarai.com`.

## Authentication

Send the same headers as every Cedar API, plus `Carrier`:

| Header | Value |
| - | - |
| `x-arms-api-key` | Your API key. See [Getting an API key](https://docs.cedarai.com/user-docs/api-reference/introduction.md#getting-an-api-key). |
| `x-arms-assume-user` | The email of the Cedar user the key acts as. |
| `Carrier` | The railroad whose reports you want, by mark — for example `WTNN` or `TKEN`. |

The user in `x-arms-assume-user` needs the **`revenueReporting.api`** role on that railroad.⁠‌​‌‌‌​​‌‌​‌​​‌​​​‌​​‌‌​‌⁠ One key can read several railroads if its user has the role on each.

## Choosing days

Every endpoint except `funds-transfers` takes the same required parameters:

* `startDate` and `endDate` — `YYYY-MM-DD`, both inclusive, in the railroad's local time zone. For one day, send the same date twice.
* The range can be as long as you like. Long ranges come back over several pages; see [Paging](#paging).

`funds-transfers` takes `month` instead, as `YYYY-MM` (for example `2026-10`), because Railinc settles interline revenue monthly. It returns every funds transfer whose transfer date falls in that month, read from the Daily Settlement Reports. Each row keeps the day it settled, and a month's transfers are there before Railinc's month-end notification arrives. When Railinc sends a revised report, its lines replace the ones it revises, so a transfer is listed once. These are the transfers of that month's Funds Transfer Monthly file; the two differ only when Cedar is missing one of the daily reports or the notification. `daily-settlements` is a record of each night's reports, so it lists both the original and the revised report.

The nightly Daily Interchanges file covers the 7 days before its run date. The `interchanges` endpoint returns exactly the days you ask for, so to reproduce a night's file, ask for the 7 days before that night.

> [!TIP]
>
> Data for a day that has not ended yet is incomplete. Pull up to yesterday.

## Filters

Every endpoint accepts the same optional filters, which match the car and waybill on each row:

* `equipmentInitial` and `equipmentNumber` — one car. Send both or neither.
* `waybillNumber`
* `waybillDate` — `YYYY-MM-DD`.

Leading zeros and letter case are ignored.⁠‌​‌‌‌​​‌‌​‌​​‌​​​‌​​‌‌​‌⁠ Filters combine: a row must match every filter you send.

## Paging

* `pageSize` — rows per page. Defaults to 500; the most is 1000.
* When more rows remain, the response has a `nextPageToken`. Send it back as `pageToken`, with the same dates and filters, to get the next page. When the response has no `nextPageToken`, you have every row.
* Each page covers at most 31 reporting days. Over a long range, a page can have fewer rows than `pageSize`, or none, and still have a `nextPageToken`. Keep following the token until it is gone.

A token only works with the dates and filters it was issued for. If the underlying data changes between pages, a row can move between pages.

## Example

```bash theme={null}
curl \
  -H "x-arms-api-key: $CEDAR_API_KEY" \
  -H "x-arms-assume-user: integrations@yourrailroad.example" \
  -H "Carrier: WTNN" \
  "https://api-lg-k.arms.cedarai.com/revenue/reporting/waybill-extract?startDate=2026-11-01&endDate=2026-11-04&pageSize=2"
```

```json theme={null}
{
  "rows": [
    {
      "reportDate": "2026-11-01",
      "transaction": {
        "id": "a3f1c9e2-5b7d-4e0a-9c11-2f6d8b4e7a10",
        "type": "RATING_APPLIED",
        "at": "2026-11-01T09:14:52-05:00"
      },
      "urrwin": { "number": "88812", "version": 1, "reratedWithoutResubmission": false },
      "waybill": { "number": "4512", "date": "2026-10-30" },
      "equipment": { "initial": "TILX", "number": "123456" },
      "numberOfCars": "1",
      "netWeightLbs": "198400",
      "commodity": { "stcc": "2821125", "name": "POLYETHYLENE RESIN" },
      "priceAuthority": "4500",
      "methodOfPayment": "PREPAID",
      "origin": { "station": "MOBILE", "state": "AL", "splc": "740160", "fsac": "61234", "carrier": "WTNN" },
      "rule11Origin": false,
      "destination": { "station": "CHICAGO", "state": "IL", "splc": "380000", "fsac": "18820", "carrier": "CN" },
      "shipper": {
        "cif": "123456789",
        "name": "ACME CHEMICAL CO",
        "accountNumber": "1043",
        "address": { "lines": ["100 INDUSTRIAL PKWY"], "city": "MOBILE", "state": "AL" }
      },
      "revenueDate": "2026-10-31",
      "freight": { "amount": "2450.00", "currency": "USD" },
      "prepaid": { "amount": "2450.00", "currency": "USD" },
      "ourProportion": { "amount": "1225.00", "currency": "USD" }
    }
  ],
  "nextPageToken": "MjAyNi0xMS0wMXwyfDNhNGY"
}
```

## How values are written

* **Field names** are camelCase, in responses and in query parameters (`reportDate`, `startDate`). Query parameters also accept snake\_case (`start_date`).
* **Dates** are `YYYY-MM-DD`. **Times** are RFC 3339 with the railroad's UTC offset, for example `2026-11-01T09:14:52-05:00`.
* **Money** is an object with a decimal string `amount` (`"1225.00"`) and a `currency`.
* **64-bit numbers**, such as `numberOfCars` and `netWeightLbs`, are JSON strings, as is standard for these APIs.
* **Parties** (shipper, consignee, freight-bill party, bill-to) are identified by their Railinc **CIF** with its 4-character location suffix (13 characters, such as `0529862500000`), with the address as billed on the waybill. `accountNumber` is your own account number for the customer, from its Cedar customer location.
* **Stations** carry the station name, state, **SPLC**, **FSAC** (five digits) and the railroad serving them on that move. These come from the industry station master rather than the waybill, which often leaves the SPLC blank.
* **`settlementStatus`** is the URRWIN's status as of the end of the row's `reportDate`, from the last settlement message Railinc sent before then. Pulling a past day again gives the status it had that day, not today's.
* **The car** on a Waybill Extract row is the one recorded on the transaction when it was made, so it stays the same if the shipment later moves to another car.
* A text, number or true/false field Cedar has no value for is sent empty: `""`, `0` or `false`. For example, a local move has no URRWIN, so `urrwin.number` is `""` and `urrwin.version` is `0`. A list with no entries is `[]`. A party Cedar has nothing for, and `settlementStatus` on a row that has not settled, are left out.

### File columns and API fields

| Waybill Extract column | API field |
| - | - |
| Initial, Number | `equipment.initial`, `equipment.number` |
| Waybill Number, Waybill Date | `waybill.number`, `waybill.date` |
| Freight, Prepaid, Our Proportion | `freight`, `prepaid`, `ourProportion` (dollars, not cents) |
| Origin / Destination Station, State, Road | `origin` / `destination` `.station`, `.state`, `.carrier` |
| Shipper, Shipper Name | `shipper.accountNumber`, `shipper.name` |
| Consignee, Consignee Name | `consignee.accountNumber`, `consignee.name` |
| STCC | `commodity.stcc` |
| Method of Payment (`PP`, `CC`, `11`) | `methodOfPayment` (`PREPAID`, `COLLECT`, `RULE_11`) |
| URRWIN Number, URRWIN Version | `urrwin.number`, `urrwin.version`; version `999` in the file is `urrwin.reratedWithoutResubmission: true` |
| Settlement Type (`ST`, `SS`, …) | `settlementStatus` (`SETTLEMENT_FULLY_CONCURRED`, `SETTLED_SILENT_ROAD_ON_SILENT_CONCURRENCE`, …) |
| Transaction ID, Transaction Type, Transaction Date | `transaction.id`, `transaction.type`, `transaction.at` |

The other reports follow the same pattern; each endpoint's reference page lists every field.

### Deletions in the Waybill Extract

A `TRANSACTION_DELETED` or `TRANSACTION_UNDELETED` row appears only for a transaction that was sent to you in an earlier day's rows, the same rule the file follows.⁠‌​‌‌‌​​‌‌​‌​​‌​​​‌​​‌‌​‌⁠ It carries the deleted transaction's id and fields, with `transaction.at` set to when it was deleted and `transaction.originalAt` to when the transaction was made.

## Errors

An error comes back with an HTTP status and a JSON body that says what was wrong:

```json theme={null}
{ "code": 3, "message": "endDate 2026-09-01 is before startDate 2026-09-30", "details": [] }
```

| Status | Meaning |
| - | - |
| `400` | A date is missing or malformed, `endDate` is before `startDate`, `month` or `waybillDate` is malformed, only one of `equipmentInitial` / `equipmentNumber` was sent, `pageToken` does not match the request, or the `Carrier` is not a railroad. |
| `401` / `403` | The key, the assumed user or the `Carrier` is wrong, or the user lacks the `revenueReporting.api` role on that railroad. See [Troubleshooting](https://docs.cedarai.com/user-docs/api-reference/introduction.md#troubleshooting-401-unauthorized). |
| `429` | More than 5 requests are running at once for this key on the same endpoint. Retry after a short backoff. |
| `503` | The data is temporarily unavailable (interchanges). Retry the request. |

## Related pages

* [API introduction](https://docs.cedarai.com/user-docs/api-reference/introduction.md): API keys, assumed users and access roles
* [API access roles](https://docs.cedarai.com/user-docs/api-reference/introduction.md#api-access-roles): the `revenueReporting.api` role and the other API roles


## Related topics

- [API Introduction](https://docs.cedarai.com/user-docs/api-reference/introduction.md)
- [Daily Settlements](https://docs.cedarai.com/api-reference/revenuereportingservice/daily-settlements.md)
- [Funds Transfers](https://docs.cedarai.com/api-reference/revenuereportingservice/funds-transfers.md)
- [Interchanges](https://docs.cedarai.com/api-reference/revenuereportingservice/interchanges.md)
- [Waybill Extract](https://docs.cedarai.com/api-reference/revenuereportingservice/waybill-extract.md)
