# Events API

> Read every event Anytime Capital Payments emitted for your business in the last 30 days, to reconcile or catch up after missed webhook deliveries.

Source: https://anytime-capital.com/docs/events · Markdown: https://anytime-capital.com/docs/events.md · All docs: https://anytime-capital.com/docs/llms-full.txt

Every [webhook event](https://anytime-capital.com/docs/webhooks.md) we emit for your business, kept for 30 days whether or not an endpoint took it. Use it to reconcile, or to catch up after your endpoint was down: list what happened since the last event you handled and process what you haven't seen. Events are recorded once your business has a webhook endpoint or an API key, and need a key with the `events` permission (read only). Test events from **Send test event** never appear here.

| Topic | Detail |
| --- | --- |
| Endpoints | [`GET /api/v1/events`](#list-events), [`GET /api/v1/events/{id}`](#get-event) |
| Key permissions | `events:read` |
| Samples | curl; Node.js 18+ with the built-in `fetch` (in an ES module); the [Node SDK](https://anytime-capital.com/docs/node-sdk.md) (preview: not on npm yet); Python with `requests`. |
| Every request can also answer | 401 `UNAUTHORIZED`, 401 `API_KEY_EXPIRED`, 403 `NOT_ENROLLED`, 403 `PERMISSION_DENIED`, 403 `IP_NOT_ALLOWED`, 429 `RATE_LIMITED`, 500 `INTERNAL_ERROR`. See [Error codes](https://anytime-capital.com/docs/error-codes.md). |

## The event object

The same envelope a webhook delivery carries, plus `object` and `pendingWebhooks`: how many of your endpoints are still retrying it.

```json
{
  "object": "event",
  "id": "evt_3f9a1c2b7d4e6f8a0b1c2d3e4f5a6b7c",
  "type": "payment.succeeded",
  "created": "2026-10-14T16:02:16.000Z",
  "livemode": true,
  "data": {
    "object": "payment",
    "livemode": true,
    "id": "pay_7Hq2LmX9cR4tVb",
    "status": "paid",
    "amountCents": 12500,
    "amountRefundedCents": 0,
    "netCents": 12088,
    "currency": "usd",
    "description": "Consulting — October",
    "source": {
      "type": "payment_link",
      "id": "pl_4kTz8QwN2xYb6RcD1mPa"
    },
    "paymentLinkId": "pl_4kTz8QwN2xYb6RcD1mPa",
    "customer": {
      "name": "Jordan Lee",
      "email": "jordan@example.com",
      "country": "US"
    },
    "card": {
      "brand": "visa",
      "last4": "4242"
    },
    "paymentMethod": {
      "type": "card",
      "label": "Visa •••• 4242"
    },
    "clientReference": "order_1042",
    "metadata": {
      "campaign": "fall-launch"
    },
    "amountDetails": {
      "subtotalCents": 12500,
      "discountCents": 0,
      "shippingCents": 0,
      "taxCents": 0,
      "customerFeeCents": 0
    },
    "dispute": null,
    "failureMessage": null,
    "createdAt": "2026-10-14T16:02:11.000Z",
    "paidAt": "2026-10-14T16:02:15.000Z"
  },
  "pendingWebhooks": 0
}
```

| Field | Type | Description |
| --- | --- | --- |
| `object` | string | The type of object. Always `event`. |
| `id` | string | `evt_…`: the same id as the delivery's `Anytime-Event-Id` header. |
| `type` | string | One of `payment.succeeded`, `payment.failed`, `payment.refunded`, `refund.created`, `refund.succeeded`, `refund.failed`, `dispute.opened`, `dispute.updated`, `dispute.closed`, `invoice.created`, `invoice.sent`, `invoice.paid`, `invoice.overdue`, `invoice.voided`, `subscription.created`, `subscription.updated`, `subscription.paused`, `subscription.resumed`, `subscription.past_due`, `subscription.canceled`, `payment.review_required`, `customer.created`, `customer.updated`, `payout.paid`, `payout.failed`. |
| `created` | string (date-time) | When it happened. |
| `livemode` | boolean | False for test-mode data (an `ak_test_` key); true for live data. |
| `data` | object | The API object the event is about, as it was then. |
| `pendingWebhooks` | integer | Endpoints still retrying it. |

## Endpoints

### List events

`GET /api/v1/events`

Permission: `events:read`.

Every event emitted for the business in the last 30 days, newest first, whether or not a webhook endpoint took it: for reconciliation and catching up on missed deliveries. Each is the envelope a webhook delivery carries, plus pendingWebhooks. To catch up after downtime, list from your last handled event's `created` and skip ids you've already handled.

**Query**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | no | An event type (payment.succeeded), a family (payment.*), or up to 10 of either, comma-separated. |
| `createdFrom` | string | no | Created at or after: 2026-10-01 or an ISO 8601 date-time. |
| `createdTo` | string | no | Created before (exclusive), same format. |
| `objectId` | string | no | Only events about this object: `pay_…`, `re_…`, `inv_…`, `sub_…`, `cus_…`. |
| `limit` | integer | no | How many objects per page, 1–100. Default 25. See [Pagination](https://anytime-capital.com/docs/pagination.md). |
| `cursor` | string | no | The previous page's `nextCursor`, for the page after it. |

**Request (curl)**

```bash
curl "https://anytime-capital.com/api/v1/events?type=payment.*&createdFrom=2026-10-14" \
  -H "Authorization: Bearer $ANYTIME_API_KEY"
```

**Request (Node.js)**

```javascript
const res = await fetch("https://anytime-capital.com/api/v1/events?type=payment.*&createdFrom=2026-10-14", {
  headers: { Authorization: `Bearer ${process.env.ANYTIME_API_KEY}` },
});
const page = await res.json();
if (!res.ok) throw new Error(`${page.error.code}: ${page.error.message}`);
```

**Request (Python)**

```python
import os

import requests

res = requests.get(
    "https://anytime-capital.com/api/v1/events",
    headers={"Authorization": f"Bearer {os.environ['ANYTIME_API_KEY']}"},
    params={"type": "payment.*", "createdFrom": "2026-10-14"},
    timeout=30,
)
page = res.json()
if not res.ok:
    raise RuntimeError(f"{page['error']['code']}: {page['error']['message']}")
```

**Response** (200)

```json
{
  "object": "list",
  "data": [
    {
      "object": "event",
      "id": "evt_3f9a1c2b7d4e6f8a0b1c2d3e4f5a6b7c",
      "type": "payment.succeeded",
      "created": "2026-10-14T16:02:16.000Z",
      "livemode": true,
      "data": {
        "object": "payment",
        "livemode": true,
        "id": "pay_7Hq2LmX9cR4tVb",
        "status": "paid",
        "amountCents": 12500,
        "amountRefundedCents": 0,
        "netCents": 12088,
        "currency": "usd",
        "description": "Consulting — October",
        "source": {
          "type": "payment_link",
          "id": "pl_4kTz8QwN2xYb6RcD1mPa"
        },
        "paymentLinkId": "pl_4kTz8QwN2xYb6RcD1mPa",
        "customer": {
          "name": "Jordan Lee",
          "email": "jordan@example.com",
          "country": "US"
        },
        "card": {
          "brand": "visa",
          "last4": "4242"
        },
        "paymentMethod": {
          "type": "card",
          "label": "Visa •••• 4242"
        },
        "clientReference": "order_1042",
        "metadata": {
          "campaign": "fall-launch"
        },
        "amountDetails": {
          "subtotalCents": 12500,
          "discountCents": 0,
          "shippingCents": 0,
          "taxCents": 0,
          "customerFeeCents": 0
        },
        "dispute": null,
        "failureMessage": null,
        "createdAt": "2026-10-14T16:02:11.000Z",
        "paidAt": "2026-10-14T16:02:15.000Z"
      },
      "pendingWebhooks": 0
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 400 | `INVALID_INPUT` | A field, filter, `limit` or `cursor` is missing or invalid. The message starts with the field's name, as in `amountCents: …`, or reads `Invalid cursor.` Fix the named field. Don't retry the same request unchanged. |

### Get an event

`GET /api/v1/events/{id}`

Permission: `events:read`.

One event from the last 30 days, by the id a webhook delivery carries (Anytime-Event-Id).

**Path**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | `evt_…` |

**Request (curl)**

```bash
curl https://anytime-capital.com/api/v1/events/evt_3f9a1c2b7d4e6f8a0b1c2d3e4f5a6b7c \
  -H "Authorization: Bearer $ANYTIME_API_KEY"
```

**Request (Node.js)**

```javascript
const res = await fetch("https://anytime-capital.com/api/v1/events/evt_3f9a1c2b7d4e6f8a0b1c2d3e4f5a6b7c", {
  headers: { Authorization: `Bearer ${process.env.ANYTIME_API_KEY}` },
});
const event = await res.json();
if (!res.ok) throw new Error(`${event.error.code}: ${event.error.message}`);
```

**Request (Python)**

```python
import os

import requests

res = requests.get(
    "https://anytime-capital.com/api/v1/events/evt_3f9a1c2b7d4e6f8a0b1c2d3e4f5a6b7c",
    headers={"Authorization": f"Bearer {os.environ['ANYTIME_API_KEY']}"},
    timeout=30,
)
event = res.json()
if not res.ok:
    raise RuntimeError(f"{event['error']['code']}: {event['error']['message']}")
```

**Response** (200)

```json
{
  "object": "event",
  "id": "evt_3f9a1c2b7d4e6f8a0b1c2d3e4f5a6b7c",
  "type": "payment.succeeded",
  "created": "2026-10-14T16:02:16.000Z",
  "livemode": true,
  "data": {
    "object": "payment",
    "livemode": true,
    "id": "pay_7Hq2LmX9cR4tVb",
    "status": "paid",
    "amountCents": 12500,
    "amountRefundedCents": 0,
    "netCents": 12088,
    "currency": "usd",
    "description": "Consulting — October",
    "source": {
      "type": "payment_link",
      "id": "pl_4kTz8QwN2xYb6RcD1mPa"
    },
    "paymentLinkId": "pl_4kTz8QwN2xYb6RcD1mPa",
    "customer": {
      "name": "Jordan Lee",
      "email": "jordan@example.com",
      "country": "US"
    },
    "card": {
      "brand": "visa",
      "last4": "4242"
    },
    "paymentMethod": {
      "type": "card",
      "label": "Visa •••• 4242"
    },
    "clientReference": "order_1042",
    "metadata": {
      "campaign": "fall-launch"
    },
    "amountDetails": {
      "subtotalCents": 12500,
      "discountCents": 0,
      "shippingCents": 0,
      "taxCents": 0,
      "customerFeeCents": 0
    },
    "dispute": null,
    "failureMessage": null,
    "createdAt": "2026-10-14T16:02:11.000Z",
    "paidAt": "2026-10-14T16:02:15.000Z"
  },
  "pendingWebhooks": 0
}
```

**Errors**

| Status | Code | When |
| --- | --- | --- |
| 404 | `NOT_FOUND` | No such object on your business (an id from another business reads the same), or no such endpoint under `/api/v1`, which still answers in JSON. Check the id and the path. Ids are case-sensitive. |

---

Anytime Capital is a fintech company, not a bank. Payment processing, banking and payout services are provided by Anytime Capital's licensed partners. Rates shown are for US card payments; international cards, currency conversion and disputes may carry additional fees shown in your dashboard before you accept a payment.
