> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.afternoon.co/llms.txt.
> For full documentation content, see https://docs.afternoon.co/llms-full.txt.

# Introduction

Afternoon is a billing platform that helps you meter usage, manage customers and subscriptions, and generate invoices. The Afternoon API gives you programmatic access to every part of the billing lifecycle.

## Core concepts

| Concept           | Description                                                                                                                                                                                 |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Customers**     | The people or organizations you bill. Each customer can have billing and shipping addresses, an external ID for mapping to your system, and one or more subscriptions.                      |
| **Subscriptions** | Link a customer to a plan. Subscriptions track status, billing anchor day, and renewal dates.                                                                                               |
| **Invoices**      | Itemized bills sent to customers. Invoices follow a lifecycle from `draft` to `open` to `paid` (or `void` / `uncollectible`). Line items can be added, updated, and removed while in draft. |
| **Events**        | Billable usage events you send to Afternoon. Events are identified by an idempotency key and processed asynchronously via a durable queue.                                                  |

## How it works

<Steps>
  <Step title="Send usage events">
    Instrument your application to send billable events to the `/v1/events/ingest` endpoint whenever metered activity occurs (API calls, compute time, storage, etc.).
  </Step>

  <Step title="Manage customers and subscriptions">
    Create customers and attach them to plans via subscriptions. Afternoon tracks billing periods and renewal dates automatically.
  </Step>

  <Step title="Generate invoices">
    Create draft invoices, add line items, and finalize them to assign an invoice number and open them for payment. Afternoon provides a hosted payment page for each finalized invoice.
  </Step>
</Steps>

## API design

The Afternoon API follows these conventions:

* **Base URL** — `https://api.afternoon.co`
* **Authentication** — Bearer token via API key (see [Authentication](/api-reference/authentication))
* **Content type** — All request and response bodies are `application/json`
* **Pagination** — List endpoints use cursor-based pagination with `limit` and `cursor` query parameters
* **Error format** — Errors return `{ success: false, error: { code, message }, request_id }`
* **Rate limiting** — 1,000 requests per minute per company. Rate limit headers (`X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`) are included on every response.

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="duotone rocket" href="/quickstart">
    Send your first event and create an invoice in under 5 minutes
  </Card>

  <Card title="Authentication" icon="duotone key" href="/api-reference/authentication">
    Learn how to authenticate your API requests
  </Card>

  <Card title="API reference" icon="duotone code" href="/api-reference">
    Browse the full API reference with interactive examples
  </Card>
</CardGroup>