Skip to content

OpenAPI specification

Flint publishes its public /v1 API as an OpenAPI 3.1.2 document: every operation, request and response schema, error envelope, and webhook payload, plus Flint extensions that give each operation's scopes, error codes, and rate limit class. The API reference and the Node.js and PHP SDKs are generated from the same document. Fetching it needs no API key.

GET/v1/openapi.json

Returns the specification for the version in version or Flint-Version, or for the current version when you send neither.

Download the spec#

cURL
curl -s --compressed https://api.withflintpay.com/v1/openapi.json -o flint-openapi.json

The spec is over 20 MB of JSON. Flint gzips it when the request sends Accept-Encoding: gzip, which --compressed does, and that cuts the transfer to a few megabytes. Save it to a file and query the file instead of fetching it on every run. For an AI agent, the docs MCP server returns one endpoint's schema at a time, which fits a model's context better than the whole document.

The route takes no credential, so its requests count against the per-IP unauthenticated limit. A CI job that downloads the spec on every build shares that budget with your other unauthenticated calls from the same IP.

The spec lists one server, https://api.withflintpay.com. Live keys and sandbox-bound test keys use the same hostname, and the key you send selects live or sandbox data, so a generated client needs no separate sandbox base URL.

Choose a version#

Each API version has its own specification. Ask for one with a query parameter or a header:

cURL
curl -s --compressed 'https://api.withflintpay.com/v1/openapi.json?version=2026-02-01' \
  -o flint-openapi-2026-02-01.json
You sendThe document describes
NeitherThe current version
Flint-Version: 2026-02-01That version
?version=2026-02-01That version. Use it for tools and links that can't set a header.
Both, and both are validThe version query parameter's version

The document's info.version and x-flint-api-version name the version it describes, and the response's Flint-Version header repeats it. An unversioned request follows the current version, which changes when Flint ships a release, so put version in the URL when you generate code or compare schemas in CI. The API reference shows the current version.

  • HTTP 400
    version or Flint-Version isn't a supported version. param names the input, and details[0].supported_api_versions lists the versions you can send. An invalid Flint-Version header fails the request even when version is valid. A query parameter other than version fails with details[0].code UNKNOWN_FIELD.
  • HTTP 410
    The version has retired. Request a supported version.
  • HTTP 429
    RATE_LIMIT_EXCEEDEDRetry the same request
    Your IP reached its request limit. Wait for Retry-After, then retry, and reuse the downloaded file instead of fetching it again.

What the spec contains#

SectionContents
paths755 operations. Each has an operationId, a tag for its API area, its parameters, and its responses with example bodies. Header parameters include Flint-Version, X-Request-Id, and Idempotency-Key on the writes that accept one, with required: true where a key is required.
components.schemasEvery request object, response object, and error envelope. Request body schemas set additionalProperties: false, because the API rejects unknown fields.
components.securitySchemesThe bearer credentials. BearerAuth covers API keys, CLI sign-ins, partner install tokens, and session tokens. CheckoutSessionBearer, CustomerSessionBearer, InvoiceAccessTokenBearer, and OnboardingSessionBearer each work only on the operations that list them. An operation that takes no credential sets security: []. DeliveryRateCallbackBearer describes the JWT Flint sends to your delivery rate callback; it isn't a credential for calling Flint.
webhooksOne entry per webhook event type, describing the signed POST Flint sends to your endpoint: the delivery headers and the event body.
x-flint-* at the rootRelease notes, the scope catalog, and webhook delivery rules. See Flint extensions.

Flint extensions#

Flint adds x- keys where standard OpenAPI has no field for a contract fact. OpenAPI tools skip extension keys they don't recognize, so your generator keeps working, and your own tooling can read them.

On operations#

ExtensionMeaning
x-flint-required-scopesThe scopes an API key needs. x-flint-required-scopes-mode is all when the key needs every listed base scope; apply each scope's x-flint-scopes[].implied_by alternatives separately. With mode any, one listed scope is enough and the list includes the write alternatives directly.
x-flint-conditional-scopesScopes required under specific conditions. Each entry lists the request params involved, the required scopes, and when they apply. The catalog's implied_by alternatives apply here too. For example, confirming with save_payment_method: true requires payments.payment_methods.write. A product file can be read with commerce.products.read or commerce.products.write.
x-flint-partner-accessinstall_scoped when a partner app token can call the operation for a merchant that installed the app, platform_scoped when a live partner app token can call it for its own app, and unsupported when it can't. x-flint-partner-required-scopes and x-flint-partner-required-scopes-mode give the scopes the install needs. New values may be added.
x-flint-required-modetest on operations that run only in a sandbox, such as dispute simulation.
x-flint-route-classThe rate limit class the operation counts against: read, write, payment, sensitive_write, external_provider_action, webhook_signing, or a delivery class.
x-flint-error-codesEvery error code the operation can return, including details[].code values.

On schemas and fields#

ExtensionMeaning
x-flint-enum-kindOn response enums. closed values are the ones you branch on, but a pinned version can still gain one until Flint stops changing versions in place, so keep a default branch. extensible values can gain members at any time, so keep a default branch. See enum values.
x-enum-descriptionsThe meaning of each enum value, in the same order as enum.
x-flint-enum-vocabularyThe value set a field belongs to, such as refund_status or invoice_status. A field lists only the values it accepts or returns, so a buyer-facing field can carry a subset.
x-flint-secrettrue on a credential or secret value, such as a new key's secret_key or a customer session's refresh_token. Store it securely and keep it out of logs.
x-flint-omitted-for-authThe security schemes whose responses leave this field out, such as merchant fields that a checkout credential never receives. The field is optional in any schema reachable from a success response of an operation that accepts a named scheme.
x-flint-rejected-for-authThe security schemes that can't send this request field.
x-flint-rule-attributesOn PromotionRule, the attributes, types, and operators a promotion rule accepts.
x-flint-event-schemasOn the text/event-stream response of GET /v1/webhook-events/stream, the schema of each frame type, keyed by its event name.

On webhooks#

Each webhooks entry carries x-flint-event-kind: snapshot when data.object is the resource state recorded for the event, or notification when the event reports a condition, such as an invoice coming due. The event catalog explains how to handle each kind.

At the root#

ExtensionMeaning
x-flint-api-versionThe version the document describes.
x-flint-api-releasescurrent_version, and each release's changes (id, kind, summary, action, and the schemas and operations it touches), with the affected_routes and affected_events that each change reaches.
x-flint-scopesThe scope catalog: each scope's name, access, description, implied_by, key_modes, and partner_installable.
x-flint-webhooksWebhook delivery rules: signing, retry_policy, and secret_rotation, plus the data schema for each event type in event_payload_schemas and partner_event_payload_schemas.

Query the spec with jq#

These commands read the flint-openapi.json file from Download the spec.

The scopes POST /v1/refunds needs, including the extra scope for tax overrides:

Shell
jq '.paths["/v1/refunds"].post | {
  required_scopes: .["x-flint-required-scopes"],
  mode: .["x-flint-required-scopes-mode"],
  conditional_scopes: .["x-flint-conditional-scopes"]
}' flint-openapi.json

Every operation that lists a scope. For an operation with mode all, the key also needs the other scopes it lists:

Shell
jq -r --arg scope commerce.refunds.write '.paths | to_entries[] | .key as $path
  | .value | to_entries[]
  | select(.value | type == "object" and ((.["x-flint-required-scopes"] // []) | index($scope)))
  | "\(.key | ascii_upcase) \($path)"' flint-openapi.json

The error codes an operation can return:

Shell
jq -r '.paths["/v1/refunds"].post["x-flint-error-codes"][]' flint-openapi.json

The data schema of a webhook event:

Shell
jq '.["x-flint-webhooks"].event_payload_schemas["refund.created"]' flint-openapi.json

What a release changes, with the action to take for each change:

Shell
jq '.["x-flint-api-releases"].releases[] | select(.version == "2026-09-07")
  | .changes[] | {id, summary, action}' flint-openapi.json

The rate limits guide lists every operation with its route class.

Generate a client#

For Node.js and PHP, use the official SDKs. For another language, generate from a pinned version and keep these rules from the contract:

  • Accept unknown values. Type extensible enums as their known values plus any string, so a new value never fails deserialization.
  • Accept new response fields. Flint adds response fields without a new version, so don't reject a response that has fields your generated types lack.
  • Keep money as integers. Amounts are integer minor units in amount fields of money objects. Don't map them to floating point. See money and amounts.
  • Send Flint-Version. Send the version you generated from on every request, so a change to your merchant default can't change response shapes under your client.
  • Send idempotency keys. Set Idempotency-Key on writes that declare it, and reuse the key when you retry the same command.

For Go clients generated with oapi-codegen, set these output options. skip-prune keeps the webhook payload models, and nullable-type lets you distinguish omission from explicit null in PATCH requests.

YAML
output-options:
  skip-prune: true
  nullable-type: true

Leave a PATCH field unset to keep its current value. Use nullable.NewNullNullable[T]() to send an explicit null for a field that supports clearing.

Next steps#

API referenceEvery operation, schema, and error code in the current version, generated from the same specification.API versions and upgradesHow Flint picks a version, what changes between versions, and how to upgrade.AI agentsThe docs MCP server, Markdown docs, SKILL.md, and the OpenAPI spec for agents.

Was this helpful?