Ballmac UI home

API Endpoint

An endpoint reference card: method and path with highlighted parameters, auth, grouped parameter lists, and request and response examples in tabs with copy.

Starts a subscription for an existing customer. The first invoice is created immediately unless a trial is set.

Bearer token

Path parameters

  • account_idstringrequired

    The customer's account ID.

Query parameters

  • dry_runboolean

    Validate the request without creating anything. Default: false

Body

  • planstringrequired

    Plan identifier, such as team_monthly.

  • trial_daysinteger

    Free days before the first charge.

{  "plan": "team_monthly",  "trial_days": 14}

Installation

$ pnpm dlx shadcn@latest add @ballmac/api-endpoint

Usage

import { ApiEndpoint } from "@/components/ballmac/api-endpoint"

The full example is in the Code tab above.

Examples

A stack of endpoints

API reference

PropTypeDefault
method*

HTTP method.

HttpMethod—
path*

Path, with `{name}` for path parameters.

string—
summary*

Short name of the operation, such as "Create a customer".

string—
description

Longer explanation.

string—
baseUrl

Base URL used by the "Copy URL" button.

string—
auth

Authentication needed, such as "Bearer token". Shown as a lock chip.

string—
parameters

Request fields.

EndpointParameter[][]
requestExample

Example request body.

string—
requestLanguage

Highlighter for the request body.

HighlightLanguage"json"
responses

Possible responses.

EndpointResponse[][]
defaultOpen

Open at first.

booleantrue
open

Controlled open state.

boolean—
onOpenChange

Called when the card opens or closes.

(open: boolean) => void—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Enter / SpaceOpens or closes the card
ArrowLeft / ArrowRightMoves between Request and response tabs
Screen readersParameters are grouped lists; each example is a labelled region; status tabs say Success or error class

Use with AI

method, path (use {id} for path parameters), summary, description, auth, parameters [{ name, in, type, required, description }], requestExample and responses [{ status, description, example }]. Collapsible; copies the full URL when baseUrl is set. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI API Endpoint (@ballmac/api-endpoint) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Hand-written API reference pages
  • Internal docs for a small API

Not for

  • Generating a full OpenAPI portal (render from the spec with your own loop over this component)

Registry JSON: https://ui.ballmac.com/r/api-endpoint.json

Credits

Free to use in personal and commercial projects.