# Wallet

## Module endpoints

* [`GET /wallets`](#get-wallets)
* [`GET /wallets/:id`](#get-wallets-id)
* [`GET /wallets/:id/activity`](#get-wallets-id-activity)
* [`GET /wallets/:id/balance`](#get-wallets-id-balance)
* [`GET /wallets/:id/movements`](/slyk/reference/endpoints.md#get-wallets-id-movements)
* [`GET /wallets/:id/transactions`](#get-wallets-id-transactions)
* [`GET /wallets/activity`](#get-wallets-activity)
* [`GET /wallets/balance`](#get-wallets-balance)
* [`PATCH /wallets/:id`](#patch-wallets-id)
* [`POST /wallets`](#post-wallets)

### `GET /wallets`

> `GET` <https://api.slyk.i&#x6F;**/wallets>\*\*

Retrieves a paginated list of `wallets`.

{% tabs %}
{% tab title="Available Filters" %}

| Name          | Type           | Example                                                |
| ------------- | -------------- | ------------------------------------------------------ |
| **id**        | `=` `in` `nin` | `filter[id]=in:fc78d28f-a8dd-49de-a22f-722fe3bd26c7`   |
| **locked**    | `=`            | `filter[locked]=true`                                  |
| **name**      | `like`         | `filter[name]=foobar`                                  |
| **ownerId**   | `=`            | `filter[ownerId]=3feaac72-7330-4b32-9801-28b6f69aaf25` |
| **reference** | `=`            | `filter[reference]=123456789A`                         |

{% hint style="info" %}
The `name` filter performs a `SQL` query using the `like` operator.
{% endhint %}
{% endtab %}

{% tab title="Available Sorts" %}

| Name          | Example          |
| ------------- | ---------------- |
| **createdAt** | `sort=createdAt` |
| {% endtab %}  |                  |

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "createdAt": "2019-03-20T14:30:37.483Z",
      "customData": {},
      "description": null,
      "id": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
      "locked": false,
      "metadata": {},
      "name": "Waldo Fred wallet",
      "ownerId": "5a9cf5ad-3999-497a-927e-da7157dc43a6",
      "reference": "123456789A",
      "updatedAt": "2019-03-20T14:30:37.483Z"
    },
    {
      "createdAt": "2019-03-20T15:30:37.483Z",
      "customData": {},
      "description": null,
      "id": "d9227cef-82b3-4753-b576-46735971774d",
      "locked": false,
      "metadata": {},
      "name": "Corge Garply wallet",
      "ownerId": "0bf8ee88-aed1-442c-a191-ffcee735b38a",
      "reference": "123456789B",
      "updatedAt": "2019-03-20T15:30:37.483Z"
    }
  ],
  "total": 2
}
```

{% endtab %}
{% endtabs %}

### `GET /wallets/:id`

> `GET` <https://api.slyk.i&#x6F;**/wallets/:id>\*\*

Gets the wallet details of the given `id`.

{% tabs %}
{% tab title="Response" %}

```javascript
{
  "data": {
    "createdAt": "2019-03-20T14:30:37.483Z",
    "customData": {},
    "description": null,
    "id": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
    "locked": false,
    "metadata": {},
    "name": "Waldo Fred wallet",
    "ownerId": "5a9cf5ad-3999-497a-927e-da7157dc43a6",
    "reference": "123456789A",
    "updatedAt": "2019-03-20T14:30:37.483Z"
  }
}
```

{% endtab %}
{% endtabs %}

### `GET /wallets/:id/activity`

> `GET` <https://api.slyk.i&#x6F;**/wallets/:id/activity>\*\*

Returns the `wallet` activity of the given `id`.

{% tabs %}
{% tab title="Available Filters" %}

| Name          | Type           | Example                     |
| ------------- | -------------- | --------------------------- |
| **assetCode** | `=` `in` `nin` | `filter[assetCode]=in:ltc`  |
| **code**      | `=` `in` `nin` | `filter[code]=in:issue`     |
| **status**    | `=` `in` `nin` | `filter[status]=in:pending` |
| **type**      | `=` `in` `nin` | `filter[type]=in:deposit`   |
| {% endtab %}  |                |                             |

{% tab title="Available Sorts" %}

| Name          | Example           |
| ------------- | ----------------- |
| **amount**    | `sort=amount`     |
| **createdAt** | `sort=-createdAt` |
| {% endtab %}  |                   |

{% tab title="Available Includes" %}

| Name         | Example           |
| ------------ | ----------------- |
| **users**    | `include=users`   |
| **wallets**  | `include=wallets` |
| {% endtab %} |                   |

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "amount": "5.00000000",
      "assetCode": "foo",
      "code": "issue",
      "createdAt": "2019-02-04T19:06:40.712Z",
      "customData": { "foo": "bar" },
      "destinationAddress": null,
      "destinationWallet": {
        "createdAt": "2019-03-20T14:30:37.483Z",
        "customData": {},
        "id": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
        "locked": false,
        "metadata": {},
        "name": "Waldo Fred wallet",
        "ownerId": "dcdbf851-f4db-468b-9235-37ef6e6306a1",
        "reference": "123456789A",
        "updatedAt": "2019-03-20T14:30:37.483Z"
      },
      "destinationWalletId": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
      "destinationWalletUser": {
        "approved": true,
        "blocked": false,
        "createdAt": "2019-07-17T11:39:26.732Z",
        "customData": {},
        "email": "foo@bar.com",
        "id": "dcdbf851-f4db-468b-9235-37ef6e6306a1",
        "locale": "en",
        "name": "Waldo Fred"
        "phone": "+351912345678",
        "primaryWalletId": "5a9cf5ad-3999-497a-927e-da7157dc43a6",
        "referralCode": "R12345678",
        "roles": ["user"],
        "updatedAt": "2019-07-17T11:39:26.732Z",
        "verified": true
      },
      "externalId": null,
      "id": "06788310-8de1-4afe-b0b4-1293b1ed10c1",
      "metadata": { "foo": "biz" },
      "originAddress": null,
      "originWalletId": null,
      "status": "pending",
      "type": "deposit",
      "updatedAt": "2019-02-04T19:06:40.712Z"
    },
    {
      "amount": "6.00000000",
      "assetCode": "garply",
      "code": "burn",
      "createdAt": "2019-02-04T19:06:40.712Z",
      "customData": { "foo": "bar" },
      "destinationWalletId": null,
      "externalId": null,
      "id": "06788310-8de1-4afe-b0b4-1293b1ed10c1",
      "metadata": { "foo": "biz" },
      "originWallet": {
        "createdAt": "2019-03-20T15:30:37.483Z",
        "customData": {},
        "id": "d9227cef-82b3-4753-b576-46735971774d",
        "locked": false,
        "metadata": {},
        "name": "Corge Garply wallet",
        "ownerId": "dcdbf851-f4db-468b-9235-37ef6e6306a1",
        "reference": "123456789B",
        "updatedAt": "2019-03-20T15:30:37.483Z"
      },
      "originWalletId": "d9227cef-82b3-4753-b576-46735971774d",
      "originWalletUser": {
        "approved": true,
        "blocked": false,
        "createdAt": "2019-07-17T11:39:26.732Z",
        "customData": {},
        "email": "foo@bar.com",
        "id": "dcdbf851-f4db-468b-9235-37ef6e6306a1",
        "locale": "en",
        "name": "Corge Garply"
        "phone": "+351912345678",
        "primaryWalletId": "d9227cef-82b3-4753-b576-46735971774d",
        "referralCode": "R87654321",
        "roles": ["user"],
        "updatedAt": "2019-07-17T11:39:26.732Z",
        "verified": true
      },
      "status": "pending",
      "type": "withdrawal",
      "updatedAt": "2019-02-04T19:06:40.712Z"
    }
  ],
  "total": 4
}
```

{% endtab %}
{% endtabs %}

### **`GET /wallets/:id/balance`**

> `GET` <https://api.slyk.i&#x6F;**/wallets/:id/balance>\*\*

Retrieves a wallet's balance for the various assets it contains. Only assets that were ever transacted on the wallet will be shown (even if their balance is currently zero).

{% tabs %}
{% tab title="Available Filters" %}

| Name          | Type           | Example                            |
| ------------- | -------------- | ---------------------------------- |
| **assetCode** | `=` `in` `nin` | `filter[assetCode]=in:btc,eth,ltc` |
| {% endtab %}  |                |                                    |

{% tab title="Response" %}

```javascript
{
  "data": [
    { "assetCode": "bar", "amount": "10.00000000" },
    { "assetCode": "biz", "amount": "3.50000000"}
  ]
}
```

{% endtab %}
{% endtabs %}

### `GET /wallets/:id/movements`

> `GET` <https://api.slyk.i&#x6F;**/wallets/:id/movements>\*\*

Convenience endpoint to get a paginated list of `movements` from the wallet of the given `id`.

{% tabs %}
{% tab title="Available Filters" %}

<table data-header-hidden><thead><tr><th>Name</th><th width="150">Type</th><th>Example</th></tr></thead><tbody><tr><td>Name</td><td>Type</td><td>Example</td></tr><tr><td><strong>assetCode</strong></td><td><code>=</code> <code>in</code> <code>nin</code></td><td><code>filter[assetCode]=in:eur,btc</code></td></tr></tbody></table>
{% endtab %}

{% tab title="Available Sorts" %}

| Name          | Example           |
| ------------- | ----------------- |
| **amount**    | `sort=amount`     |
| **createdAt** | `sort=-createdAt` |
| {% endtab %}  |                   |

{% tab title="Available Includes" %}

| Name            | Example               |
| --------------- | --------------------- |
| **transaction** | `include=transaction` |
| {% endtab %}    |                       |

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "amount": "4.50000000",
      "assetCode": "garply",
      "code": "deposit",
      "createdAt": "2019-03-20T14:30:37.483Z",
      "id": "4617b329-eca0-487d-9086-9bbf833b6c86",
      "transaction": {
        "amount": "4.50000000",
        "assetCode": "garply",
        "code": "deposit",
        "createdAt": "2019-03-20T14:30:37.483Z",
        "customData": { "foo": "bar" },
        "description": "foobar",
        "destinationAddress": null,
        "destinationWalletId": "d4f146bf-4c01-4efc-bc3e-2f9663dc7256",
        "externalId": null,
        "id": "307d1665-23ba-4ff1-9f0a-1a5f480e5a10",
        "metadata": {},
        "originAddress": null,
        "originWalletId": null,
        "status": "confirmed",
        "type": "deposit",
        "updatedAt": "2019-03-20T14:30:37.483Z"
      },
      "transactionId": "307d1665-23ba-4ff1-9f0a-1a5f480e5a10",
      "updatedAt": "2019-03-20T14:30:37.483Z",
      "walletId": "d4f146bf-4c01-4efc-bc3e-2f9663dc7256"
    },
    {
      "amount": "6.00000000",
      "assetCode": "garply",
      "code": "deposit",
      "createdAt": "2017-10-18T11:39:26.732Z",
      "id": "5c4a04cc-4e48-4829-bd81-692bb0f0ac08",
      "transaction": {
        "amount": "6.00000000",
        "assetCode": "garply",
        "code": "deposit",
        "createdAt": "2017-10-18T11:39:26.732Z",
        "customData": { "foo": "bar" },
        "description": "foobiz",
        "destinationAddress": null,
        "destinationWalletId": "c7b0fddf-48a9-4867-b712-c71559cf81ac",
        "externalId": null,
        "id": "e3fd199c-b137-4cb3-9644-533345239772",
        "metadata": {},
        "originAddress": null,
        "originWalletId": null,
        "status": "confirmed",
        "type": "deposit",
        "updatedAt": "2017-10-18T11:39:26.732Z"
      },
      "transactionId": "e3fd199c-b137-4cb3-9644-533345239772",
      "updatedAt": "2017-10-18T11:39:26.732Z",
      "walletId": "c7b0fddf-48a9-4867-b712-c71559cf81ac"
    }
  ],
  "total": 4
}
```

{% endtab %}
{% endtabs %}

### `GET /wallets/:id/transactions`

> `GET` <https://api.slyk.i&#x6F;**/wallets/:id/transactions>\*\*

Convenience endepoint endpoint to get a paginated list of `transactions` where the wallet `id` may be either the `destinationWalletId` or the `originWalletId` of the Transaction object.

{% tabs %}
{% tab title="Available Filters" %}

<table data-header-hidden><thead><tr><th width="326.8181818181818">Name</th><th width="150">Type</th><th>Example</th></tr></thead><tbody><tr><td>Name</td><td>Type</td><td>Example</td></tr><tr><td><strong>assetCode</strong></td><td><code>=</code> <code>in</code> <code>nin</code></td><td><code>filter[assetCode]=in:usd,eur</code></td></tr><tr><td><strong>code</strong></td><td><code>=</code> <code>in</code> <code>nin</code></td><td><code>filter[code]=in:issue</code></td></tr><tr><td><strong>status</strong></td><td><code>=</code> <code>in</code> <code>nin</code></td><td><code>filter[status]=in:pending</code></td></tr><tr><td><strong>type</strong></td><td><code>=</code> <code>in</code> <code>nin</code></td><td><code>filter[type]=in:deposit</code></td></tr></tbody></table>
{% endtab %}

{% tab title="Available Sorts" %}

| Name          | Example           |
| ------------- | ----------------- |
| **amount**    | `sort=amount`     |
| **createdAt** | `sort=-createdAt` |
| {% endtab %}  |                   |

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "amount": "5.00000000",
      "assetCode": "foo",
      "code": "issue",
      "createdAt": "2019-02-04T19:06:40.712Z",
      "customData": { "foo": "bar" },
      "destinationAddress": null,
      "destinationWalletId": "9afa8a2d-023a-4040-b591-c03077f43d23",
      "externalId": null,
      "id": "06788310-8de1-4afe-b0b4-1293b1ed10c1",
      "metadata": { "foo": "biz" },
      "originAddress": null,
      "originWalletId": null,
      "status": "pending",
      "type": "deposit",
      "updatedAt": "2019-02-04T19:06:40.712Z"
    },
    {
      "amount": "6.00000000",
      "assetCode": "garply",
      "code": "burn",
      "createdAt": "2019-02-04T19:06:40.712Z",
      "customData": { "foo": "bar" },
      "destinationWalletId": null,
      "externalId": null,
      "id": "06788310-8de1-4afe-b0b4-1293b1ed10c1",
      "metadata": { "foo": "biz" },
      "originWalletId": "9afa8a2d-023a-4040-b591-c03077f43d23",
      "status": "pending",
      "type": "withdrawal",
      "updatedAt": "2019-02-04T19:06:40.712Z"
    }
  ],
  "total": 4
}
```

{% endtab %}
{% endtabs %}

### `GET /wallets/activity`

> `GET` <https://api.slyk.i&#x6F;**/wallets/activity>\*\*

Returns the `wallets` activity.

{% tabs %}
{% tab title="Available Filters" %}

| Name          | Type           | Example                     |
| ------------- | -------------- | --------------------------- |
| **assetCode** | `=` `in` `nin` | `filter[assetCode]=in:btc`  |
| **code**      | `=` `in` `nin` | `filter[code]=in:issue`     |
| **status**    | `=` `in` `nin` | `filter[status]=in:pending` |
| **type**      | `=` `in` `nin` | `filter[type]=in:deposit`   |
| {% endtab %}  |                |                             |

{% tab title="Available Sorts" %}

| Name          | Example           |
| ------------- | ----------------- |
| **amount**    | `sort=amount`     |
| **createdAt** | `sort=-createdAt` |
| {% endtab %}  |                   |

{% tab title="Available Includes" %}

| Name         | Example           |
| ------------ | ----------------- |
| **users**    | `include=users`   |
| **wallets**  | `include=wallets` |
| {% endtab %} |                   |

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "amount": "5.00000000",
      "assetCode": "foo",
      "code": "issue",
      "createdAt": "2019-02-04T19:06:40.712Z",
      "customData": { "foo": "bar" },
      "destinationAddress": null,
      "destinationWallet": {
        "createdAt": "2019-03-20T14:30:37.483Z",
        "customData": {},
        "id": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
        "locked": false,
        "metadata": {},
        "name": "Waldo Fred wallet",
        "ownerId": "dcdbf851-f4db-468b-9235-37ef6e6306a1",
        "reference": "123456789A",
        "updatedAt": "2019-03-20T14:30:37.483Z"
      },
      "destinationWalletId": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
      "destinationWalletUser": {
        "approved": true,
        "blocked": false,
        "createdAt": "2019-07-17T11:39:26.732Z",
        "customData": {},
        "email": "foo@bar.com",
        "id": "dcdbf851-f4db-468b-9235-37ef6e6306a1",
        "locale": "en",
        "name": "Waldo Fred"
        "phone": "+351912345678",
        "primaryWalletId": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
        "referralCode": "R12345678",
        "roles": ["user"],
        "updatedAt": "2019-07-17T11:39:26.732Z",
        "verified": true
      },
      "externalId": null,
      "id": "06788310-8de1-4afe-b0b4-1293b1ed10c1",
      "metadata": { "foo": "biz" },
      "originAddress": null,
      "originWalletId": null,
      "status": "pending",
      "type": "deposit",
      "updatedAt": "2019-02-04T19:06:40.712Z"
    },
    {
      "amount": "6.00000000",
      "assetCode": "garply",
      "code": "burn",
      "createdAt": "2019-02-04T19:06:40.712Z",
      "customData": { "foo": "bar" },
      "destinationWalletId": null,
      "externalId": null,
      "id": "06788310-8de1-4afe-b0b4-1293b1ed10c1",
      "metadata": { "foo": "biz" },
      "originWallet": {
        "createdAt": "2019-03-20T15:30:37.483Z",
        "customData": {},
        "id": "d9227cef-82b3-4753-b576-46735971774d",
        "locked": false,
        "metadata": {},
        "name": "Corge Garply wallet",
        "ownerId": "dcdbf851-f4db-468b-9235-37ef6e6306a1",
        "reference": "123456789B",
        "updatedAt": "2019-03-20T15:30:37.483Z"
      },
      "originWalletId": "d9227cef-82b3-4753-b576-46735971774d",
      "originWalletUser": {
        "approved": true,
        "blocked": false,
        "createdAt": "2019-07-17T11:39:26.732Z",
        "customData": {},
        "email": "foo@bar.com",
        "id": "dcdbf851-f4db-468b-9235-37ef6e6306a1",
        "locale": "en",
        "name": "Corge Garply"
        "phone": "+351912345678",
        "primaryWalletId": "d9227cef-82b3-4753-b576-46735971774d",
        "referralCode": "R87654321",
        "roles": ["user"],
        "updatedAt": "2019-07-17T11:39:26.732Z",
        "verified": true
      },
      "status": "pending",
      "type": "withdrawal",
      "updatedAt": "2019-02-04T19:06:40.712Z"
    }
  ],
  "total": 4
}
```

{% endtab %}
{% endtabs %}

### `GET /wallets/balance`

> `GET` <https://api.slyk.i&#x6F;**/wallets/balance>\*\*

Retrieves a Slyk balance for the various assets it contains. Only assets that were ever transacted on the wallet will be shown (even if their balance is currently zero).

{% tabs %}
{% tab title="Available Filters" %}

| Name          | Type           | Example                        |
| ------------- | -------------- | ------------------------------ |
| **assetCode** | `=` `in` `nin` | `filter[assetCode]=in:usd,eur` |
| {% endtab %}  |                |                                |

{% tab title="Response" %}

```javascript
{
  "data": [
    { "assetCode": "bar", "amount": "10.00000000" },
    { "assetCode": "biz", "amount": "3.50000000"}
  ]
}
```

{% endtab %}
{% endtabs %}

### **`PATCH /wallets/:id`**

> `PATCH` <https://api.slyk.i&#x6F;**/wallets/:id>\*\*

Patch the `wallet` details of the given `id`.

{% tabs %}
{% tab title="Request Parameters" %}

| Name           | Type      | Required | Description           |
| -------------- | --------- | -------- | --------------------- |
| **customData** | `object`  | `false`  | Custom data object    |
| **locked**     | `boolean` | `false`  | Wallet lock status    |
| **ownerId**    | `string`  | `false`  | Wallet owner `user`id |
| {% endtab %}   |           |          |                       |

{% tab title="Request" %}

```javascript
{
    "customData": { 
        "description": "Someone's first wallet"
    }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "createdAt": "2019-03-20T14:30:37.483Z",
    "customData": { "qux": "quux" },
    "locked": false,
    "id": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
    "metadata": {},
    "name": "Foobar wallet",
    "reference": "123456789A",
    "updatedAt": "2019-03-20T14:30:37.483Z"
  }
}
```

{% endtab %}
{% endtabs %}

### `POST /wallets`

> `POST` <https://api.slyk.i&#x6F;**/wallets>\*\*

Creates a new `wallet`.

{% tabs %}
{% tab title="Request Parameters" %}

<table data-header-hidden><thead><tr><th>Name</th><th width="307">Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>Type</td><td>Required</td><td>Description</td></tr><tr><td><strong>customData</strong></td><td><code>object</code></td><td><code>false</code></td><td>Custom data object</td></tr><tr><td><strong>locked</strong></td><td><code>boolean</code></td><td><code>false</code></td><td>Wallet lock status</td></tr><tr><td><strong>name</strong></td><td><code>string</code></td><td><code>false</code></td><td>Wallet Name </td></tr><tr><td><strong>ownerId</strong></td><td><code>string</code></td><td><code>false</code></td><td>Wallet owner <code>user</code> id</td></tr></tbody></table>
{% endtab %}

{% tab title="Request" %}

```javascript
{
    "name": "Savings",
    "ownerId": "0bf8ee88-aed1-442c-a191-ffcee735b38a"
}
```

{% endtab %}

{% tab title="Response" %}
**200 Success**

```javascript
{
  "data": {
    "createdAt": "2019-03-20T14:30:37.483Z",
    "customData": { "qux": "quux" },
    "locked": false,
    "id": "fc78d28f-a8dd-49de-a22f-722fe3bd26c7",
    "metadata": {},
    "name": "Foobar wallet",
    "reference": "123456789A",
    "updatedAt": "2019-03-20T14:30:37.483Z"
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.slyk.io/slyk/reference/endpoints/wallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
