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

# Create User

> Create a new user

# Create User

Creates a new user. Deposit addresses are only generated for accounts with `transactionMode: sell` or `transactionMode: both`.

<ParamField body="name" type="string" required>
  Full name of the user
</ParamField>

<ParamField body="mobile" type="string" required>
  Mobile number with country code (e.g., +919876543210)
</ParamField>

<ParamField body="email" type="string">
  Email address
</ParamField>

<ParamField body="externalId" type="string">
  Your internal user ID for reference
</ParamField>

<ParamField body="deviceId" type="string">
  Device fingerprint or identifier
</ParamField>

## Request

```bash theme={null}
curl -X POST https://api.stablepay.global/v2/users \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Rahul Kumar",
    "mobile": "+919876543210",
    "email": "rahul@example.com"
  }'
```

## Response

<Tabs>
  <Tab title="sell / both">
    Users created under a `sell` or `both` account receive deposit addresses.

    ```json theme={null}
    {
      "success": true,
      "data": {
        "userId": "usr_abc123def456",
        "depositAddresses": {
          "evm": "0x742d35Cc6634C0532925a3b844Bc9e7595f3A123",
          "tron": "TN7FbQz9Mwi4pPYkXRmpVMaccut3Fk8BBB"
        },
        "kycStatus": "pending"
      }
    }
    ```

    The `evm` address works across Polygon, Ethereum, Arbitrum, and Base. `tron` is returned when Tron is enabled on your account.
  </Tab>

  <Tab title="pool_settlement">
    Users created under a `pool_settlement` account do not receive deposit addresses — funds sweep from your pool wallet, not per-user addresses.

    ```json theme={null}
    {
      "success": true,
      "data": {
        "userId": "usr_abc123def456",
        "kycStatus": "pending"
      }
    }
    ```
  </Tab>
</Tabs>

## Next Steps

After creating a user, complete [KYC verification](/guides/kyc-flow) so they can transact.

## Errors

| Code             | Description                                       |
| ---------------- | ------------------------------------------------- |
| `USER_EXISTS`    | Mobile number already registered for this partner |
| `INVALID_MOBILE` | Invalid mobile number format                      |

<ResponseExample>
  ```json 201 (sell / both) theme={null}
  {
    "success": true,
    "data": {
      "userId": "usr_abc123def456",
      "depositAddresses": {
        "evm": "0x742d35Cc6634C0532925a3b844Bc9e7595f3A123",
        "tron": "TN7FbQz9Mwi4pPYkXRmpVMaccut3Fk8BBB"
      },
      "kycStatus": "pending"
    }
  }
  ```

  ```json 201 (pool_settlement) theme={null}
  {
    "success": true,
    "data": {
      "userId": "usr_abc123def456",
      "kycStatus": "pending"
    }
  }
  ```

  ```json 409 theme={null}
  {
    "error": "Conflict",
    "message": "User with this mobile already exists",
    "code": "USER_EXISTS"
  }
  ```
</ResponseExample>
