Activate Food Item
curl --request PUT \
--url https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id} \
--header 'Access-Token: <api-key>'import requests
url = "https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}"
headers = {"Access-Token": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'Access-Token': '<api-key>'}};
fetch('https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Access-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}")
.header("Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": false,
"error": "yetkisiz erişim"
}
{
"status": false,
"error": "URL hatalı"
}
{
"status": false,
"error": "ürün bulunamadı"
}
Foods
Activate Food Item
Make a menu item available for ordering
PUT
/
foods
/
status-active
/
{food_id}
Activate Food Item
curl --request PUT \
--url https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id} \
--header 'Access-Token: <api-key>'import requests
url = "https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}"
headers = {"Access-Token": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'Access-Token': '<api-key>'}};
fetch('https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Access-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}")
.header("Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": false,
"error": "yetkisiz erişim"
}
{
"status": false,
"error": "URL hatalı"
}
{
"status": false,
"error": "ürün bulunamadı"
}
Overview
Activates a specific menu item, making it available for customers to order.Path Parameters
integer
required
Food/product ID from the menu
Headers
string
required
Your API access token
Response
boolean
true if successfulstring
"OK" on successExamples
curl -X PUT https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/1 \
-H 'Access-Token: your-access-token'
const foodId = 1; // Beef Burrito
const response = await fetch(
`https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/${foodId}`,
{
method: 'PUT',
headers: {
'Access-Token': 'your-access-token'
}
}
);
const data = await response.json();
// Food item is now available
import requests
food_id = 1 # Beef Burrito
response = requests.put(
f'https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{food_id}',
headers={'Access-Token': 'your-access-token'}
)
data = response.json()
# Food item is now available
<?php
$foodId = 1; // Beef Burrito
$url = "https://www.xn--dkkango-n2a.com/api/integrations/foods/status-active/{$foodId}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Access-Token: your-access-token'
));
$response = curl_exec($ch);
curl_close($ch);
// Food item is now available
?>
Success Response (200)
{
"status": true,
"data": "OK"
}
Error Responses
{
"status": false,
"error": "yetkisiz erişim"
}
{
"status": false,
"error": "URL hatalı"
}
{
"status": false,
"error": "ürün bulunamadı"
}
Use Cases
Stock Replenished
Stock Replenished
Reactivate item when ingredients are back in stock.
async function restockItem(foodId, itemName) {
await activateFood(foodId);
notifyStaff(`${itemName} is back in stock and available`);
logInventoryChange(foodId, 'activated');
}
Daily Specials
Daily Specials
Activate special menu items for the day.
async function enableDailySpecials() {
const specials = [
{ id: 15, name: 'Lunch Special' },
{ id: 16, name: 'Chef\'s Choice' }
];
for (const special of specials) {
await activateFood(special.id);
console.log(`Activated: ${special.name}`);
}
}
Time-Based Availability
Time-Based Availability
Activate items based on time of day.
// Activate breakfast items at 7 AM
scheduleDaily('07:00', async () => {
const breakfastItems = [5, 6, 7, 8];
for (const id of breakfastItems) {
await activateFood(id);
}
});
// Deactivate breakfast items at 11 AM
scheduleDaily('11:00', async () => {
const breakfastItems = [5, 6, 7, 8];
for (const id of breakfastItems) {
await deactivateFood(id);
}
});
Bulk Activation
Bulk Activation
Activate multiple items at once.
async function activateCategory(categoryName) {
const menu = await getMenu();
const items = menu.filter(item =>
item.category.name === categoryName
);
for (const item of items) {
await activateFood(item.food_id);
}
console.log(`Activated ${items.length} items in ${categoryName}`);
}
What Happens
1
Status Updated
Item’s
status changes to "ACTIVE" in the database2
Visible to Customers
Item becomes visible and orderable in customer apps
3
Orders Accepted
Customers can add this item to their cart and place orders
Changes take effect immediately - customers will see the item as available right away.
Best Practices
- Verify Ingredients
- Log Changes
- Batch Operations
async function safeActivate(foodId) {
// Check inventory first
const inStock = await checkInventory(foodId);
if (inStock) {
await activateFood(foodId);
return true;
} else {
console.warn('Cannot activate - out of stock');
return false;
}
}
async function activateWithLogging(foodId, reason) {
await activateFood(foodId);
await logChange({
type: 'food_activated',
foodId,
reason,
timestamp: new Date(),
user: currentUser.id
});
}
async function activateBatch(foodIds) {
const results = {
success: [],
failed: []
};
for (const id of foodIds) {
try {
await activateFood(id);
results.success.push(id);
} catch (error) {
results.failed.push({ id, error: error.message });
}
}
return results;
}
Related Endpoints
Deactivate Food
Make item unavailable
Get Menu
View all menu items
Use this endpoint in combination with your inventory management system for automatic availability updates.
⌘I