Eliminar producto
Eliminar un producto.
DELETE /api/rest_admin/products/:id
Parámetros
get
id integer | Id del producto. |
Cabeceras HTTP
X-Sushi-Token-Id | Token de autorización. |
Respuesta
{
"success": 1,
"error": [],
"data": ""
}
success integer | 0 si hay error, 1 si no hay error. |
error string | Descripción del error. |
data json object | Datos de respuesta. |
Ejemplos
cURL
curl --location --request DELETE 'http://sushi.loc/api/rest_admin/products/99' \
--header 'X-Sushi-Token-Id: i2u4f8avuue7if3tthflh32641'
PHP - cURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://sushi.loc/api/rest_admin/products/99",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"X-Sushi-Token-Id: i2u4f8avuue7if3tthflh32641"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;