> 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/upload-stock.md).

# Upload Stock

The following API allow you to upload inventory i.e. keys to a single Offer/Auction.

<mark style="color:green;">`PUT`</mark> `/offer/upload-keys`

**Headers**

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

**Body**

```json
{
  "offerId": 0,
  "cogs": 0,
  "keys": [
    {
      "key": "string",
      "name": "string",
      "type": "text"
    }
  ]
}
```

### Supported arguments

| Param   | Param Type | Type                                                                  | Required | Description                     |
| ------- | ---------- | --------------------------------------------------------------------- | -------- | ------------------------------- |
| offerId | body       | Number                                                                | Yes      | ID of the offer                 |
| cogs    | body       | Number                                                                | No       | Cost of purchasing a single key |
| keys    | body       | array\<KeyUploadType>,  see[#keyuploadtype](#keyuploadtype "mention") | Yes      | Array of keys to be uploaded    |

#### KeyUploadType

<table><thead><tr><th>Param</th><th>Type</th><th width="232">Required</th><th>Description</th></tr></thead><tbody><tr><td>key</td><td>string</td><td>Yes</td><td>Key in plain text or In case of image keys, Send a base64 encoded string. For more info Read <a href="https://www.rfc-editor.org/rfc/rfc2397">RFC 2397</a>.</td></tr><tr><td>name</td><td>string</td><td>Yes, in case of image key</td><td>Name of key</td></tr><tr><td>type</td><td>string</td><td>Yes</td><td>Key format. supported vlaues: <code>text</code>, <code>image</code></td></tr></tbody></table>

**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 %}
