> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useautumn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Stripe Connection

> Read a managed organization's Stripe OAuth connection, account ID, and authorization time in the selected environment.

export const DynamicResponseExample = ({json, statusCode = "200"}) => {
  const toCamelCase = str => {
    return str.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
  };
  const convertKeysToCamelCase = obj => {
    if (Array.isArray(obj)) {
      return obj.map(item => convertKeysToCamelCase(item));
    }
    if (obj !== null && typeof obj === "object") {
      return Object.keys(obj).reduce((acc, key) => {
        const camelKey = toCamelCase(key);
        acc[camelKey] = convertKeysToCamelCase(obj[key]);
        return acc;
      }, {});
    }
    return obj;
  };
  const [isTypeScript, setIsTypeScript] = useState(() => {
    if (typeof window !== "undefined") {
      try {
        const lang = localStorage.getItem("code");
        return JSON.parse(lang) === "typescript";
      } catch {
        return true;
      }
    }
    return true;
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      if (event.detail?.key === "code") {
        try {
          const value = JSON.parse(event.detail.value);
          setIsTypeScript(value === "typescript");
        } catch {}
      }
    };
    const pollInterval = setInterval(() => {
      try {
        const lang = localStorage.getItem("code");
        const value = JSON.parse(lang);
        setIsTypeScript(value === "typescript");
      } catch {}
    }, 300);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, []);
  const camelCaseJson = useMemo(() => convertKeysToCamelCase(json), [json]);
  const snakeCaseString = JSON.stringify(json, null, 2);
  const camelCaseString = JSON.stringify(camelCaseJson, null, 2);
  return <ResponseExample>
			{isTypeScript ? <CodeBlock language="json" filename={statusCode}>
					{camelCaseString}
				</CodeBlock> : <CodeBlock language="json" filename={statusCode}>
					{snakeCaseString}
				</CodeBlock>}
		</ResponseExample>;
};

export const DynamicResponseField = ({children, name, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedName = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(name) : name;
    } catch {
      return name;
    }
  }, [name, lang]);
  return <ResponseField name={resolvedName} {...props}>
			{children}
		</ResponseField>;
};

export const DynamicParamField = ({children, body, path, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedBody = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(body) : body;
    } catch {
      return body;
    }
  }, [body, lang]);
  const resolvedPath = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(path) : path;
    } catch {
      return path;
    }
  }, [path, lang]);
  return <ParamField body={resolvedBody} path={resolvedPath} {...props}>
			{children}
		</ParamField>;
};

Read a tenant's Stripe OAuth connection before showing a **Connect Stripe** or **Disconnect Stripe** action in your application.

Authenticate with your **master organization's secret key**, with `platform:read` scope. Pass the tenant's public `organization_slug` and an explicit `env`: `test` or `live`. You can only inspect organizations created by your master organization. The `env` field alone selects the connection: a test-mode or live-mode master key can read either environment's connection.

## Interpreting the response

* `connected: true` means the tenant has a stored Stripe OAuth account connection in this environment. `account_id` identifies that Stripe account.
* `connected_at` is the authorization time as a Unix timestamp in **milliseconds**. It can be `null` for historical connections; `null` does not mean disconnected.
* An unconnected tenant returns `{"connected":false,"account_id":null,"connected_at":null}`.

<Note>
  A default sandbox account, a separately configured Stripe secret key, or a direct account-ID connection through your own Stripe platform does not count as an Autumn OAuth connection. This endpoint is not a general check of whether the tenant can process payments.
</Note>

After the tenant returns from the [Stripe OAuth flow](/api-reference/platform/oauth-url), fetch this status to update your UI. Revocations made in Stripe are reflected after Autumn processes Stripe's deauthorization webhook.

A slug that does not resolve to an organization created by your master organization returns `400` with `Organization with slug '<slug>' not found`. A missing API key returns `401`, and a key without `platform:read` returns `403`.

To remove the OAuth connection, call [Disconnect Stripe](/api-reference/platform/disconnectStripe). Test and live connections are managed separately.

### Body Parameters

<DynamicParamField body="organization_slug" type="string" required>
  Public tenant organization slug, without the master organization suffix.
</DynamicParamField>

<DynamicParamField body="env" type="'test' | 'live'" required>
  Stripe connection environment to inspect or disconnect.
</DynamicParamField>

### Response

<DynamicResponseField name="connected" type="boolean">
  Whether an OAuth connection is stored. Excludes platform-managed accounts, default sandbox accounts, and separate secret-key connections.
</DynamicResponseField>

<DynamicResponseField name="account_id" type="string | null">
  OAuth-connected Stripe account ID, or null when absent.
</DynamicResponseField>

<DynamicResponseField name="connected_at" type="number | null">
  Connection timestamp in Unix milliseconds, or null for historical connections without a timestamp and when disconnected.
</DynamicResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "connected": true,
    "account_id": "acct_example",
    "connected_at": 1781113864000
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi POST /v1/platform.get_stripe_connection
openapi: 3.1.0
info:
  title: Autumn API
  version: 2.4.0
servers:
  - url: https://api.useautumn.com
    description: Production server
security:
  - secretKey: []
paths:
  /v1/platform.get_stripe_connection:
    post:
      tags:
        - platform
      description: >-
        Read a managed organization's Stripe OAuth connection, account ID, and
        authorization time in the selected environment.
      operationId: getStripeConnection
      parameters:
        - name: x-api-version
          in: header
          required: true
          schema:
            type: string
            default: 2.4.0
          x-speakeasy-globals-hidden: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organization_slug:
                  type: string
                  minLength: 1
                  description: >-
                    Public tenant organization slug, without the master
                    organization suffix.
                env:
                  enum:
                    - test
                    - live
                  type: string
                  description: Stripe connection environment to inspect or disconnect.
              required:
                - organization_slug
                - env
              title: GetStripeConnectionParams
              examples:
                - organization_slug: my-app
                  env: test
            example:
              organization_slug: my-app
              env: test
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  connected:
                    type: boolean
                    description: >-
                      Whether an OAuth connection is stored. Excludes
                      platform-managed accounts, default sandbox accounts, and
                      separate secret-key connections.
                  account_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: OAuth-connected Stripe account ID, or null when absent.
                  connected_at:
                    anyOf:
                      - type: number
                      - type: 'null'
                    description: >-
                      Connection timestamp in Unix milliseconds, or null for
                      historical connections without a timestamp and when
                      disconnected.
                required:
                  - connected
                  - account_id
                  - connected_at
                title: GetStripeConnectionResponse
                examples:
                  - connected: true
                    account_id: acct_example
                    connected_at: 1781113864000
                  - connected: false
                    account_id: null
                    connected_at: null
              example:
                connected: true
                account_id: acct_example
                connected_at: 1781113864000
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Autumn } from 'autumn-js'

            const autumn = new Autumn()

            const result = await autumn.platform.getStripeConnection({
              organizationSlug: "my-app",
              env: "test",
            });
        - lang: python
          label: Python (SDK)
          source: |-
            from autumn_sdk import Autumn

            autumn = Autumn(secret_key="am_sk_test...")

            res = autumn.platform.get_stripe_connection(
                organization_slug="my-app",
                env="test",
            )
components:
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````