# Environments

> Sandbox and production URLs for API, CDN, and Merchant Dashboard.

Source: https://help.boltapp.com/api-reference/environments

Bolt provides separate **sandbox** and **production** environments. Each has its own Merchant Dashboard, API keys, and divisions.

## URLs [#urls]

| Type               | Sandbox                                                              | Production                                           |
| ------------------ | -------------------------------------------------------------------- | ---------------------------------------------------- |
| API                | `https://api-sandbox.boltapp.com`                                    | `https://api.boltapp.com`                            |
| CDN (Connect)      | `https://connect-sandbox.boltapp.com`                                | `https://connect.boltapp.com`                        |
| Merchant dashboard | [merchant-sandbox.boltapp.com](https://merchant-sandbox.boltapp.com) | [merchant.boltapp.com](https://merchant.boltapp.com) |
| Shopper dashboard  | [account-sandbox.boltapp.com](https://account-sandbox.boltapp.com)   | [account.boltapp.com](https://account.boltapp.com)   |

All transactions that flow through Bolt checkout appear in the Merchant Dashboard for the matching environment.

## Configure environment variables [#configure-environment-variables]

Set `BOLT_ENV` and derive the API base URL in your application:

<CodeGroup>
  <CodeBlockTabs defaultValue=".env">
    <CodeBlockTabsList>
      <CodeBlockTabsTrigger value=".env">
        .env
      </CodeBlockTabsTrigger>

      <CodeBlockTabsTrigger value="TypeScript">
        TypeScript
      </CodeBlockTabsTrigger>

      <CodeBlockTabsTrigger value="JavaScript">
        JavaScript
      </CodeBlockTabsTrigger>

      <CodeBlockTabsTrigger value="Python">
        Python
      </CodeBlockTabsTrigger>
    </CodeBlockTabsList>

    <CodeBlockTab value=".env">
      ```bash
      # Sandbox
      BOLT_ENV=sandbox
      BOLT_API_BASE_URL=https://api-sandbox.boltapp.com

      # Production
      # BOLT_ENV=production
      # BOLT_API_BASE_URL=https://api.boltapp.com
      ```
    </CodeBlockTab>

    <CodeBlockTab value="TypeScript">
      ```typescript
      type BoltEnv = "sandbox" | "production";

      const env: BoltEnv = (process.env.BOLT_ENV as BoltEnv) ?? "sandbox";

      const baseUrl: string =
        process.env.BOLT_API_BASE_URL ??
        (env === "production"
          ? "https://api.boltapp.com"
          : "https://api-sandbox.boltapp.com");
      ```
    </CodeBlockTab>

    <CodeBlockTab value="JavaScript">
      ```javascript
      const env = process.env.BOLT_ENV ?? "sandbox";

      const baseUrl =
        process.env.BOLT_API_BASE_URL ??
        (env === "production"
          ? "https://api.boltapp.com"
          : "https://api-sandbox.boltapp.com");
      ```
    </CodeBlockTab>

    <CodeBlockTab value="Python">
      ```python
      import os

      env = os.environ.get("BOLT_ENV", "sandbox")

      base_url = os.environ.get(
          "BOLT_API_BASE_URL",
          "https://api.boltapp.com" if env == "production" else "https://api-sandbox.boltapp.com",
      )
      ```
    </CodeBlockTab>
  </CodeBlockTabs>
</CodeGroup>

<Warning>
  Sandbox and production keys are separate. Never point `https://api.boltapp.com` at sandbox credentials or `https://api-sandbox.boltapp.com` at production credentials.
</Warning>

## Divisions [#divisions]

A merchant account can have one or many **divisions**: separately configured checkout instances (e.g. storefront vs back office). Each division has its own publishable key and webhook URLs.

Common divisions include Pay by Link and Back Office.

<Note>
  Collaborating with many developers across multiple sandboxes **does not require** multiple divisions. Add each URL to your [Trusted Domains](https://help.boltapp.com/dashboard/account/trusted-domains/) list.
</Note>

## Account types [#account-types]

Merchant account types are tied to payment processors. Switching processors requires a new Bolt merchant account aligned with the new processor.

## Related [#related]

* [API Quickstart](/api-reference/api-quickstart)
* [Authentication](/api-reference/authentication)
* [API keys](/getting-started/api-keys)
