# Earnings

> Read what your store earned, what is held and transferable, your payout account, your weekly transfers and any amounts owed.

Source: https://docs.b7r.app/earnings

Your store earns on each order it sells: B7R holds the earnings for a few days after delivery, then a weekly transfer sends them to your bank account. The reads below show what your wallet page shows, for a key holding `earnings:read`. A key reads only: the bank account, the weekly setting and the bank letter are changed in the app.

- While earnings transfers are not open for your account, the position, the account, the transfers and a transfer answer `{ "available": false }`. The position still adds `earnings` and `open_transfer` whenever your wallet page shows them: when you have a store, earnings or an open transfer.
- The amounts owed answer whether transfers are open or not: a debt is owed either way.
- No answer carries a name or a full account number: the IBAN and the bank reference show their last four characters only.
- Another account's transfer answers `404 not_found`, exactly like a transfer that does not exist.

## Read your earnings

`GET /v1/earnings`

Your earnings, what sits in a transfer prepared and still open (`open_transfer`), the part still held after delivery and when it is released, what a transfer would take now (the transferable earnings less what you keep in the wallet), the minimum below which no transfer is made, your weekly transfer setting and your bank letter.

While the position is not open for your account, the answer is `{ "available": false }`, with `earnings` and `open_transfer` (what sits in a transfer prepared and still open) whenever your wallet page shows them: when you have a store, earnings or an open transfer.

Key: A key with the `earnings:read` area.

Answer:



Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `try_again_later` (503). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/earnings \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/earnings", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/earnings",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "available": true,
  "earnings": {
    "amount": "820.50",
    "currency": "SAR"
  },
  "open_transfer": {
    "amount": "0.00",
    "currency": "SAR"
  },
  "held": {
    "amount": "120.00",
    "currency": "SAR"
  },
  "transferable_earnings": {
    "amount": "700.50",
    "currency": "SAR"
  },
  "transferable": {
    "amount": "650.50",
    "currency": "SAR"
  },
  "minimum": {
    "amount": "100.00",
    "currency": "SAR"
  },
  "hold_days": 7,
  "next_release_at": "2026-11-28T21:00:00.000Z",
  "weekly_transfers": {
    "enabled": true,
    "keep": {
      "amount": "50.00",
      "currency": "SAR"
    }
  },
  "bank_letter": {
    "state": "approved",
    "holder_type": "personal",
    "iban_last_four": "7519",
    "submitted_at": "2026-11-20T09:00:00.000Z",
    "reviewed_at": "2026-11-21T09:00:00.000Z",
    "reject_reason": null,
    "reject_note": null,
    "revoked_at": null,
    "revoke_reason": null,
    "revoke_note": null
  },
  "identity": {
    "personal": true,
    "business": false
  }
}
```

## Read your payout account

`GET /v1/earnings/bank-account`

The account your transfers go to: its last four digits, whether the residency statement is ticked, B7R's check of it and whether transfers are stopped until it is saved again in the app. `account` is `null` until one is saved.

Key: A key with the `earnings:read` area.

Answer:



Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `try_again_later` (503). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/earnings/bank-account \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/earnings/bank-account", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/earnings/bank-account",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "available": true,
  "account": {
    "iban_last_four": "7519",
    "residency_declared": true,
    "check": "checked",
    "blocked": false
  }
}
```

## List your transfers

`GET /v1/earnings/transfers`

Your weekly transfers, newest first, and the weeks skipped below the minimum: up to 100 a page (`limit`, default 50). Pass `next_cursor` back as `cursor` for the next page; it is `null` on the last.

Key: A key with the `earnings:read` area.

Query:

- `limit` (string)
- `cursor` (string): 1 to 256.

Answer:



Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `try_again_later` (503). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/earnings/transfers \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/earnings/transfers", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/earnings/transfers",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "available": true,
  "data": [
    {
      "id": "6d2f1c9e-4b7a-4f3e-9a51-2c8e7b0d4a13",
      "cycle_date": "2026-11-22",
      "amount": {
        "amount": "300.00",
        "currency": "SAR"
      },
      "status": "sent",
      "iban_last_four": "7519",
      "reference_last_four": "0987",
      "close_reason": null,
      "returned_on": null,
      "created_at": "2026-11-22T06:00:00.000Z",
      "prepared_at": "2026-11-22T06:00:00.000Z",
      "sent_at": "2026-11-23T10:30:00.000Z",
      "closed_at": null
    }
  ],
  "next_cursor": null
}
```

## Read a transfer and its statement

`GET /v1/earnings/transfers/{id}`

One transfer and the earnings movements it closed, oldest first: each order that earned, each charge (`charge_source` says what it was for) and the transfer itself, with the earnings carried in from the previous transfer (`opening`) and out of this one (`closing`). A skipped week has no statement: `404 not_found`.

Key: A key with the `earnings:read` area.

Path:

- `id` (string (uuid), required)

Answer:



Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `not_found` (404), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `try_again_later` (503). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/earnings/transfers/6d2f1c9e-4b7a-4f3e-9a51-2c8e7b0d4a13 \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/earnings/transfers/6d2f1c9e-4b7a-4f3e-9a51-2c8e7b0d4a13", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/earnings/transfers/6d2f1c9e-4b7a-4f3e-9a51-2c8e7b0d4a13",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "available": true,
  "transfer": {
    "id": "6d2f1c9e-4b7a-4f3e-9a51-2c8e7b0d4a13",
    "cycle_date": "2026-11-22",
    "amount": {
      "amount": "300.00",
      "currency": "SAR"
    },
    "status": "sent",
    "iban_last_four": "7519",
    "reference_last_four": "0987",
    "close_reason": null,
    "returned_on": null,
    "created_at": "2026-11-22T06:00:00.000Z",
    "prepared_at": "2026-11-22T06:00:00.000Z",
    "sent_at": "2026-11-23T10:30:00.000Z",
    "closed_at": null
  },
  "opening": {
    "amount": "0.00",
    "currency": "SAR"
  },
  "rows": [
    {
      "id": "0b8e4d2a-7c1f-4e9b-8a3d-5f6c2e1b9a70",
      "type": "order_earnings",
      "earnings": {
        "amount": "350.00",
        "currency": "SAR"
      },
      "order_id": "B26112000014",
      "charge_source": null,
      "created_at": "2026-11-20T09:00:00.000Z"
    },
    {
      "id": "3c9a1e5f-2b8d-4c7e-9f0a-6d4b8e2c1a57",
      "type": "earnings_charge",
      "earnings": {
        "amount": "-50.00",
        "currency": "SAR"
      },
      "order_id": null,
      "charge_source": "correction",
      "created_at": "2026-11-21T09:00:00.000Z"
    },
    {
      "id": "8f2d6b1c-9e4a-4b3f-a7c5-1e0d9b8a6c24",
      "type": "earnings_transfer",
      "earnings": {
        "amount": "-300.00",
        "currency": "SAR"
      },
      "order_id": null,
      "charge_source": null,
      "created_at": "2026-11-22T06:00:00.000Z"
    }
  ],
  "closing": {
    "amount": "0.00",
    "currency": "SAR"
  }
}
```

## Read the amounts owed

`GET /v1/earnings/debts`

What your earnings still owe after a correction, oldest first (the order they are settled in): what was owed, what later earnings settled and what is outstanding. `total` is taken from your next earnings before any transfer.

Key: A key with the `earnings:read` area.

Answer:

- `total` (object, required): Taken from your next earnings before any transfer.
  - `amount` (string, required)
  - `currency` (constant, required): Always `"SAR"`.
- `data` (array of object, required): Oldest first, the order they are settled in.
  - `id` (string (uuid), required)
  - `reason` (string, required): Why the correction was made, in B7R’s words.
  - `owed` (object, required)
    - `amount` (string, required)
    - `currency` (constant, required): Always `"SAR"`.
  - `settled` (object, required): What later earnings settled.
    - `amount` (string, required)
    - `currency` (constant, required): Always `"SAR"`.
  - `outstanding` (object, required): What is still owed.
    - `amount` (string, required)
    - `currency` (constant, required): Always `"SAR"`.
  - `created_at` (string, required)

Errors: `unauthorized` (401), `area_forbidden` (403), `account_inactive` (403), `connection_disabled` (403), `https_required` (403), `invalid_request` (400), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `api_unavailable` (503), `request_expired` (503), `service_unavailable` (503), `upstream_timeout` (504), `try_again_later` (503). See [Errors](https://docs.b7r.app/errors).

Request:

```bash
curl https://api.b7r.app/v1/earnings/debts \
  -H "Authorization: Bearer $B7R_API_KEY"
```

```javascript
const res = await fetch("https://api.b7r.app/v1/earnings/debts", {
  headers: {
    Authorization: `Bearer ${process.env.B7R_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.b7r.app/v1/earnings/debts",
    headers={
        "Authorization": f"Bearer {os.environ['B7R_API_KEY']}",
    },
    timeout=30,
)
data = res.json()
```

Answer (200 OK):

```json
{
  "total": {
    "amount": "40.00",
    "currency": "SAR"
  },
  "data": [
    {
      "id": "5e7a3c1b-8d2f-4a6e-9b0c-7f1d3e5a2b96",
      "reason": "A correction of an order’s earnings",
      "owed": {
        "amount": "40.00",
        "currency": "SAR"
      },
      "settled": {
        "amount": "0.00",
        "currency": "SAR"
      },
      "outstanding": {
        "amount": "40.00",
        "currency": "SAR"
      },
      "created_at": "2026-11-15T09:00:00.000Z"
    }
  ]
}
```
