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

# Competition

Gets the information about products' available Offers.

### Supported Arguments ( For single Product ) <a href="#for-single-product" id="for-single-product"></a>

The following arguments are supported by competitions API:

<mark style="color:green;">`GET`</mark> `/products/{pid}/competitions` \
**Headers**

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

<table data-full-width="false"><thead><tr><th>Param</th><th>Param type</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>pid</td><td>path param</td><td>Number</td><td>Yes</td><td>Driffle Product ID</td></tr></tbody></table>

| Name   | Type   | Description      |
| ------ | ------ | ---------------- |
| `name` | string | Name of the user |
| `age`  | number | Age of the user  |

**Response**

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

```json
{
  "message": "Default Response",
  "statusCode": 200,
  "pid": 123,
  "competitions": {
    "totalCount": 10,
    "offers": [
      {
        "merchantName": "Merchant A",
        "isInStock": true,
        "canBePurchased": true,
        "belongsToYou": false,
        "price": {
          "amount": 29.99,
          "currency": "USD"
        }
      }
    ],
    "wholesaleOffers": [
      {
        "merchantName": "Merchant A",
        "isInStock": true,
        "canBePurchased": true,
        "belongsToYou": false,
        "price": {
          "amount": 29.99,
          "currency": "USD"
        },
        "levelRange": "10 to 99 Keys"
      },
      {
        "merchantName": "Merchant A",
        "isInStock": true,
        "canBePurchased": true,
        "belongsToYou": false,
        "price": {
          "amount": 29.99,
          "currency": "USD"
        },
        "levelRange": "100+ Keys"
      }
    ]
  }
}
```

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

### Supported Arguments ( For All Products with pagination ) <a href="#for-all-products" id="for-all-products"></a>

The following arguments are supported by competitions API:

<mark style="color:green;">`GET`</mark> `/products/competitions` \
**Headers**

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

<table data-full-width="false"><thead><tr><th>Param</th><th>Param type</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>productIds</td><td>path param</td><td>String </td><td>No</td><td>Driffle Product ID (must be comma seprated <code>e.g: productIds=34547,299</code>)</td></tr><tr><td>onlyMappedProducts</td><td>path param</td><td>Boolean</td><td>No</td><td>supported values <code>true</code> or <code>false</code></td></tr><tr><td>page</td><td>path param</td><td>Number</td><td>No</td><td>age number. Use this to traverse through your list of keys. Default value: <code>1</code></td></tr><tr><td>limit</td><td>path param</td><td>Number</td><td>No</td><td>Specifies the number of items to fetch per page; valid values range from <strong>10 to 200</strong>.</td></tr></tbody></table>

**Response**

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

```json
{
  "statusCode": 200,
  "message": "success",
  "data": [
    {
      "pid": 1075,
      "competitions": {
        "totalCount": 1,
        "offers": [
          {
            "merchantName": "Merchant A",
            "isInStock": true,
            "canBePurchased": true,
            "belongsToYou": false,
            "price": {
              "amount": 3.57,
              "currency": "EUR"
            }
          }
        ],
        "wholesaleOffers": [
          {
            "merchantName": "Merchant A",
            "isInStock": true,
            "canBePurchased": true,
            "belongsToYou": false,
            "price": {
              "amount": 2.3,
              "currency": "EUR"
            },
            "levelRange": "10 to 99 Keys"
          },
          {
            "merchantName": "Merchant A",
            "isInStock": true,
            "canBePurchased": true,
            "belongsToYou": false,
            "price": {
              "amount": 2.29,
              "currency": "EUR"
            },
            "levelRange": "100+ Keys"
          }
        ],
        "wholesaleTotalCount": 1
      }
    }
  ],
  "pagination": {
    "page": 1,
    "currentPage": 1,
    "limit": 50,
    "totalCount": 1,
    "totalPages": 1
  }
}
```

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