# Inventory Actions

The following APIs allows following actions on a single key:

* Mark Key as `active`
* Mark key as `inactive`
* `delete` a key

### Toggle Keys (Active/Inactive)

The following API allows to mark a single key as active or inactive

#### Supported arguments

{% openapi src="<https://407468006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfPzmNpsOZnU4ujov7zQD%2Fuploads%2FOcneBOxtMIY6jaeYwNCk%2Fswagger3_SAPIv1.9.json?alt=media&token=c272d2d3-ed34-4153-9dec-781487e38592>" path="/key/toggle" method="put" %}
[swagger3\_SAPIv1.9.json](https://407468006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfPzmNpsOZnU4ujov7zQD%2Fuploads%2FOcneBOxtMIY6jaeYwNCk%2Fswagger3_SAPIv1.9.json?alt=media\&token=c272d2d3-ed34-4153-9dec-781487e38592)
{% endopenapi %}

<mark style="color:green;">`PUT`</mark> `/key/toggle`

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Supported Arguments**

| Param   | Param Type | Type   | Required | Description                      |
| ------- | ---------- | ------ | -------- | -------------------------------- |
| offerId | body       | number | Yes      | ID of the Offer                  |
| type    | body       | string | Yes      | action type: `disable`, `enable` |

**Body**

```json
{
  "hash": "string",
  "type": "disable"
}
```

**Response**

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

```json
{
  "message": "string",
  "statusCode": 200
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "message": "Bad Request. Wrong/Invalid params format.",
    "statusCode": 400 
}
```

{% endtab %}

{% tab title="401" %}

```
{
    "message": "UnAuthorized request. Invalid/Expired token",
    "statusCode": 401
}
```

{% endtab %}

{% tab title="403" %}

```
{
    "message": "Forbidden Request. Action not allowed or Rate Limit exhausted.", 
    "statusCode": 403
}
```

{% endtab %}

{% tab title="500" %}

```
{
    "message": "Internal Server Error",
    "statusCode": 500
}
```

{% endtab %}
{% endtabs %}

### Delete Key

The following API removes a key from the inventory.

<mark style="color:green;">`DELETE`</mark> `/key`

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

#### Supported arguments

| Param | Param Type | Type   | Required | Description     |
| ----- | ---------- | ------ | -------- | --------------- |
| hash  | query      | string | Yes      | hash of the key |

**Response**

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

```json
{
  "message": "string",
  "statusCode": 200
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "message": "Bad Request. Wrong/Invalid params format.",
    "statusCode": 400 
}
```

{% endtab %}

{% tab title="401" %}

```
{
    "message": "UnAuthorized request. Invalid/Expired token",
    "statusCode": 401
}
```

{% endtab %}

{% tab title="403" %}

```
{
    "message": "Forbidden Request. Action not allowed or Rate Limit exhausted.", 
    "statusCode": 403
}
```

{% endtab %}

{% tab title="500" %}

```
{
    "message": "Internal Server Error",
    "statusCode": 500
}
```

{% endtab %}
{% endtabs %}

{% openapi src="<https://407468006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfPzmNpsOZnU4ujov7zQD%2Fuploads%2FOcneBOxtMIY6jaeYwNCk%2Fswagger3_SAPIv1.9.json?alt=media&token=c272d2d3-ed34-4153-9dec-781487e38592>" path="/key" method="delete" %}
[swagger3\_SAPIv1.9.json](https://407468006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfPzmNpsOZnU4ujov7zQD%2Fuploads%2FOcneBOxtMIY6jaeYwNCk%2Fswagger3_SAPIv1.9.json?alt=media\&token=c272d2d3-ed34-4153-9dec-781487e38592)
{% endopenapi %}

### Bulk Delete Keys

The following API request allow you to delete keys from inventory in bulk.

<mark style="color:green;">`POST`</mark> `/seller/offer/delete-key-bulk`

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
  "hashes": [
    "string"
  ]
}
```

| Param  | Param Type | Type           | Required | Description                               |
| ------ | ---------- | -------------- | -------- | ----------------------------------------- |
| hashes | body       | array\<string> | Yes      | array of hashes of the keys to be deleted |

**Response**

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

```json
{
  "message": "string",
  "statusCode": 0
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "message": "Bad Request. Wrong/Invalid params format.",
    "statusCode": 400 
}
```

{% endtab %}

{% tab title="401" %}

```
{
    "message": "UnAuthorized request. Invalid/Expired token",
    "statusCode": 401
}
```

{% endtab %}

{% tab title="403" %}

```
{
    "message": "Forbidden Request. Action not allowed or Rate Limit exhausted.", 
    "statusCode": 403
}
```

{% endtab %}

{% tab title="500" %}

```
{
    "message": "Internal Server Error",
    "statusCode": 500
}
```

{% endtab %}
{% endtabs %}

{% openapi src="<https://407468006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfPzmNpsOZnU4ujov7zQD%2Fuploads%2FOcneBOxtMIY6jaeYwNCk%2Fswagger3_SAPIv1.9.json?alt=media&token=c272d2d3-ed34-4153-9dec-781487e38592>" path="/seller/offer/delete-key-bulk" method="post" %}
[swagger3\_SAPIv1.9.json](https://407468006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfPzmNpsOZnU4ujov7zQD%2Fuploads%2FOcneBOxtMIY6jaeYwNCk%2Fswagger3_SAPIv1.9.json?alt=media\&token=c272d2d3-ed34-4153-9dec-781487e38592)
{% endopenapi %}
