{"openapi":"3.1.0","info":{"title":"FlowPOS MCP and OAuth API","version":"1.0.0","summary":"Read a merchant's FlowPOS sales, inventory and reports from an AI agent, with the merchant's consent.","description":"FlowPOS is a point-of-sale and business management system for restaurants, retail stores and service businesses.\nAgents reach a merchant's data through the FlowPOS MCP server (Model Context Protocol, Streamable HTTP transport) at `POST /mcp`.\n\nAuthorization is OAuth 2.1 with PKCE (S256), described by RFC 9728 protected-resource metadata and RFC 8414 authorization-server metadata.\nA grant is read-only (`pos:read reports:read psa:read`) unless the merchant chooses \"Allow changes\" on the consent page, which adds `pos:write` and `pos:intents`.\nClients register with dynamic client registration (RFC 7591) or a client ID metadata document; redirect URIs are limited to an allowlist (currently the Claude and ChatGPT connector callbacks).\nOther MCP clients can use an API key (`fp_mcp_…`) that a FlowPOS user creates in the app under Settings → MCP.\n\nCall `tools/list` after `initialize` to see the tools the credential may use. Each tool states the scopes it needs.\n\nVersioning: the MCP protocol is versioned by date and negotiated in `initialize`; later requests send it in the `MCP-Protocol-Version` header. A version the server no longer supports is refused with 400 and the list of supported versions, never silently reinterpreted. The OAuth endpoints follow their RFCs. The tool list is part of the protocol: read `tools/list` in each session rather than caching it. Additions ship without notice; breaking changes (removing or renaming a tool or field, a broader scope, dropping a protocol version) get at least 90 days' notice, announced on the developer page and, during the notice period, with `Deprecation` and `Sunset` headers on `/mcp` responses.\n\nRate limits: every counted response carries the IETF `RateLimit` and `RateLimit-Policy` headers (and the older `X-RateLimit-*` ones); a 429 also carries `Retry-After`.","contact":{"name":"FlowPOS","url":"https://flowandgrow.tech/en/contact"}},"externalDocs":{"description":"FlowPOS MCP server and API: endpoint, sign-in, scopes, tools, errors and limits","url":"https://docs.flowandgrow.tech/settings/mcp-server"},"servers":[{"url":"https://api.flowandgrow.tech","description":"Production"}],"tags":[{"name":"MCP","description":"Model Context Protocol JSON-RPC endpoint."},{"name":"OAuth","description":"OAuth 2.1 authorization server."},{"name":"Discovery","description":"RFC 9728 and RFC 8414 metadata."}],"paths":{"/mcp":{"post":{"tags":["MCP"],"operationId":"mcpRequest","summary":"Send an MCP JSON-RPC message","description":"Main entry point for MCP traffic. The first request is an `initialize` call without `mcp-session-id`; the response carries the session ID in the `mcp-session-id` header, and every later request must send it. Use `tools/list` and `tools/call` to discover and run tools. A missing or invalid credential is answered with 401 and a `WWW-Authenticate: Bearer resource_metadata=…` challenge.","security":[{"flowposOAuth":["pos:read","reports:read","psa:read"]},{"mcpApiKey":[]}],"parameters":[{"name":"mcp-session-id","in":"header","schema":{"type":"string"},"required":false,"description":"Session ID from the `initialize` response. Omit on `initialize`."},{"name":"MCP-Protocol-Version","in":"header","required":false,"description":"MCP protocol version negotiated in `initialize`, sent on every later request. Omitted, the server uses the negotiated version; a version the server does not support is answered with 400 naming the supported ones. Omit on `initialize`, which negotiates it in the body.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2025-11-25"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"JSON-RPC response, as JSON or as a Server-Sent Events stream.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"mcp-session-id":{"description":"Set on the `initialize` response.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"A non-`initialize` message without a session ID, or an unsupported `MCP-Protocol-Version`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionError"},{"$ref":"#/components/schemas/JsonRpcResponse"}]}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"401":{"description":"Missing, invalid or expired credential. See the `WWW-Authenticate` header.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"WWW-Authenticate":{"description":"Bearer challenge naming the protected-resource metadata and the scopes to request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"404":{"description":"Unknown session ID: initialize again.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionError"},{"$ref":"#/components/schemas/JsonRpcResponse"}]}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}},"get":{"tags":["MCP"],"operationId":"mcpOpenEventStream","summary":"Open the event stream of an MCP session","description":"Opens a Server-Sent Events stream for an existing session, for server-to-client messages.","security":[{"flowposOAuth":["pos:read","reports:read","psa:read"]},{"mcpApiKey":[]}],"parameters":[{"name":"mcp-session-id","in":"header","schema":{"type":"string"},"required":true,"description":"Session ID from the `initialize` response."},{"name":"MCP-Protocol-Version","in":"header","required":false,"description":"MCP protocol version negotiated in `initialize`, sent on every later request. Omitted, the server uses the negotiated version; a version the server does not support is answered with 400 naming the supported ones.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2025-11-25"]}}],"responses":{"200":{"description":"Event stream opened.","content":{"text/event-stream":{"schema":{"type":"string"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"400":{"description":"Session ID missing, or an unsupported `MCP-Protocol-Version`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionError"},{"$ref":"#/components/schemas/JsonRpcResponse"}]}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"403":{"description":"The session belongs to another credential.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionError"},{"$ref":"#/components/schemas/JsonRpcResponse"}]}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"404":{"description":"Unknown session ID: initialize again.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionError"},{"$ref":"#/components/schemas/JsonRpcResponse"}]}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}},"delete":{"tags":["MCP"],"operationId":"mcpCloseSession","summary":"Close an MCP session","description":"Terminates the session and frees its server-side state. Call it when the client disconnects.","security":[{"flowposOAuth":["pos:read","reports:read","psa:read"]},{"mcpApiKey":[]}],"parameters":[{"name":"mcp-session-id","in":"header","schema":{"type":"string"},"required":true,"description":"Session ID to close."},{"name":"MCP-Protocol-Version","in":"header","required":false,"description":"MCP protocol version negotiated in `initialize`, sent on every later request. Omitted, the server uses the negotiated version; a version the server does not support is answered with 400 naming the supported ones.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2025-11-25"]}}],"responses":{"200":{"description":"Session closed. No body.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"400":{"description":"Session ID missing, or an unsupported `MCP-Protocol-Version`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionError"},{"$ref":"#/components/schemas/JsonRpcResponse"}]}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"403":{"description":"The session belongs to another credential.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionError"},{"$ref":"#/components/schemas/JsonRpcResponse"}]}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"404":{"description":"Unknown session ID.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionError"},{"$ref":"#/components/schemas/JsonRpcResponse"}]}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"tags":["Discovery"],"operationId":"getProtectedResourceMetadata","summary":"OAuth protected-resource metadata (RFC 9728)","description":"Names the MCP resource, its authorization server and the scopes it supports. Also served at `/.well-known/oauth-protected-resource/mcp`.","security":[],"responses":{"200":{"description":"Protected-resource metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectedResourceMetadata"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["Discovery"],"operationId":"getAuthorizationServerMetadata","summary":"OAuth authorization-server metadata (RFC 8414)","description":"Endpoints, grant types, PKCE methods and scopes of the authorization server.","security":[],"responses":{"200":{"description":"Authorization-server metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationServerMetadata"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}}},"/oauth/register":{"post":{"tags":["OAuth"],"operationId":"registerOAuthClient","summary":"Register a public OAuth client (RFC 7591)","description":"Dynamic client registration. Only public clients (`token_endpoint_auth_method: none`) with allowlisted redirect URIs are accepted.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRegistration"}}}},"responses":{"201":{"description":"Client registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisteredClient"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"400":{"description":"OAuth error (RFC 6749 §5.2).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}}},"/oauth/authorize":{"get":{"tags":["OAuth"],"operationId":"authorizeOAuthClient","summary":"Start an authorization (authorization code + PKCE)","description":"Browser endpoint. Redirects to the FlowPOS consent page, where the merchant signs in and approves; then redirects to the client's `redirect_uri` with `code` and `iss` (RFC 9207).","security":[],"parameters":[{"name":"response_type","in":"query","required":true,"description":"Always `code`.","schema":{"type":"string","enum":["code"]}},{"name":"client_id","in":"query","required":true,"description":"Registered client ID, or the URL of a client ID metadata document.","schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"description":"One of the client's registered redirect URIs.","schema":{"type":"string","format":"uri"}},{"name":"code_challenge","in":"query","required":true,"description":"PKCE challenge.","schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","required":true,"description":"Always `S256`.","schema":{"type":"string","enum":["S256"]}},{"name":"scope","in":"query","required":false,"description":"Space-separated scopes. Write scopes are granted only if the merchant allows changes.","schema":{"type":"string"}},{"name":"state","in":"query","required":false,"description":"Opaque value returned to the client.","schema":{"type":"string"}},{"name":"resource","in":"query","required":false,"description":"The MCP resource (RFC 8707): `https://api.flowandgrow.tech/mcp`.","schema":{"type":"string","format":"uri"}}],"responses":{"302":{"description":"Redirect to the consent page, or back to the client with an error.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Location":{"description":"The consent page, or the client's `redirect_uri` with `error` and `iss`.","schema":{"type":"string","format":"uri"}}}},"400":{"description":"The request cannot be redirected back to the client (missing or unknown `client_id` or `redirect_uri`): a short HTML page for the user, not JSON.","content":{"text/html":{"schema":{"type":"string"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}}},"/oauth/token":{"post":{"tags":["OAuth"],"operationId":"requestOAuthToken","summary":"Exchange a code or a refresh token for tokens","description":"`authorization_code` (with `code_verifier`) or `refresh_token`. Refresh tokens rotate on every use; replaying an old one revokes the grant.","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}}},"responses":{"200":{"description":"Tokens issued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"400":{"description":"OAuth error (RFC 6749 §5.2).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}}},"/oauth/revoke":{"post":{"tags":["OAuth"],"operationId":"revokeOAuthToken","summary":"Revoke a token (RFC 7009)","description":"Revokes an access or refresh token and its grant.","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/RevocationRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/RevocationRequest"}}}},"responses":{"200":{"description":"Revoked, or the token was not known (RFC 7009 §2.2). No body.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"400":{"description":"OAuth error (RFC 6749 §5.2).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}},"headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait `Retry-After` seconds before retrying.","headers":{"RateLimit":{"description":"Remaining quota: `\"<policy>\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The quota applied: `\"<policy>\";q=<requests>;w=<window seconds>`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}}}}},"components":{"securitySchemes":{"flowposOAuth":{"type":"oauth2","description":"OAuth 2.1 authorization code with PKCE (S256). Tokens are bound to the MCP resource.","flows":{"authorizationCode":{"authorizationUrl":"https://api.flowandgrow.tech/oauth/authorize","tokenUrl":"https://api.flowandgrow.tech/oauth/token","refreshUrl":"https://api.flowandgrow.tech/oauth/token","scopes":{"pos:read":"See products, inventory, sales and orders","pos:write":"Create orders, void transactions and log implementation hours","reports:read":"See sales, labor and cost reports","psa:read":"See implementation projects","pos:intents":"Run multi-step actions on your behalf"}}}},"mcpApiKey":{"type":"http","scheme":"bearer","description":"MCP API key (`fp_mcp_…`) created by a FlowPOS user under Settings → MCP, scoped to one business and to the scopes chosen there."}},"schemas":{"JsonRpcRequest":{"type":"object","description":"A JSON-RPC 2.0 request or notification (MCP).","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"description":"Omitted on notifications.","oneOf":[{"type":"string"},{"type":"integer"}]},"method":{"type":"string","description":"MCP method, e.g. `initialize`, `tools/list`, `tools/call`."},"params":{"type":"object","additionalProperties":true}}},"JsonRpcResponse":{"type":"object","required":["jsonrpc"],"properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"oneOf":[{"type":"string"},{"type":"integer"}]},"result":{"type":"object","additionalProperties":true},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}}}}},"ProtectedResourceMetadata":{"type":"object","required":["resource","authorization_servers"],"properties":{"resource":{"type":"string","format":"uri"},"authorization_servers":{"type":"array","items":{"type":"string","format":"uri"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string","enum":["pos:read","pos:write","reports:read","psa:read","pos:intents"]}}}},"AuthorizationServerMetadata":{"type":"object","required":["issuer","authorization_endpoint","token_endpoint"],"properties":{"issuer":{"type":"string","format":"uri"},"authorization_endpoint":{"type":"string","format":"uri"},"token_endpoint":{"type":"string","format":"uri"},"registration_endpoint":{"type":"string","format":"uri"},"revocation_endpoint":{"type":"string","format":"uri"},"response_types_supported":{"type":"array","items":{"type":"string"}},"grant_types_supported":{"type":"array","items":{"type":"string"}},"code_challenge_methods_supported":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string","enum":["pos:read","pos:write","reports:read","psa:read","pos:intents"]}},"client_id_metadata_document_supported":{"type":"boolean"},"authorization_response_iss_parameter_supported":{"type":"boolean"}}},"ClientRegistration":{"type":"object","required":["redirect_uris"],"properties":{"redirect_uris":{"type":"array","minItems":1,"items":{"type":"string","format":"uri"}},"client_name":{"type":"string","maxLength":100},"token_endpoint_auth_method":{"type":"string","enum":["none"]},"grant_types":{"type":"array","items":{"type":"string","enum":["authorization_code","refresh_token"]}},"response_types":{"type":"array","items":{"type":"string","enum":["code"]}}}},"RegisteredClient":{"type":"object","required":["client_id","redirect_uris"],"properties":{"client_id":{"type":"string"},"client_id_issued_at":{"type":"integer"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"}},"token_endpoint_auth_method":{"type":"string"},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}}}},"TokenRequest":{"type":"object","required":["grant_type","client_id"],"properties":{"grant_type":{"type":"string","enum":["authorization_code","refresh_token"]},"client_id":{"type":"string"},"code":{"type":"string","description":"For `authorization_code`."},"code_verifier":{"type":"string","description":"For `authorization_code`."},"redirect_uri":{"type":"string","format":"uri","description":"For `authorization_code`."},"refresh_token":{"type":"string","description":"For `refresh_token`."},"scope":{"type":"string","description":"For `refresh_token`: a subset of the grant."},"resource":{"type":"string","format":"uri"}}},"TokenResponse":{"type":"object","required":["access_token","token_type","expires_in","scope"],"properties":{"access_token":{"type":"string"},"token_type":{"type":"string","const":"Bearer"},"expires_in":{"type":"integer"},"refresh_token":{"type":"string"},"scope":{"type":"string"}}},"RevocationRequest":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]},"client_id":{"type":"string"}}},"OAuthError":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"error_description":{"type":"string"}}},"SessionError":{"type":"object","description":"An MCP session error written by FlowPOS.","required":["error"],"properties":{"error":{"type":"string","examples":["Unknown session ID"]}}},"HttpError":{"type":"object","description":"A FlowPOS HTTP error (401, 429).","required":["statusCode","message"],"properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string","examples":["Unauthorized"]}},"additionalProperties":true}}}}