> 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/offers-auction/create-a-new-offer.md).

# Create a new offer

configures automated price adjustments for an offerconfigures automated price adjustments for an offerconfigures automated price adjustments for an offeThe following API allow you to create a new offer/auction on Driffle.

<mark style="color:green;">`POST`</mark> `/offer`

**Headers**

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

**Response**

### Required arguments

| Param       | Param Type | Type                  | Required                                         | Description                                                              |
| ----------- | ---------- | --------------------- | ------------------------------------------------ | ------------------------------------------------------------------------ |
| product     | body       | { productId: number } | Yes                                              | ProductId for which offer needs to be created                            |
| yourPrice   | body       | Number                | No (Either yourPrice or retailPrice is required) | Selling price. Commission will be applied to this price.                 |
| retailPrice | body       | Number                | No (Either yourPrice or retailPrice is required) | Retail Price or Buy Box Price. Commission is subtracted from this price. |

### Optional arguments

#### **Case - Declared Stock**&#x20;

{% hint style="warning" %}

1. Either keys or declaredStock number should be provided in the request.
2. Either yourPrice or retailPrice should be provided in the request.
   {% endhint %}

| Param                | Param Type | Type                                                                                                                                  | Required                                         | Description                                                                                                                                                                        |
| -------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| product              | body       | { productId: number }                                                                                                                 | Yes                                              | ProductId for which offer needs to be created                                                                                                                                      |
| yourPrice            | body       | Number                                                                                                                                | No (Either yourPrice or retailPrice is required) | Selling price. Commission will be applied to this price.                                                                                                                           |
| retailPrice          | body       | Number                                                                                                                                | No (Either yourPrice or retailPrice is required) | Retail Price or Buy Box Price. Commission is subtracted from this price.                                                                                                           |
| cogs                 | body       | Number                                                                                                                                | No                                               | Cost of purchasing a single key                                                                                                                                                    |
| keys                 | body       | array\<KeyUploadType>, see [#keyuploadtype](#keyuploadtype "mention")                                                                 | No                                               | List of Keys to be uploaded - optional                                                                                                                                             |
| declaredStock        | body       | Number                                                                                                                                | No                                               | Number of keys to sell through declared stock feature -  optional                                                                                                                  |
| wholesale            | body       | `{"enabled":true,"tiers":[{"level":1,"discount":10},{"level":2,"discount":15}]}`                                                      | No                                               | <p>Specifies wholesale enable status and tier-based discounts by purchase quantity.  </p><p><a data-mention href="/pages/CHpnEoAKrUwG83s8QSGk">/pages/CHpnEoAKrUwG83s8QSGk</a></p> |
| automatePriceOptions | body       | `{"lowerPriceLimit":8.99,"upperPriceLimit":12.99,"priceChangeFactor":0.05,"priceChangeInterval":3600,"automatePriceStatus":"enable"}` | No                                               | configures automated price adjustments for an offer [Automate Pricing](/driffle-seller-api-legacy/reference/automate-pricing.md)                                                   |

#### **Case - Direct Topup webhook**

| Param                | Param Type | Type                                                                                                                                  | Required                                         | Description                                                                                                                      |
| -------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| product              | body       | { productId: number }                                                                                                                 | Yes                                              | ProductId for which offer needs to be created                                                                                    |
| yourPrice            | body       | Number                                                                                                                                | No (Either yourPrice or retailPrice is required) | Selling price. Commission will be applied to this price.                                                                         |
| retailPrice          | body       | Number                                                                                                                                | No (Either yourPrice or retailPrice is required) | Retail Price or Buy Box Price. Commission is subtracted from this price.                                                         |
| cogs                 | body       | Number                                                                                                                                | No                                               | Cost of purchasing a single key                                                                                                  |
| declaredStock        | body       | Number                                                                                                                                | Yes                                              | Number of direct topup allowed for sell                                                                                          |
| automatePriceOptions | body       | `{"lowerPriceLimit":8.99,"upperPriceLimit":12.99,"priceChangeFactor":0.05,"priceChangeInterval":3600,"automatePriceStatus":"enable"}` | No                                               | configures automated price adjustments for an offer [Automate Pricing](/driffle-seller-api-legacy/reference/automate-pricing.md) |

#### **Case - Pre-Order Product**

{% hint style="warning" %} <mark style="color:green;">**Declared stock is now available for pre-order products.**</mark>

For more details, see the [Pre-Order-Declare-Stock](/driffle-seller-api-legacy/reference/pre-order-declare-stock.md) documentation.
{% endhint %}

<table><thead><tr><th>Param</th><th>Param Type</th><th width="200">Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>product</td><td>body</td><td>{ productId: number }</td><td>Yes</td><td>ProductId for which offer needs to be created</td></tr><tr><td>yourPrice</td><td>body</td><td>Number</td><td>No (Either yourPrice or retailPrice is required)</td><td>Selling price. Commission will be applied to this price.</td></tr><tr><td>retailPrice</td><td>body</td><td>Number</td><td>No (Either yourPrice or retailPrice is required)</td><td>Retail Price or Buy Box Price. Commission is subtracted from this price.</td></tr><tr><td>cogs</td><td>body</td><td>Number</td><td>No</td><td>Cost of purchasing a single key</td></tr><tr><td>keys</td><td>body</td><td>array&#x3C;KeyUploadType>, see <a data-mention href="#keyuploadtype">#keyuploadtype</a></td><td>No</td><td>List of Keys to be uploaded - optional</td></tr><tr><td>auctionedKeys</td><td>body</td><td>Number</td><td>Yes</td><td>Maximum number of orders you can accept for a product (Only in preReleased products)</td></tr></tbody></table>

#### KeyUploadType&#x20;

| Param | Type   | Required                  | Description                                                                                                                                      |
| ----- | ------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| key   | string | Yes                       | Key in plain text or In case of image keys, Send a base64 encoded string. For more info Read [RFC 2397](https://www.rfc-editor.org/rfc/rfc2397). |
| name  | string | Yes, in case of image key | Name of key                                                                                                                                      |
| type  | string | Yes                       | Key format. supported values: `text`, `image`                                                                                                    |

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

```json
{
  "message": "string",
  "statusCode": 200,
  "offer": {
    "offerId": 0,
    "productId": 0,
    "yourPrice": 0,
    "finalSellingPrice": 0,
    "availableStock": 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="/files/tEroTEtPC9evUumXzEL2" path="/offer" method="post" %}
[swagger-3.1.3.json](https://407468006-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfPzmNpsOZnU4ujov7zQD%2Fuploads%2FGJM0JzGLlFvZCh6JCSti%2Fswagger-3.1.3.json?alt=media\&token=bdd6043d-7f7a-4bde-a491-fade2a449f6a)
{% endopenapi %}
