Response fields
Use response fields to describe API response objects, nested properties, and returned resource shapes.
Response fields are the response-side partner to parameter fields. Use them inside Responses when documenting API output.
Basic example
responsestringrequiredA response field example.
<ResponseField name="response" type="string" required>
A response field example.
</ResponseField>
Response group
Checkout session response
idstringrequiredCheckout session route key.
›totalsobject
Calculated monetary totals for the session.
totals.totalintegerFinal total in the smallest currency unit.
<Responses title="Checkout session response" variant="list">
<ResponseField name="id" type="string" required>
Checkout session route key.
</ResponseField>
<ResponseField name="totals" type="object" expandable defaultOpen>
Calculated monetary totals for the session.
<ResponseField name="totals.total" type="integer">
Final total in the smallest currency unit.
</ResponseField>
</ResponseField>
</Responses>
Nested objects
Response fields can expand nested objects so the visible page stays readable while still documenting the full returned shape.
Offer response
›offerobjectrequired
The offer returned by a catalog or checkout API call.
offer.idstringrequiredStable offer identifier.
offer.slugstringoptionalPublic slug when the offer has a hosted route.
›offer.componentsarray<object>
Checkout blocks such as order bumps, add-ons, and save offers.
offer.components[].typestringrequiredComponent kind used by the checkout renderer.
request_idstringoptionalTrace identifier returned for support and debugging.
<Responses title="Offer response" variant="list">
<ResponseField name="offer" type="object" required expandable defaultOpen>
The offer returned by a catalog or checkout API call.
<ResponseField name="offer.id" type="string" required>
Stable offer identifier.
</ResponseField>
<ResponseField name="offer.components" type="array<object>" expandable>
Checkout blocks such as order bumps, add-ons, and save offers.
</ResponseField>
</ResponseField>
</Responses>
With examples
Pair response fields with a ResponseExample or an ApiEndpoint so the schema and the payload teach the same object.
Response example
Request / response200 offer
{
"offer": {
"id": "off_123",
"slug": "launch-plan",
"components": [
{ "type": "order_bump", "title": "Add the workbook" }
]
},
"request_id": "req_abc"
} <Responses title="Offer response" variant="list">
<ResponseField name="offer" type="object" required expandable>
The offer returned by the API.
</ResponseField>
</Responses>
<Examples title="Response example">
<ResponseExample title="200 offer">
```json title="Offer response"
{ "offer": { "id": "off_123" }, "request_id": "req_abc" }
```
</ResponseExample>
</Examples>
Authoring rules
Response field rules
Mirror the payloadschema and exampleIf the example includes a property, document it or intentionally omit it from the example.
Expand objectsnested detailUse expandable fields for objects and arrays where nested keys matter.
Prefer exact namesdot notationUse offer.components[].type for nested array values so agents and readers can copy the shape accurately.
Props
namestringrequiredThe name of the response value. Dot notation is supported for nested fields.
typestringrequiredExpected type of the response value. This can be any arbitrary string.
defaultstringThe default value.
requiredbooleanShow required beside the field name.
deprecatedbooleanWhether you have deprecated a field.
prestring[]Labels that appear before the name of the field.
poststring[]Labels that appear after the name of the field.
Plandalf extensions
optionalbooleanMarks the property as conditional or nullable when the page wants to be explicit.
responsestringAlias for name, used when imported MDX describes response values with a response prop.
expandablebooleanRenders the row as a collapsible object container.
defaultOpenbooleandefault: falseOpens an expandable response field on first render.
idstringStable anchor for direct links to a field.
class | classNamestringOptional classes for layout adjustments.