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

# Register Wallet

> POST /v1/wallets/register — Register a wallet for your organization (idempotent)

<Note>
  **Endpoint:** `POST https://api.rebelfi.io/v1/wallets/register`
</Note>

Register a wallet address with your organization. Registration is **idempotent** — calling it again with the same address returns the existing wallet.

### Request Body

| Field           | Type     | Required | Description                                                    |
| --------------- | -------- | -------- | -------------------------------------------------------------- |
| `walletAddress` | `string` | Yes      | Wallet address on the blockchain                               |
| `blockchain`    | `string` | Yes      | Blockchain network: `solana`, `polygon`, `ethereum`, or `base` |
| `userId`        | `string` | No       | Your external user or account ID (for multi-wallet management) |
| `orgMetadata`   | `object` | No       | Arbitrary metadata to store with the wallet                    |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.rebelfi.io/v1/wallets/register" \
    -H "x-api-key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "walletAddress": "So11...abc",
      "blockchain": "solana",
      "userId": "user-123",
      "orgMetadata": { "plan": "premium" }
    }'
  ```

  ```typescript SDK theme={null}
  const wallet = await client.wallets.register({
    walletAddress: 'So11...abc',
    blockchain: 'solana',
    userId: 'user-123',
    orgMetadata: { plan: 'premium' }
  });
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "walletId": 42,
  "walletAddress": "So11...abc",
  "blockchain": "solana",
  "userId": "user-123",
  "orgMetadata": { "plan": "premium" },
  "createdAt": "2024-01-15T10:30:00.000Z"
}
```

### Response Fields

| Field           | Type      | Description                                      |
| --------------- | --------- | ------------------------------------------------ |
| `walletId`      | `number`  | Wallet identifier (use for subsequent API calls) |
| `walletAddress` | `string`  | Wallet address on the blockchain                 |
| `blockchain`    | `string`  | Blockchain network                               |
| `userId`        | `string?` | External user ID                                 |
| `orgMetadata`   | `object?` | Organization-specific metadata                   |
| `createdAt`     | `string`  | Creation timestamp (ISO 8601)                    |

<Info>
  Registration is idempotent. If you register the same wallet address again, it returns the existing wallet without error.
</Info>
