> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.trygrant.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.trygrant.com/_mcp/server.

# 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

Instrument your application to send billable events to the `/v1/events/ingest` endpoint whenever metered activity occurs (API calls, compute time, storage, etc.).

Create customers and attach them to plans via subscriptions. Afternoon tracks billing periods and renewal dates automatically.

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.

## 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

Send your first event and create an invoice in under 5 minutes

Learn how to authenticate your API requests

Browse the full API reference with interactive examples