Update Product Status
Update Product Status
POST https://sandbox.mnasati.com/v1/products_status
This endpoint allows you to update the status of a product.
Headers
Name
Type
Description
Authentication
string
The Authentication token is to track down who is emptying our stocks.
Request Body
Name
Type
Description
product_status
integer
Status the product will update to.
product_id
integer
To update a product ID.
{
"status":true,
"message":"Product status updated successfully."
}{
"status":400,
"error":400,
"messages":{
"status":false,
"message":"Same product status"
}
}Examples
import http.client
conn = http.client.HTTPSConnection("sandbox.mnasati.com")
payload = "{\"product_id\":3190,\"product_status\":1}"
headers = {
'Content-Type': "",
'Authorization-Jwt': ""
}
conn.request("POST", "/v1/products_status", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.mnasati.com/v1/products_status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"product_id\":3190,\"product_status\":1}",
CURLOPT_HTTPHEADER => [
"Authorization-Jwt: ",
"Content-Type: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Last updated
Was this helpful?