Records a payment or refund on a subscriber. Permission: `subscribers`.

`eventType` is `SUBSCRIBER_PAYMENT` or `SUBSCRIBER_REFUND`. `subscriber` is an email or id. `data.amount` updates subscriber revenue.

## Body Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| `eventType` | string | **Required.** `SUBSCRIBER_PAYMENT` or `SUBSCRIBER_REFUND`. |
| `subscriber` | string | **Required.** Subscriber email or id. |
| `data` | object | **Required.** Event payload. Use `amount` (integer cents) and optional `currency` / extra keys. |

## Response Fields

| Field | Type | Description |
| ----- | ---- | ----------- |
| `id` | string | Created event id. |
| `eventType` | string | `SUBSCRIBER_PAYMENT` or `SUBSCRIBER_REFUND`. |

## Errors

| Status | `name` | When |
| ------ | ------ | ---- |
| 401 | `missing_api_key` | Missing or invalid bearer token |
| 403 | `missing_permission` | Token lacks the `subscribers` permission |
| 404 | `not_found` | Unknown subscriber |
| 400 | `validation_error` | Unsupported `eventType` or invalid payload |

## Related

- [List Subscriber Events](/docs/api-reference/v2/subscribers-events)
- [SDK: lumail.events.create](/docs/sdk/v2/events-create)


## API Reference
**Method:** POST
**Endpoint:** /api/v2/events

### SDK
```ts
import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.events.create({
  eventType: "SUBSCRIBER_PAYMENT",
  subscriber: "user@example.com",
  data: { amount: 2000, currency: "usd" },
});
if (error) {
  throw error;
}
console.log(data.id, data.eventType);
```

### cURL
```bash
curl -X POST https://lumail.io/api/v2/events \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"eventType":"SUBSCRIBER_PAYMENT","subscriber":"user@example.com","data":{"amount":2000,"currency":"usd"}}'
```

### JavaScript
```javascript
const response = await fetch("https://lumail.io/api/v2/events", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    eventType: "SUBSCRIBER_PAYMENT",
    subscriber: "user@example.com",
    data: { amount: 2000, currency: "usd" },
  }),
});
const data = await response.json();
```

### Success Response
```json
{
  "id": "evt_abc123",
  "eventType": "SUBSCRIBER_PAYMENT"
}
```

### Error Response
```json
{
  "name": "not_found",
  "message": "Subscriber not found",
  "statusCode": 404
}
```
