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