---
title: "Billing API"
description: "Balance and transaction history"
canonical_url: https://reelmirror.com/docs/api/billing
markdown_url: https://reelmirror.com/docs/api/billing.md
last_updated: 2026-11-09
---
# ReelMirror API reference: Billing

> Balance and transaction history

The ReelMirror API is in beta. Base URL: `https://reelmirror.com/api` (every path starts with `/v1`). Authenticate every request with `Authorization: Bearer rm_...`. Machine-readable contract: https://reelmirror.com/docs/openapi.json.

## Endpoints

- [Get balance](https://reelmirror.com/docs/api/billing#get-balance): `GET /v1/billing/balance`
- [Update auto-reload settings](https://reelmirror.com/docs/api/billing#update-auto-reload): `PATCH /v1/billing/balance`
- [Create top-up checkout session](https://reelmirror.com/docs/api/billing#create-topup): `POST /v1/billing/topup`
- [List transactions](https://reelmirror.com/docs/api/billing#list-transactions): `GET /v1/billing/transactions`
- [Create SetupIntent for headless card attachment](https://reelmirror.com/docs/api/billing#post-v1-billing-setup-intent): `POST /v1/billing/setup-intent`

### Get balance

`GET /v1/billing/balance`

Authentication: bearer token · Operation ID: `getBalance`

#### Response 200

Current balance and auto-reload settings

Fields inside `data`:

- `balance_cents` (integer; optional)
- `balance_dollars` (string; optional)
- `auto_reload` (boolean; optional)
- `reload_threshold_cents` (integer | null; optional)
- `reload_amount_cents` (integer | null; optional)

#### Example request

```bash
curl "https://reelmirror.com/api/v1/billing/balance" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Update auto-reload settings

`PATCH /v1/billing/balance`

Scope: `billing:write` · Operation ID: `updateAutoReload`

Configure auto-reload settings. Requires `billing:write` scope.

If `auto_reload: true` is requested and no payment method is saved, a Stripe Checkout setup session is returned (`setup_url`) so the user can add a card — `auto_reload` is **not** saved as `true` in this case.

#### Request body (application/json, required)

- `auto_reload` (boolean; optional): Enable or disable automatic balance reload
- `reload_threshold_cents` (integer, 0–5000; optional): Balance level (in cents) that triggers an auto-reload. Min 0, max 5000.
- `reload_amount_cents` (integer, 100–5000; optional): Amount (in cents) to reload when the threshold is hit. Min 100 ($1), max 5000 ($50).

#### Response 200

Updated balance settings, or a Stripe setup URL when no payment method is on file

- One of:
  - **Option 1**
    - `data` (object; optional)
      - `balance_cents` (integer; optional)
      - `balance_dollars` (string; optional)
      - `auto_reload` (boolean; optional)
      - `reload_threshold_cents` (integer | null; optional)
      - `reload_amount_cents` (integer | null; optional)
  - **Option 2**
    - `auto_reload` (boolean, one of `false`; required)
    - `setup_url` (string; required): Stripe Checkout URL to save a payment method

Errors: `400` return the standard error envelope.

#### Example request

```bash
curl -X PATCH "https://reelmirror.com/api/v1/billing/balance" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Create top-up checkout session

`POST /v1/billing/topup`

Scope: `billing:write` · Operation ID: `createTopup`

Create a Stripe Checkout session to add credits to your balance. Requires `billing:write` scope.

#### Request body (application/json, required)

- `amount_cents` (integer; required): Amount in cents to top up. Must be one of the supported values.

#### Response 200

Stripe Checkout URL to complete payment

Fields inside `data`:

- `url` (string; required): Stripe Checkout URL

Errors: `400` return the standard error envelope.

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/billing/topup" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount_cents": 1
}'
```

### List transactions

`GET /v1/billing/transactions`

Authentication: bearer token · Operation ID: `listTransactions`

#### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer, ≤ 100, default 20 | No | Maximum number of results to return |
| `offset` | integer, default 0 | No | Number of results to skip |

#### Response 200

Transaction history

- `data` (array of object; optional)
  - `id` (string, uuid; optional)
  - `amount_cents` (integer; optional)
  - `operation_type` (string; optional)
  - `description` (string; optional)
  - `created_at` (string, date-time; optional)
  - `generated_post_id` (string | null, uuid; optional)
  - `generated_media_item_id` (string | null, uuid; optional)
  - `refund_of_id` (string | null, uuid; optional)
- `count` (integer; optional)

#### Example request

```bash
curl "https://reelmirror.com/api/v1/billing/transactions" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY"
```

### Create SetupIntent for headless card attachment

`POST /v1/billing/setup-intent`

Scope: `billing:write` · Operation ID: `post-/v1/billing/setup-intent`

Creates a Stripe SetupIntent so an agent can attach a payment method headlessly using the Stripe SDK (no browser redirect required). After the SetupIntent is confirmed, Stripe fires `setup_intent.succeeded` and the server automatically grants the **$5 welcome bonus** if none has been issued yet.

Required scope: `billing:write`.

#### Request body (application/json)

- object

#### Response 200

SetupIntent created

Fields inside `data`:

- `client_secret` (string; optional): Stripe SetupIntent client secret (format: `seti_xxx_secret_xxx`). Pass to `stripe.confirmCardSetup()` or the server-side Stripe SDK to complete card attachment.

Errors: `401`, `403` return the standard error envelope.

#### Example request

```bash
curl -X POST "https://reelmirror.com/api/v1/billing/setup-intent" \
  -H "Authorization: Bearer $REELMIRROR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

