> For the complete documentation index, see [llms.txt](https://docs.driffle.com/driffle-seller-api-legacy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.driffle.com/driffle-seller-api-legacy/reference/api-reference/manage-inventory-stock/declare-stock.md).

# Declare Stock

Automate your stock with "Declared Stock"

The "Declared Stock" feature allows you to declare the number of keys you have for particular product without placing the keys to Driffle stock.

During the purchase process, Driffle.com will call your system twice. The first call will ask you to reserve the keys for a specific order - a `Reservation` request. The second one will ask you to provide the purchased keys, called a `Provision` request.

> #### Example <a href="#example" id="example"></a>
>
> You create an auction with 10 keys and using the “Declared Stock” feature declare 50 keys. This means that Driffle.com will attempt to sell 60 keys in total. First, the platform will sell 10 existing keys, then will use the "Declared Stock" feature to retrieve 50 keys more. If you create an auction with no keys and with the "Declared Stock" feature declare that you have 50 keys, then Driffle.com will attempt to retrieve those 50 keys and sell them.

**Please read the detailed** [**Declare Stock Feature Integration Guide**](/driffle-seller-api-legacy/reference/automate-your-stock-with-declare-stock.md) **to start using this API.**

This API updates the total number of declared stock for an offer.

> Example -\
> previous value of declared stock - 10\
> new value of declared stock sent in payload - 20\
> updated value of declared stock - 20<br>

<mark style="color:green;">`POST`</mark> `/offer/declare-stock/{id}`

**Headers**

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

**Body**

| Name            | Type           | Description                                    |
| --------------- | -------------- | ---------------------------------------------- |
| `declaredStock` | number \| null | Number of keys to be declared through API keys |

**Response**

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

```json
{
  "message": "string",
  "statusCode": 200,
  "data": {
    "offerId": 0,
    "declaredStock": 0,
    "totalAvailableStock": 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 %}
