Rechercher un produit

Pour rechercher un produit, vous pouvez filtrer par nom de votre produit :

var myHeaders = new Headers();

myHeaders.append("Authorization", "Bearer <token>");

var formdata = new FormData();

var requestOptions = {
		method: 'GET',
		headers: myHeaders,
		body: formdata,
		redirect: 'follow'
};

fetch("<https://api.sinao.app/v1/apps/:appId/products?order[0][name]=name&order[0][direction]=asc&search=:nom_produit", requestOptions)
		.then(response => response.text())
		.then(result => console.log(result))
		.catch(error => console.log('error', error));
{
    "data": [
        {
            "id": 2,
            "name": "T-shirt imprimé colibri (Taille : S - Couleur : Blanc)",
            "amount_accurately": 2294000,
            "vat_percent": 2000,
            "image": null,
            "lifetime": null,
            "description": null,
            "quantity_name": null,
            "ean_code": null,
            "reference": "demo_1",
            "unity": null,
            "account_id": null,
            "tags": [],
            "buying_price_amount": null,
            "buying_price_amount_with_taxes": null,
            "man_days_per_unit": null,
            "type": "product",
            "category_id": null,
            "metadata": {
                "idPrestaShop": "1"
            },
            "created_at": "2023-09-15T09:02:21.000000Z",
            "updated_at": "2023-09-15T09:02:21.000000Z",
            "amount": 2294,
            "amount_with_taxes": 2753
        }
    ],
}