# Response and event structures

This reference describes REST response bodies and live stream events. Field tables and examples come from the API specifications — [OpenAPI](https://api.donatty.com/v1/openapi.json) and [AsyncAPI](https://api.donatty.com/v1/asyncapi.yaml) — so they match what the server sends.

## How to read the tables

- **Type** is a string, an integer, a boolean, an object or a list. "or null" means the field can have the value `null`.
- Fields are present by default, even when their value is `null`. Optional fields are marked "may be absent" next to their name.
- IDs, time and money follow the common formats in [Money, formats and lists](https://developers.donatty.com/en/data.md#formats); the `Money` and `ExactMoney` schemas are below.
- Unknown fields and new values are covered in [Compatibility](https://developers.donatty.com/en/changelog.md#compatibility).

## `Money`

**Part of:** [`Donation`](https://developers.donatty.com/en/structures/donation.md#donation), [`Goal`](https://developers.donatty.com/en/structures/goal.md#goal), [`Top`](https://developers.donatty.com/en/structures/stats.md#top), [`Total`](https://developers.donatty.com/en/structures/stats.md#total)

| Field | Type | Description |
|---|---|---|
| `value` | string | Decimal amount with two fraction digits. |
| `currency` | string | ISO 4217 code. |

### Example

```json
{
  "value": "500.00",
  "currency": "RUB"
}
```

## `ExactMoney`

**Part of:** [`PlatformEvent`](https://developers.donatty.com/en/structures/platform-event.md#platformevent)

An exact amount of a platform, never rounded: unlike `Money`, the fraction is not cut to two digits. It has at least the minor units of the currency (`5.00` USD, `500` JPY, `1.500` KWD) and more digits when the platform sent more.

| Field | Type | Description |
|---|---|---|
| `value` | string | Decimal amount, up to six fraction digits, never rounded. |
| `currency` | string | Currency code as the platform sent it: ISO 4217 for YouTube. The amount is never converted. |

## REST responses

| Structure | Method |
|---|---|
| [`Money`](https://developers.donatty.com/en/structures.md#money) | inside other structures |
| [`ExactMoney`](https://developers.donatty.com/en/structures.md#exactmoney) | inside other structures |
| [`Streamer`](https://developers.donatty.com/en/structures/streamer.md#streamer) | [`GET /v1/streamer`](https://developers.donatty.com/en/reference/streamer.md) |
| [`Donation`](https://developers.donatty.com/en/structures/donation.md#donation) | [`GET /v1/donations`](https://developers.donatty.com/en/reference/donations.md) |
| [`DonationPage`](https://developers.donatty.com/en/structures/donation.md#donationpage) | [`GET /v1/donations`](https://developers.donatty.com/en/reference/donations.md) |
| [`Goal`](https://developers.donatty.com/en/structures/goal.md#goal) | [`GET /v1/goals`](https://developers.donatty.com/en/reference/goals.md) |
| [`GoalPage`](https://developers.donatty.com/en/structures/goal.md#goalpage) | [`GET /v1/goals`](https://developers.donatty.com/en/reference/goals.md) |
| [`Top`](https://developers.donatty.com/en/structures/stats.md#top) | [`GET /v1/stats/top`](https://developers.donatty.com/en/reference/stats-top.md) |
| [`Total`](https://developers.donatty.com/en/structures/stats.md#total) | [`GET /v1/stats/total`](https://developers.donatty.com/en/reference/stats-total.md) |
| [`PlatformEvent`](https://developers.donatty.com/en/structures/platform-event.md#platformevent) | [`GET /v1/platform-events`](https://developers.donatty.com/en/reference/platform-events.md) |
| [`PlatformEventPage`](https://developers.donatty.com/en/structures/platform-event.md#platformeventpage) | [`GET /v1/platform-events`](https://developers.donatty.com/en/reference/platform-events.md) |
| [`SourceStatus`](https://developers.donatty.com/en/structures/event-source.md#sourcestatus) | [`GET /v1/event-sources`](https://developers.donatty.com/en/reference/event-sources.md) |
| [`SourceStatusList`](https://developers.donatty.com/en/structures/event-source.md#sourcestatuslist) | [`GET /v1/event-sources`](https://developers.donatty.com/en/reference/event-sources.md) |
| [`Problem`](https://developers.donatty.com/en/structures/problem.md#problem) | All methods |

## Stream events

| Event | Channel |
|---|---|
| [`donation.created`](https://developers.donatty.com/en/structures/donation-events.md#donationcreated) | [`donations`](https://developers.donatty.com/en/realtime/channels.md) |
| [`donation.moderated`](https://developers.donatty.com/en/structures/donation-events.md#donationmoderated) | [`donations`](https://developers.donatty.com/en/realtime/channels.md) |
| [`donation.replayed`](https://developers.donatty.com/en/structures/donation-events.md#donationreplayed) | [`donations`](https://developers.donatty.com/en/realtime/channels.md) |
| [`goal.updated`](https://developers.donatty.com/en/structures/goal-events.md#goalupdated) | [`goals`](https://developers.donatty.com/en/realtime/channels.md) |
| [`twitch.follow`](https://developers.donatty.com/en/structures/twitch-events.md#twitchfollow) | [`twitch`](https://developers.donatty.com/en/realtime/channels.md) |
| [`twitch.subscription`](https://developers.donatty.com/en/structures/twitch-events.md#twitchsubscription) | [`twitch`](https://developers.donatty.com/en/realtime/channels.md) |
| [`twitch.subscription.gift`](https://developers.donatty.com/en/structures/twitch-events.md#twitchsubscriptiongift) | [`twitch`](https://developers.donatty.com/en/realtime/channels.md) |
| [`twitch.subscription.received`](https://developers.donatty.com/en/structures/twitch-events.md#twitchsubscriptionreceived) | [`twitch`](https://developers.donatty.com/en/realtime/channels.md) |
| [`twitch.cheer`](https://developers.donatty.com/en/structures/twitch-events.md#twitchcheer) | [`twitch`](https://developers.donatty.com/en/realtime/channels.md) |
| [`twitch.raid`](https://developers.donatty.com/en/structures/twitch-events.md#twitchraid) | [`twitch`](https://developers.donatty.com/en/realtime/channels.md) |
| [`twitch.reward.redeemed`](https://developers.donatty.com/en/structures/twitch-events.md#twitchrewardredeemed) | [`twitch`](https://developers.donatty.com/en/realtime/channels.md) |
| [`twitch.hype_train.level_changed`](https://developers.donatty.com/en/structures/twitch-events.md#twitchhype_trainlevel_changed) | [`twitch`](https://developers.donatty.com/en/realtime/channels.md) |
| [`youtube.subscriber`](https://developers.donatty.com/en/structures/youtube-events.md#youtubesubscriber) | [`youtube`](https://developers.donatty.com/en/realtime/channels.md) |
| [`youtube.member`](https://developers.donatty.com/en/structures/youtube-events.md#youtubemember) | [`youtube`](https://developers.donatty.com/en/realtime/channels.md) |
| [`youtube.super_chat`](https://developers.donatty.com/en/structures/youtube-events.md#youtubesuper_chat) | [`youtube`](https://developers.donatty.com/en/realtime/channels.md) |
| [`youtube.super_sticker`](https://developers.donatty.com/en/structures/youtube-events.md#youtubesuper_sticker) | [`youtube`](https://developers.donatty.com/en/realtime/channels.md) |
| [`source.status_changed`](https://developers.donatty.com/en/structures/service-events.md#sourcestatus_changed) | [`donations`](https://developers.donatty.com/en/realtime/channels.md), [`twitch`](https://developers.donatty.com/en/realtime/channels.md), [`youtube`](https://developers.donatty.com/en/realtime/channels.md) |
