# Revenue

Revenue summary, provider transactions and manual payments.

Revenue summary, provider transactions and manual payments.

## Get revenue manual

`GET /v1/revenue/manual/`

Required scope: `revenue:read`

### Parameters

| Name | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `date_from` | query | string (date) | No |  |
| `date_to` | query | string (date) | No |  |
| `updated_since` | query | string (date-time) | No |  |
| `cursor` | query | string | No |  |
| `page_size` | query | integer | No | min 1; max 100 |
| `status` | query | string | No | one of `PENDING`, `PROCESSING`, `COMPLETE`, `CANCELLED` |
| `payment_type` | query | string | No | one of `FULL`, `DEPOSIT`, `INSTALLMENT` |

### Response (200)

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | object[] | Yes |  |
| `data[].amount` | integer | No | read-only |
| `data[].due_at` | string (date-time) | No | read-only |
| `data[].id` | string | No | read-only |
| `data[].installment_counter` | string | No | read-only |
| `data[].lead_id` | string | No | read-only |
| `data[].paid_at` | string (date-time) | No | read-only |
| `data[].payment_type` | string | No | read-only |
| `data[].status` | string | No | read-only |
| `next_cursor` | string \| null | Yes |  |

### Responses

- `200` Success
- `400` The request is invalid.
- `401` Authentication is missing, invalid, or revoked.
- `403` The authenticated identity lacks the required scope or capability.
- `404` The resource is unavailable or not visible to this organization.
- `429` The request-rate budget is exhausted.

```bash
curl -X GET "https://api.themochi.app/v1/revenue/manual/" \
  -H "Authorization: Bearer $MOCHI_API_KEY"
```

## Get revenue summary

`GET /v1/revenue/summary/`

Required scope: `revenue:read`

### Parameters

| Name | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `date_from` | query | string (date) | Yes |  |
| `date_to` | query | string (date) | Yes |  |
| `source` | query | string | No | one of `transactions`, `manual` |

### Response (200)

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `computed_at` | string (date-time) | No | read-only |
| `metrics` | object | No | read-only |
| `metrics.amount` | integer | No | read-only |
| `metrics.by_payment_type` | object[] | No | read-only |
| `metrics.by_payment_type[].amount` | integer | No | read-only |
| `metrics.by_payment_type[].count` | integer | No | read-only |
| `metrics.by_payment_type[].payment_type` | string | No | read-only |
| `metrics.by_product` | object[] | No | read-only |
| `metrics.by_product[].amount` | integer | No | read-only |
| `metrics.by_product[].count` | integer | No | read-only |
| `metrics.by_product[].fee` | integer | No | read-only |
| `metrics.by_product[].net` | integer | No | read-only |
| `metrics.by_product[].product_name` | string | No | read-only |
| `metrics.by_provider` | object[] | No | read-only |
| `metrics.by_provider[].amount` | integer | No | read-only |
| `metrics.by_provider[].count` | integer | No | read-only |
| `metrics.by_provider[].fee` | integer | No | read-only |
| `metrics.by_provider[].net` | integer | No | read-only |
| `metrics.by_provider[].provider` | string | No | read-only |
| `metrics.by_status` | object[] | No | read-only |
| `metrics.by_status[].amount` | integer | No | read-only |
| `metrics.by_status[].count` | integer | No | read-only |
| `metrics.by_status[].status` | string | No | read-only |
| `metrics.conversion` | object | No | read-only |
| `metrics.conversion.pending` | boolean | No | read-only |
| `metrics.conversion.unconverted_count` | integer | No | read-only |
| `metrics.currency` | string | No | read-only |
| `metrics.fee` | integer \| null | No | read-only |
| `metrics.net` | integer \| null | No | read-only |
| `metrics.source` | string | No | read-only |
| `period` | object | No | read-only |
| `period.end` | string (date) | No | read-only |
| `period.start` | string (date) | No | read-only |

### Responses

- `200` Success
- `400` The request is invalid.
- `401` Authentication is missing, invalid, or revoked.
- `403` The authenticated identity lacks the required scope or capability.
- `404` The resource is unavailable or not visible to this organization.
- `429` The request-rate budget is exhausted.

```bash
curl -X GET "https://api.themochi.app/v1/revenue/summary/" \
  -H "Authorization: Bearer $MOCHI_API_KEY"
```

## Get revenue transactions

`GET /v1/revenue/transactions/`

Required scope: `revenue:read`

### Parameters

| Name | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `date_from` | query | string (date) | No |  |
| `date_to` | query | string (date) | No |  |
| `updated_since` | query | string (date-time) | No |  |
| `cursor` | query | string | No |  |
| `page_size` | query | integer | No | min 1; max 100 |

### Response (200)

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | object[] | Yes |  |
| `data[].amount` | integer | No | read-only |
| `data[].currency` | string | No | read-only |
| `data[].fee` | integer | No | read-only |
| `data[].id` | string | No | read-only |
| `data[].kind` | string | No | read-only |
| `data[].lead_id` | string | No | read-only |
| `data[].net` | integer | No | read-only |
| `data[].occurred_at` | string (date-time) | No | read-only |
| `data[].product_name` | string | No | read-only |
| `data[].provider` | string | No | read-only |
| `data[].status` | string | No | read-only |
| `next_cursor` | string \| null | Yes |  |

### Responses

- `200` Success
- `400` The request is invalid.
- `401` Authentication is missing, invalid, or revoked.
- `403` The authenticated identity lacks the required scope or capability.
- `404` The resource is unavailable or not visible to this organization.
- `429` The request-rate budget is exhausted.

```bash
curl -X GET "https://api.themochi.app/v1/revenue/transactions/" \
  -H "Authorization: Bearer $MOCHI_API_KEY"
```

