# Mark Product Availability

## Marks Product Availability

<mark style="color:green;">`POST`</mark> `https://{workspace}.myeshopbox.com/product-engine/api/v2/productListing`

This endpoint marks a product available or unavailable on one sales channel, subscribed by the workspace.

#### Headers

| Name           | Type   | Description                                 |
| -------------- | ------ | ------------------------------------------- |
| Authentication | string | The Bearer token to grant access to the API |

#### Request Body

| Name         | Type    | Description                                     |
| ------------ | ------- | ----------------------------------------------- |
| availability | boolean | true for marking available else false           |
| channelCode  | string  | mark product availability on this sales channel |
| esin         | string  | ESIN of the product                             |

{% tabs %}
{% tab title="200 The API returns the 200:OK response with same response as request, if the mark availability/unavailability of the product is success." %}

```
{
	"esin" : "0SGAT12SG25F",
	"channelCode" : "CH1234",
	"availability" : false
}
```

{% endtab %}

{% tab title="412 If some mandatory custom field(s) is/are not mapped with this product for a given channel, then the returned error list the comma separated custom fields, which needs to be mapped in order to mark product available. " %}

```
{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "Required information is not available for the product",
                "message": "fabric"
            }
        ],
        "code": 503,
        "message": "fabric"
    }
}
```

{% endtab %}
{% endtabs %}

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

```
curl --location --request POST 'https://{workspace}.myeshopbox.com/product-engine/api/v1/productListing' \
--header 'Authorization: Bearer AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
	"esin" : "0SGAT12SG25F",
	"channelCode" : "CH1234",
	"availability" : false
}'
```

{% endtab %}
{% endtabs %}


---

# 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://eshop.gitbook.io/eshopbox-developers/product/product-availability/mark-product-availability.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.
