# Users

The Users API allows you to create and manage users, access wallet balances, and handle deposits.

Each user represents an individual account entity within the Aurex system.

***

### Base URL

All endpoints are relative to:

```
https://aurex.cash/api/dashboard
```

***

### User Entity

A user object includes:

* userId Unique identifier
* firstName
* lastName
* createdAt ISO 8601 timestamp

Example:

```json
{
  "userId": "507f1f77bcf86cd799439011",
  "firstName": "John",
  "lastName": "Doe",
  "createdAt": "2026-01-31T12:00:00Z"
}
```

***

### Create User

Creates a new user account.

#### Endpoint

```
POST /users
```

#### Request Body

```json
{
  "firstName": "John",
  "lastName": "Doe"
}
```

#### Success Response

```json
{
  "success": true,
  "message": "User created successfully",
  "data": {
    "userId": "507f1f77bcf86cd799439011",
    "firstName": "John",
    "lastName": "Doe"
  }
}
```

***

### Get User Information

Returns user details by ID.

#### Endpoint

```
GET /users/{userId}
```

#### Success Response

```json
{
  "success": true,
  "data": {
    "userId": "507f1f77bcf86cd799439011",
    "firstName": "John",
    "lastName": "Doe",
    "createdAt": "2026-01-31T12:00:00Z"
  }
}
```

***

### Get Wallet Balance

Returns the wallet balance associated with a user.

#### Endpoint

```
GET /users/{userId}/wallet
```

#### Success Response

```json
{
  "success": true,
  "data": {
    "userId": "507f1f77bcf86cd799439011",
    "balance": 150.50,
    "pendingBalance": 25.00,
    "inCardsBalance": 100.00,
    "currency": "USD"
  }
}
```

#### Fields

* balance Available wallet balance
* pendingBalance Funds awaiting confirmation
* inCardsBalance Total allocated to cards
* currency Account currency

> Wallet balance and card balances are tracked separately.

***

### Create Deposit

Creates a crypto deposit request for a user.

#### Endpoint

```
POST /users/{userId}/deposits
```

#### Request Body

```json
{
  "amount": 100,
  "currency": "SOL"
}
```

#### Supported Currencies

* SOL
* USDT
* USDC

#### Success Response

```json
{
  "success": true,
  "data": {
    "depositId": "dep_abc123",
    "amount": 100,
    "netAmount": 95,
    "currency": "SOL",
    "depositAddress": "SOLANA_ADDRESS",
    "status": "waiting",
    "fees": {
      "platformFeePercent": 5,
      "platformFeeUsd": 5,
      "merchantCommissionPercent": 0,
      "merchantCommissionUsd": 0,
      "totalCollected": 5
    },
    "expiresAt": "2026-01-31T13:00:00Z"
  }
}
```

#### Deposit Status Values

* waiting
* confirmed
* failed
* expired

{% hint style="info" %}
Deposit availability depends on blockchain confirmation and network conditions.
{% endhint %}

***

### List Deposits

Returns a paginated list of deposits for a user.

#### Endpoint

```json
GET /users/{userId}/deposits
```

#### Query Parameters

* limit Number of records to return
* offset Pagination offset

Example:

```
GET /users/{userId}/deposits?limit=10&offset=0
```

#### Success Response

```json
{
  "success": true,
  "data": [
    {
      "depositId": "dep_abc123",
      "amount": 100,
      "currency": "SOL",
      "status": "confirmed",
      "createdAt": "2026-01-31T12:00:00Z"
    }
  ]
}
```

***

### Error Responses

All endpoints return errors in the following format:

```json
{
  "success": false,
  "error": "Error description"
}
```

Common HTTP status codes:

* 400 Invalid request parameters
* 401 Invalid or missing API key
* 404 Resource not found
* 429 Rate limit exceeded
