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

# Create a Seller account

> Register a Seller account in the sandbox, create an API key, and keep the key with its environment.

Register a Seller account and create an API key. All three steps of the InFlow integration need them. Start in the sandbox.

## Choose the correct account type

| Account type | Use it for | Seller calls |
| - | - | - |
| Seller account | A service that takes payments with `@inflowpayai/mpp-seller` or `@inflowpayai/x402-seller` | Work |
| Developer account | An agent that only buys, with an API key | Fail with `403 SELLER_ACCOUNT_REQUIRED` |

A Developer account key authenticates, but the seller configuration APIs need a Seller account.

## Choose an environment

Each environment has its own dashboard, its own accounts, and its own keys.

| Environment | Dashboard | SDK value | CLI flag |
| - | - | - | - |
| Sandbox | [sandbox.inflowpay.ai](https://sandbox.inflowpay.ai) | `environment: 'sandbox'` | `--sandbox` |
| Production | [app.inflowpay.ai](https://app.inflowpay.ai) | `environment: 'production'` | none. This is the default. |

A key works only in the environment that issued it. The `environment` value in your code must match the dashboard of the key.

<Warning>
  The sandbox alone does not guarantee that a target or a blockchain uses test money. Check each network and asset before you pay.
</Warning>

## Register and create a key

<Steps>
  <Step title="Register a Seller account">
    Open [sandbox.inflowpay.ai](https://sandbox.inflowpay.ai). Register a Seller account.
  </Step>

  <Step title="Create an API key">
    Create an API key in the dashboard. This key is your `INFLOW_API_KEY`.
  </Step>

  <Step title="Store the key with its environment">
    Put the environment name and the key in the same `.env` file. They must always change together.

    ```bash .env theme={null}
    INFLOW_ENVIRONMENT=sandbox
    INFLOW_API_KEY=your_sandbox_key_here
    ```

    Add `.env` to `.gitignore`. Never commit a key.
  </Step>
</Steps>

## Check the key at startup

Catch a wrong account type at startup and stop with a clear message. For x402, `createInflowSellerClient` makes authenticated calls when you construct it, so the error appears at startup. For MPP, the `inflow` method loads its configuration in the background, so the error appears at the first paid request.

```ts theme={null}
import { InflowApiError } from '@inflowpayai/x402';

try {
  await startSeller();
} catch (error) {
  if (error instanceof InflowApiError && error.code === 'SELLER_ACCOUNT_REQUIRED') {
    throw new Error('Configure a Seller account API key for this integration.');
  }
  throw error;
}
```

`startSeller` is your own startup function. For `401` and other errors, see [Errors](/reference/errors).

## Keep keys safe

* Keep production keys in the secret manager of your deployment. Never commit them.
* Do not put a key in a chat, a plan file, or an issue.
* Rotate a key if it appears outside your secret manager.

## Next step

<Card title="Protect an endpoint" icon="lock" href="/sellers/protect-an-endpoint">
  Accept MPP and x402 on an endpoint with InFlow Payments.
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.