# Request and Response

## Set discounts to product listings (A.K.A. publications) in a fixed period of time

<mark style="color:green;">`POST`</mark> `https://api.alephcrm.com/v2/productlistings/discounts`

#### Query Parameters

| Name                                                              | Type       | Description                                                                  |
| ----------------------------------------------------------------- | ---------- | ---------------------------------------------------------------------------- |
| API\_KEY<mark style="color:red;">\*</mark>                        | String     | (default=none)                                                               |
| accountId <mark style="color:red;">\*</mark>                      | Integer    | (default=none)                                                               |
| Product listings discount list <mark style="color:red;">\*</mark> | (array of) | [Broken mention](broken://pages/R5YxUlb6HYnwOaX8Wl3G#productlistingdiscount) |

{% tabs %}
{% tab title="200: OK Array of productlistings" %}

```json
{
    "Total": integer,
    "Results": [{
      "ProductListingStatus": [{ProductListingDiscountType}],
      "Status": integer,
      "Message": string
    }]
}
```

{% endtab %}

{% tab title="300: Multiple Choices {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="304: Not Modified " %}

```
{
    "Total": integer,
    "Results": [{
      "ProductListingStatus": [{ProductListingDiscountType}],
      "Status": integer,
      "Message": string
    }]
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```
{
    "Total": integer,
    "Results": [{
      "ProductListingStatus": [{ProductListingDiscountType}],
      "Status": integer,
      "Message": string
    }]
}
```

{% endtab %}

{% tab title="401: Unauthorized {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="403: Forbidden {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="404: Not Found {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="500: Internal Server Error string" %}

{% endtab %}

{% tab title="406: Not Acceptable {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="412: Precondition Failed {"Status": integer, "Message": string}" %}

{% endtab %}

{% tab title="429: Too Many Requests {"Status": integer, "Message": string}" %}

{% endtab %}
{% endtabs %}

## Parameters details

### API\_KEY

The API\_KEY that was provided.

### accountId

The Alephee account ID of the orders you are trying to get.

### Product listings discount list

The list of product listings needed to change.\
You can set a discount to a list of product listings by indicating the brand/sku of the product OR a list of product listings IDs from each marketplace. One or the other. Not both.\
• When setting product brand/SKU this method will attempt to set the given discount of all the product listings belonging to that product.\
• When setting product listing IDs, this method will attempt to set the given discount of all the indicated product listings.\
The start and ending dates must be provided in a datetime without timezone property and the hour part given in UTC fixed time. The start date and time must be later than the current date and time.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.alephee.com/v2/product-listings/post-methods/set-product-listings-discounts/request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
