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

# Connect Stripe with API Key – StackOne Hub

> Link a Stripe account in the StackOne Hub using API Key. End-user guide to authorize the integration and start using Stripe actions.

<Warning>Ensure you have access to your Stripe Dashboard with appropriate permissions to view API keys.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>Choosing Your Environment</h2>

  <p>Stripe provides separate API keys for live (production) and test environments. Choose the appropriate environment based on your use case.</p>

  <Steps>
    <Step title="Select the Right Environment">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>When connecting Stripe to StackOne, you'll be asked to select an environment.</p>

        <ul>
          <li><strong>Production</strong> - Use for real transactions with actual customer data and charges</li>
          <li><strong>Test Mode</strong> - Use for development and testing without processing real payments</li>
          <li>Test Mode uses simulated data and test card numbers</li>
          <li>You can switch environments later by creating a new connection</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Accessing Your API Keys</h2>

  <p>Stripe automatically generates API keys for your account. You'll need to copy your Secret key to connect with StackOne.</p>

  <Steps>
    <Step title="Sign in to Stripe">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Sign in to your <a href="https://dashboard.stripe.com" target="_blank" rel="noopener noreferrer">Stripe account</a>.</p>
      </div>
    </Step>

    <Step title="Switch to Test Mode (if needed)">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>To access test keys, you must first enable Test mode in the dashboard.</p>

        <ul>
          <li>Look for the <strong>Test mode</strong> toggle in the top-right corner of the dashboard</li>
          <li>Click the toggle to switch between Live and Test mode</li>
          <li>When Test mode is enabled, you'll see an orange <strong>TEST MODE</strong> banner at the top</li>
          <li>The dashboard URL will change to include `/test` (e.g., `dashboard.stripe.com/test/apikeys`)</li>
        </ul>
      </div>
    </Step>

    <Step title="Navigate to API Keys">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Go to <strong>Developers</strong> > <strong>API keys</strong> in the left sidebar.</p>

        <ul>
          <li>Or navigate directly to <a href="https://dashboard.stripe.com/apikeys" target="_blank" rel="noopener noreferrer">API Keys (Live)</a> or <a href="https://dashboard.stripe.com/test/apikeys" target="_blank" rel="noopener noreferrer">API Keys (Test)</a></li>
        </ul>
      </div>
    </Step>

    <Step title="Reveal and Copy Your Secret Key">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Locate your Secret key and copy it for use in StackOne.</p>

        <ul>
          <li>Find the <strong>Secret key</strong> row in the Standard keys section</li>
          <li>Click <strong>Reveal test key</strong> or <strong>Reveal live key</strong> to show the full key</li>
          <li>Click the copy icon or select and copy the key</li>
          <li>Test keys start with `sk_test_` and live keys start with `sk_live_`</li>
          <li>Store your Secret key securely as it provides full API access to your Stripe account</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Matching Your Key to Your Environment</h2>

  <p>Ensure your API key matches the environment you selected in StackOne.</p>

  <Steps>
    <Step title="Verify Key and Environment Match">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Use the correct key type for your selected environment.</p>

        <ul>
          <li>If you selected <strong>Production</strong> environment, use a key starting with `sk_live_` or `rk_live_`</li>
          <li>If you selected <strong>Test Mode</strong> environment, use a key starting with `sk_test_` or `rk_test_`</li>
          <li>Using mismatched keys and environments will cause authentication errors</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Using Restricted API Keys (Optional)</h2>

  <p>Instead of a secret key with full access, you can use a restricted API key to limit permissions to only the resources StackOne needs.</p>

  <Steps>
    <Step title="Create a Restricted Key">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Restricted API keys are drop-in replacements for secret keys and work with the same Bearer token authentication.</p>

        <ul>
          <li>In <strong>Developers</strong> > <strong>API keys</strong>, click <strong>Create restricted key</strong></li>
          <li>Under <strong>How will you be using this key?</strong>, select the option that best matches your use case (Powering an integration you built, Providing this key to a third-party application, Authorising an AI agent)</li>
          <li>Give the key a descriptive name (e.g., "StackOne Integration")</li>
          <li>At minimum, grant <strong>Read</strong> permission for <strong>Customers</strong> to pass the connection test</li>
          <li>Grant <strong>Read</strong> or <strong>Write</strong> permissions for any additional resources you want StackOne to access</li>
          <li>Click <strong>Create key</strong> and copy the generated key</li>
          <li>Restricted keys start with `rk_live_` (production) or `rk_test_` (test mode)</li>
          <li>Some actions may fail if the restricted key does not have the required permissions for that resource</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<div data-whitelabel-hide>
  <h2>Linking the Account from the Hub</h2>

  <Steps>
    <Step title="Navigate to the Hub">
      Use one of the three <a href="/guides/accounts-section#linking-accounts">Linking Account Methods</a> to access the Hub.
    </Step>

    <Step title="Fill out the fields">
      Fill out the following fields using details from your provider:

      <ul>
        <li><strong>API Key</strong></li>
      </ul>
    </Step>

    <Step title="Connect">
      <ul>
        <li>Click <strong>Connect</strong></li>
        <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
        <li>Once authorization is successful, you will see a confirmation popup</li>
      </ul>
    </Step>
  </Steps>

  <p>If the account linking is successful, you will see the newly linked account in your <a href="/guides/accounts-section">Accounts</a> page.</p>
</div>
