# Bol accounts

## Create a new bol user in the database.

<mark style="color:green;">`POST`</mark> `https://dev.bol.mintycloud.nl/api/v1/accounts/bol`

This endpoint creates a new bol user into the database.&#x20;

#### Request Body

| Name                                       | Type   | Description                   |
| ------------------------------------------ | ------ | ----------------------------- |
| userId<mark style="color:red;">\*</mark>   | Number | db userId.                    |
| clientId<mark style="color:red;">\*</mark> | String | Bol clientId                  |
| secret<mark style="color:red;">\*</mark>   | String | Bol secret                    |
| country<mark style="color:red;">\*</mark>  | String | Country (Netherlands)         |
| label<mark style="color:red;">\*</mark>    | String | Country label (nl, be, nl-be) |

{% tabs %}
{% tab title="200: OK Created successfully bol account" %}
{% code lineNumbers="true" %}

```javascript
{
    "bolUserId": 1
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request Missing details." %}

```javascript
{
    "error": "Missing details"
}
```

{% endtab %}

{% tab title="401: Unauthorized Incorrect API key" %}

{% endtab %}

{% tab title="500: Internal Server Error Database error" %}
{% code lineNumbers="true" %}

```javascript
{
    "error": "Failed to add account"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Get all bol user.

<mark style="color:blue;">`GET`</mark> `https://dev.bol.mintycloud.nl/api/v1/accounts/bol`

This endpoint is used for getting all bol users from the database.

{% tabs %}
{% tab title="200: OK " %}

```javascript
[
    {
        "userId": 1,
        "bolUserId": 1,
        "clientId": "50343e9d-66b2-3d74-9eda-2e53485674dd6",
        "secret": ".OP!(d?#[p[D6dk?Y^1[rYCviefESOScWD3[I31d?q5!!VLv!WD7tt!xJ}ODszOP",
        "country": "Netherlands",
        "label": "nl",
        "errorCount": 0,
        "lastError": "0000-00-00 00:00:00.000"
    },
    {
        "userId": 1,
        "bolUserId": 2,
        "clientId": "50343e9d-66b2-3d74-9eda-2e53485674dd6",
        "secret": ".OP!(d?#[p[D6dk?Y^1[rYCviefESOScWD3[I31d?q5!!VLv!WD7tt!xJ}ODszOP",
        "country": "Netherlands",
        "label": "nl",
        "errorCount": 0,
        "lastError": "0000-00-00 00:00:00.000"
    }
]
```

{% endtab %}

{% tab title="401: Unauthorized Incorrect API Key" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Database error" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Get an existing bol user.

<mark style="color:blue;">`GET`</mark> `https://dev.bol.mintycloud.nl/api/v1/accounts/bol/:bolUserId`

Get a bol user by their identifier.

#### Path Parameters

| Name                                        | Type   | Description         |
| ------------------------------------------- | ------ | ------------------- |
| bolUserId<mark style="color:red;">\*</mark> | Number | Bol user identifier |

{% tabs %}
{% tab title="200: OK " %}
{% code lineNumbers="true" %}

```javascript
{
    "userId": 13,
    "bolUserId": 1,
    "clientId": "50343e9d-66b2-3d74-9eda-2e53485674dd6",
    "secret": ".OP!(d?#[p[D6dk?Y^1[rYCviefESOScWD3[I31d?q5!!VLv!WD7tt!xJ}ODszOP",
    "country": "Netherlands",
    "label": "nl",
    "errorCount": 0,
    "lastError": "0000-00-00 00:00:00.000"
}
```

{% endcode %}
{% endtab %}

{% tab title="401: Unauthorized Incorrect API key" %}

{% endtab %}

{% tab title="500: Internal Server Error Database error" %}

{% endtab %}
{% endtabs %}

## Update an existing bol user.

<mark style="color:orange;">`PUT`</mark> `https://dev.bol.mintycloud.nl/api/v1/accounts/bol/:bolUserId`

Update bol user information.

#### Path Parameters

| Name                                        | Type   | Description         |
| ------------------------------------------- | ------ | ------------------- |
| bolUserId<mark style="color:red;">\*</mark> | Number | Bol user identifier |

#### Request Body

| Name     | Type   | Description                    |
| -------- | ------ | ------------------------------ |
| clientId | String | Bol clientId                   |
| secret   | String | Bol secret                     |
| country  | String | Country (Netherlands)          |
| label    | String | Country label (nl, be, nl-be)  |
| addError | Number | Add number to the error count. |

{% tabs %}
{% tab title="200: OK Updated account successfully" %}
{% code lineNumbers="true" %}

```javascript
{
    "message": "Bol User 1 updated."
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request No data provided." %}

```javascript
{
    "error": "No data provided."
}
```

{% endtab %}

{% tab title="401: Unauthorized Incorrect API key" %}

{% endtab %}

{% tab title="500: Internal Server Error Database error" %}

{% endtab %}

{% tab title="400: Bad Request No valid data provided." %}

```javascript
{
    "error": "No valid data provided."
}
```

{% endtab %}

{% tab title="404: Not Found Didn't update any user information." %}

```javascript
{
    "error": "Didn't update any user information."
}
```

{% endtab %}
{% endtabs %}

## Delete an existing bol user.

<mark style="color:red;">`DELETE`</mark> `https://dev.bol.mintycloud.nl/api/v1/accounts/bol/:bolUserId`

Delete bol user information.

#### Path Parameters

| Name                                        | Type   | Description         |
| ------------------------------------------- | ------ | ------------------- |
| bolUserId<mark style="color:red;">\*</mark> | String | Bol user identifier |

{% tabs %}
{% tab title="204: No Content Deleted bol account successfully." %}

{% endtab %}

{% tab title="401: Unauthorized Incorrect API key" %}

{% endtab %}

{% tab title="500: Internal Server Error Database error" %}

{% endtab %}

{% tab title="404: Not Found Bol User not found." %}

```javascript
{
    "error": "Bol User not found."
}
```

{% endtab %}
{% endtabs %}
