API fields and examples

Use fields, response fields, request examples, and response examples to build Mintlify-style API docs with endpoint-aware right-rail samples.

API docs should pair readable field definitions with real request and response examples. On API pages, each ApiEndpoint renders request information for the call, and RequestExample and ResponseExample blocks attach to the right rail so the code follows the endpoint the reader is viewing.

Manual endpoint page

Use frontmatter for a single endpoint page, or ApiEndpoint blocks when one page documents several related calls.

Endpoint

Create checkout session

Creates a checkout session for a published offer.

POST /api/checkout/sessions
Base URL
https://api.plandalf.com
Authentication
Bearer token
Operation ID
createCheckoutSession
Request URL
https://api.plandalf.com/api/checkout/sessions

Request body

bodyofferstringrequired

Published offer slug, Sqid route key, or UUID.

bodymetadataobject

Optional implementation metadata, such as source page or account ID.

Create a session

Request
curl -X POST "https://api.plandalf.com/api/checkout/sessions" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"offer":"pro-plan"}'
const response = await fetch("https://api.plandalf.com/api/checkout/sessions", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Accept: "application/json"
  },
  body: JSON.stringify({ offer: "pro-plan" })
});

Response fields

sessionobjectrequired

The checkout session returned by the API.

session.idstring

Public checkout session route key.

session.statusstring

Current session state.

offerobject

The offer context attached to the session.

Session response

201 Response
{
  "session": {
    "id": "cs_123",
    "status": "open",
    "currency": "USD",
    "total": 2900
  },
  "offer": {
    "id": "off_123",
    "slug": "pro-plan",
    "name": "Pro plan"
  }
}

Validation error

422 Response
{
  "message": "The offer field is required.",
  "errors": {
    "offer": ["The offer field is required."]
  }
}

Props

Endpoint props

methodGET | POST | PUT | PATCH | DELETErequired

Renders the method badge in the request summary and the active right-rail call.

pathstringrequired

Renders the endpoint path, copyable request URL, and right-rail call path.

baseUrlstringdefault: https://api.plandalf.com

Sets the base URL used in the request information summary and copy URL action.

authstringdefault: Bearer token

Describes the authentication model for this endpoint, such as Bearer token or Public offer route.

operationIdstring

Shows the stable operation name in the request information summary.

Field props

namestring

Generic field name when the location is not important.

query | path | body | headerstring

Sets the field location label.

typestring

Field type, such as string, object, array, or a union.

requiredbooleandefault: false

Marks the field as required.

defaultstring

Shows a default value.

deprecatedbooleandefault: false

Marks older fields without deleting useful migration context.

Example props

titlestring

Heading for the request or response example.

statusstring | number

Adds an HTTP status badge and, on API pages, lets the right rail switch between multiple response outcomes.

statusTextstring

Adds the HTTP reason phrase as accessible context for the response status.

labelsstring[]

Labels multiple fenced code blocks inside one example.

railbooleandefault: true

Controls whether request and response examples clone into the desktop right rail.

Feature detail