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.
/api/checkout/sessions Request body
offerstringrequiredPublished offer slug, Sqid route key, or UUID.
metadataobjectOptional implementation metadata, such as source page or account ID.
Create a session
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.idstringPublic checkout session route key.
session.statusstringCurrent session state.
offerobjectThe offer context attached to the session.
Session response
{
"session": {
"id": "cs_123",
"status": "open",
"currency": "USD",
"total": 2900
},
"offer": {
"id": "off_123",
"slug": "pro-plan",
"name": "Pro plan"
}
} Validation error
{
"message": "The offer field is required.",
"errors": {
"offer": ["The offer field is required."]
}
} Props
Endpoint props
methodGET | POST | PUT | PATCH | DELETErequiredRenders the method badge in the request summary and the active right-rail call.
pathstringrequiredRenders the endpoint path, copyable request URL, and right-rail call path.
baseUrlstringdefault: https://api.plandalf.comSets the base URL used in the request information summary and copy URL action.
authstringdefault: Bearer tokenDescribes the authentication model for this endpoint, such as Bearer token or Public offer route.
operationIdstringShows the stable operation name in the request information summary.
Field props
namestringGeneric field name when the location is not important.
query | path | body | headerstringSets the field location label.
typestringField type, such as string, object, array, or a union.
requiredbooleandefault: falseMarks the field as required.
defaultstringShows a default value.
deprecatedbooleandefault: falseMarks older fields without deleting useful migration context.
Example props
titlestringHeading for the request or response example.
statusstring | numberAdds an HTTP status badge and, on API pages, lets the right rail switch between multiple response outcomes.
statusTextstringAdds the HTTP reason phrase as accessible context for the response status.
labelsstring[]Labels multiple fenced code blocks inside one example.
dropdownbooleandefault: falseUses a dropdown selector for examples with many variants.
railbooleandefault: trueControls whether request and response examples clone into the desktop right rail.