Menu import
Import menu
Import or update your menu structure including categories, products, and options.
POST
/
menu
/
import
Import menu
curl --request POST \
--url https://app.xmenu.it/api/menu/import \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--data '
{
"pos_uid": "<string>",
"categories": [
{
"ext_id": "<string>",
"name": "<string>",
"description": "<string>",
"image": "<string>",
"hidden": true,
"position": 123,
"options": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"min_selectable": 123,
"max_selectable": 123,
"max_quantity": 123,
"note": "<string>",
"hidden": true,
"position": 123,
"primary": true,
"first_default": true,
"show_caption": true,
"print_caption": true,
"option_values": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"price_operand": 123,
"hidden": true,
"checked_default": true,
"position": 123,
"restrict_to_primary_value_uids": [
"<string>"
]
}
]
}
]
}
],
"products": [
{
"ext_id": "<string>",
"category_ext_id": "<string>",
"name": "<string>",
"description": "<string>",
"price": 123,
"prices_table": {},
"image": "<string>",
"allergens": [
"<string>"
],
"symbols": [
"<string>"
],
"suggested": true,
"price_sale_alert": true,
"price_sale_badge": 123,
"checkout_selling": true,
"hidden": true,
"position": 123,
"options": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"min_selectable": 123,
"max_selectable": 123,
"max_quantity": 123,
"note": "<string>",
"hidden": true,
"position": 123,
"primary": true,
"first_default": true,
"show_caption": true,
"print_caption": true,
"option_values": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"price_operand": 123,
"hidden": true,
"checked_default": true,
"position": 123,
"restrict_to_primary_value_uids": [
"<string>"
]
}
]
}
]
}
]
}
'import requests
url = "https://app.xmenu.it/api/menu/import"
payload = {
"pos_uid": "<string>",
"categories": [
{
"ext_id": "<string>",
"name": "<string>",
"description": "<string>",
"image": "<string>",
"hidden": True,
"position": 123,
"options": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"min_selectable": 123,
"max_selectable": 123,
"max_quantity": 123,
"note": "<string>",
"hidden": True,
"position": 123,
"primary": True,
"first_default": True,
"show_caption": True,
"print_caption": True,
"option_values": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"price_operand": 123,
"hidden": True,
"checked_default": True,
"position": 123,
"restrict_to_primary_value_uids": ["<string>"]
}
]
}
]
}
],
"products": [
{
"ext_id": "<string>",
"category_ext_id": "<string>",
"name": "<string>",
"description": "<string>",
"price": 123,
"prices_table": {},
"image": "<string>",
"allergens": ["<string>"],
"symbols": ["<string>"],
"suggested": True,
"price_sale_alert": True,
"price_sale_badge": 123,
"checkout_selling": True,
"hidden": True,
"position": 123,
"options": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"min_selectable": 123,
"max_selectable": 123,
"max_quantity": 123,
"note": "<string>",
"hidden": True,
"position": 123,
"primary": True,
"first_default": True,
"show_caption": True,
"print_caption": True,
"option_values": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"price_operand": 123,
"hidden": True,
"checked_default": True,
"position": 123,
"restrict_to_primary_value_uids": ["<string>"]
}
]
}
]
}
]
}
headers = {
"X-Client-Id": "<api-key>",
"X-Client-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Client-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pos_uid: '<string>',
categories: [
{
ext_id: '<string>',
name: '<string>',
description: '<string>',
image: '<string>',
hidden: true,
position: 123,
options: [
{
ext_id: '<string>',
name: '<string>',
short_name: '<string>',
min_selectable: 123,
max_selectable: 123,
max_quantity: 123,
note: '<string>',
hidden: true,
position: 123,
primary: true,
first_default: true,
show_caption: true,
print_caption: true,
option_values: [
{
ext_id: '<string>',
name: '<string>',
short_name: '<string>',
price_operand: 123,
hidden: true,
checked_default: true,
position: 123,
restrict_to_primary_value_uids: ['<string>']
}
]
}
]
}
],
products: [
{
ext_id: '<string>',
category_ext_id: '<string>',
name: '<string>',
description: '<string>',
price: 123,
prices_table: {},
image: '<string>',
allergens: ['<string>'],
symbols: ['<string>'],
suggested: true,
price_sale_alert: true,
price_sale_badge: 123,
checkout_selling: true,
hidden: true,
position: 123,
options: [
{
ext_id: '<string>',
name: '<string>',
short_name: '<string>',
min_selectable: 123,
max_selectable: 123,
max_quantity: 123,
note: '<string>',
hidden: true,
position: 123,
primary: true,
first_default: true,
show_caption: true,
print_caption: true,
option_values: [
{
ext_id: '<string>',
name: '<string>',
short_name: '<string>',
price_operand: 123,
hidden: true,
checked_default: true,
position: 123,
restrict_to_primary_value_uids: ['<string>']
}
]
}
]
}
]
})
};
fetch('https://app.xmenu.it/api/menu/import', 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://app.xmenu.it/api/menu/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pos_uid' => '<string>',
'categories' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'image' => '<string>',
'hidden' => true,
'position' => 123,
'options' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'short_name' => '<string>',
'min_selectable' => 123,
'max_selectable' => 123,
'max_quantity' => 123,
'note' => '<string>',
'hidden' => true,
'position' => 123,
'primary' => true,
'first_default' => true,
'show_caption' => true,
'print_caption' => true,
'option_values' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'short_name' => '<string>',
'price_operand' => 123,
'hidden' => true,
'checked_default' => true,
'position' => 123,
'restrict_to_primary_value_uids' => [
'<string>'
]
]
]
]
]
]
],
'products' => [
[
'ext_id' => '<string>',
'category_ext_id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'price' => 123,
'prices_table' => [
],
'image' => '<string>',
'allergens' => [
'<string>'
],
'symbols' => [
'<string>'
],
'suggested' => true,
'price_sale_alert' => true,
'price_sale_badge' => 123,
'checkout_selling' => true,
'hidden' => true,
'position' => 123,
'options' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'short_name' => '<string>',
'min_selectable' => 123,
'max_selectable' => 123,
'max_quantity' => 123,
'note' => '<string>',
'hidden' => true,
'position' => 123,
'primary' => true,
'first_default' => true,
'show_caption' => true,
'print_caption' => true,
'option_values' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'short_name' => '<string>',
'price_operand' => 123,
'hidden' => true,
'checked_default' => true,
'position' => 123,
'restrict_to_primary_value_uids' => [
'<string>'
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Client-Id: <api-key>",
"X-Client-Secret: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.xmenu.it/api/menu/import"
payload := strings.NewReader("{\n \"pos_uid\": \"<string>\",\n \"categories\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"products\": [\n {\n \"ext_id\": \"<string>\",\n \"category_ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 123,\n \"prices_table\": {},\n \"image\": \"<string>\",\n \"allergens\": [\n \"<string>\"\n ],\n \"symbols\": [\n \"<string>\"\n ],\n \"suggested\": true,\n \"price_sale_alert\": true,\n \"price_sale_badge\": 123,\n \"checkout_selling\": true,\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.xmenu.it/api/menu/import")
.header("X-Client-Id", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pos_uid\": \"<string>\",\n \"categories\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"products\": [\n {\n \"ext_id\": \"<string>\",\n \"category_ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 123,\n \"prices_table\": {},\n \"image\": \"<string>\",\n \"allergens\": [\n \"<string>\"\n ],\n \"symbols\": [\n \"<string>\"\n ],\n \"suggested\": true,\n \"price_sale_alert\": true,\n \"price_sale_badge\": 123,\n \"checkout_selling\": true,\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.xmenu.it/api/menu/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pos_uid\": \"<string>\",\n \"categories\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"products\": [\n {\n \"ext_id\": \"<string>\",\n \"category_ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 123,\n \"prices_table\": {},\n \"image\": \"<string>\",\n \"allergens\": [\n \"<string>\"\n ],\n \"symbols\": [\n \"<string>\"\n ],\n \"suggested\": true,\n \"price_sale_alert\": true,\n \"price_sale_badge\": 123,\n \"checkout_selling\": true,\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"error": "<string>",
"message": "<string>"
}write:menu
Each entity includes the
ext_id field, which must be populated with its own unique identifier.If an element of the same entity with this ext_id does not already exist, a new one will be created. If the element exists, its content will be updated.The uniqueness scope of this ID is internal to the environment defined by the Client ID (X-Client-Id), meaning the same ext_id imported from different Client IDs will generate distinct elements.The ext_id values for options and option_values can be unique in that environment or only within their respective parent element (category/product for options, option for option_values).Authorizations
clientId & clientSecretoauth2
Client ID for API Client authentication (must be used together with Client Secret)
Client Secret for API Client authentication (must be used together with Client ID)
Body
application/json
Point-of-sale identifier
Update mode:
replace= Full replacementmerge= Append new items
Available options:
replace, merge Array of categories. Required if update_mode = replace
Show child attributes
Show child attributes
Array of products. Required if update_mode = replace
Show child attributes
Show child attributes
Response
Menu import response
Operation result: true if successful, false if failed
Error code if the operation failed. Possible values:
IMPORT_ERROR= Error during import (consult message parameter for details)
See Error codes for general error codes that may also occur.
Error description if the import failed
Previous
Customer listReturns a paginated list of customers registered or with existing orders in xMenu.
Next
⌘I
Import menu
curl --request POST \
--url https://app.xmenu.it/api/menu/import \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--data '
{
"pos_uid": "<string>",
"categories": [
{
"ext_id": "<string>",
"name": "<string>",
"description": "<string>",
"image": "<string>",
"hidden": true,
"position": 123,
"options": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"min_selectable": 123,
"max_selectable": 123,
"max_quantity": 123,
"note": "<string>",
"hidden": true,
"position": 123,
"primary": true,
"first_default": true,
"show_caption": true,
"print_caption": true,
"option_values": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"price_operand": 123,
"hidden": true,
"checked_default": true,
"position": 123,
"restrict_to_primary_value_uids": [
"<string>"
]
}
]
}
]
}
],
"products": [
{
"ext_id": "<string>",
"category_ext_id": "<string>",
"name": "<string>",
"description": "<string>",
"price": 123,
"prices_table": {},
"image": "<string>",
"allergens": [
"<string>"
],
"symbols": [
"<string>"
],
"suggested": true,
"price_sale_alert": true,
"price_sale_badge": 123,
"checkout_selling": true,
"hidden": true,
"position": 123,
"options": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"min_selectable": 123,
"max_selectable": 123,
"max_quantity": 123,
"note": "<string>",
"hidden": true,
"position": 123,
"primary": true,
"first_default": true,
"show_caption": true,
"print_caption": true,
"option_values": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"price_operand": 123,
"hidden": true,
"checked_default": true,
"position": 123,
"restrict_to_primary_value_uids": [
"<string>"
]
}
]
}
]
}
]
}
'import requests
url = "https://app.xmenu.it/api/menu/import"
payload = {
"pos_uid": "<string>",
"categories": [
{
"ext_id": "<string>",
"name": "<string>",
"description": "<string>",
"image": "<string>",
"hidden": True,
"position": 123,
"options": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"min_selectable": 123,
"max_selectable": 123,
"max_quantity": 123,
"note": "<string>",
"hidden": True,
"position": 123,
"primary": True,
"first_default": True,
"show_caption": True,
"print_caption": True,
"option_values": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"price_operand": 123,
"hidden": True,
"checked_default": True,
"position": 123,
"restrict_to_primary_value_uids": ["<string>"]
}
]
}
]
}
],
"products": [
{
"ext_id": "<string>",
"category_ext_id": "<string>",
"name": "<string>",
"description": "<string>",
"price": 123,
"prices_table": {},
"image": "<string>",
"allergens": ["<string>"],
"symbols": ["<string>"],
"suggested": True,
"price_sale_alert": True,
"price_sale_badge": 123,
"checkout_selling": True,
"hidden": True,
"position": 123,
"options": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"min_selectable": 123,
"max_selectable": 123,
"max_quantity": 123,
"note": "<string>",
"hidden": True,
"position": 123,
"primary": True,
"first_default": True,
"show_caption": True,
"print_caption": True,
"option_values": [
{
"ext_id": "<string>",
"name": "<string>",
"short_name": "<string>",
"price_operand": 123,
"hidden": True,
"checked_default": True,
"position": 123,
"restrict_to_primary_value_uids": ["<string>"]
}
]
}
]
}
]
}
headers = {
"X-Client-Id": "<api-key>",
"X-Client-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Client-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pos_uid: '<string>',
categories: [
{
ext_id: '<string>',
name: '<string>',
description: '<string>',
image: '<string>',
hidden: true,
position: 123,
options: [
{
ext_id: '<string>',
name: '<string>',
short_name: '<string>',
min_selectable: 123,
max_selectable: 123,
max_quantity: 123,
note: '<string>',
hidden: true,
position: 123,
primary: true,
first_default: true,
show_caption: true,
print_caption: true,
option_values: [
{
ext_id: '<string>',
name: '<string>',
short_name: '<string>',
price_operand: 123,
hidden: true,
checked_default: true,
position: 123,
restrict_to_primary_value_uids: ['<string>']
}
]
}
]
}
],
products: [
{
ext_id: '<string>',
category_ext_id: '<string>',
name: '<string>',
description: '<string>',
price: 123,
prices_table: {},
image: '<string>',
allergens: ['<string>'],
symbols: ['<string>'],
suggested: true,
price_sale_alert: true,
price_sale_badge: 123,
checkout_selling: true,
hidden: true,
position: 123,
options: [
{
ext_id: '<string>',
name: '<string>',
short_name: '<string>',
min_selectable: 123,
max_selectable: 123,
max_quantity: 123,
note: '<string>',
hidden: true,
position: 123,
primary: true,
first_default: true,
show_caption: true,
print_caption: true,
option_values: [
{
ext_id: '<string>',
name: '<string>',
short_name: '<string>',
price_operand: 123,
hidden: true,
checked_default: true,
position: 123,
restrict_to_primary_value_uids: ['<string>']
}
]
}
]
}
]
})
};
fetch('https://app.xmenu.it/api/menu/import', 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://app.xmenu.it/api/menu/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pos_uid' => '<string>',
'categories' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'image' => '<string>',
'hidden' => true,
'position' => 123,
'options' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'short_name' => '<string>',
'min_selectable' => 123,
'max_selectable' => 123,
'max_quantity' => 123,
'note' => '<string>',
'hidden' => true,
'position' => 123,
'primary' => true,
'first_default' => true,
'show_caption' => true,
'print_caption' => true,
'option_values' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'short_name' => '<string>',
'price_operand' => 123,
'hidden' => true,
'checked_default' => true,
'position' => 123,
'restrict_to_primary_value_uids' => [
'<string>'
]
]
]
]
]
]
],
'products' => [
[
'ext_id' => '<string>',
'category_ext_id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'price' => 123,
'prices_table' => [
],
'image' => '<string>',
'allergens' => [
'<string>'
],
'symbols' => [
'<string>'
],
'suggested' => true,
'price_sale_alert' => true,
'price_sale_badge' => 123,
'checkout_selling' => true,
'hidden' => true,
'position' => 123,
'options' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'short_name' => '<string>',
'min_selectable' => 123,
'max_selectable' => 123,
'max_quantity' => 123,
'note' => '<string>',
'hidden' => true,
'position' => 123,
'primary' => true,
'first_default' => true,
'show_caption' => true,
'print_caption' => true,
'option_values' => [
[
'ext_id' => '<string>',
'name' => '<string>',
'short_name' => '<string>',
'price_operand' => 123,
'hidden' => true,
'checked_default' => true,
'position' => 123,
'restrict_to_primary_value_uids' => [
'<string>'
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Client-Id: <api-key>",
"X-Client-Secret: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.xmenu.it/api/menu/import"
payload := strings.NewReader("{\n \"pos_uid\": \"<string>\",\n \"categories\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"products\": [\n {\n \"ext_id\": \"<string>\",\n \"category_ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 123,\n \"prices_table\": {},\n \"image\": \"<string>\",\n \"allergens\": [\n \"<string>\"\n ],\n \"symbols\": [\n \"<string>\"\n ],\n \"suggested\": true,\n \"price_sale_alert\": true,\n \"price_sale_badge\": 123,\n \"checkout_selling\": true,\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.xmenu.it/api/menu/import")
.header("X-Client-Id", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pos_uid\": \"<string>\",\n \"categories\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"products\": [\n {\n \"ext_id\": \"<string>\",\n \"category_ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 123,\n \"prices_table\": {},\n \"image\": \"<string>\",\n \"allergens\": [\n \"<string>\"\n ],\n \"symbols\": [\n \"<string>\"\n ],\n \"suggested\": true,\n \"price_sale_alert\": true,\n \"price_sale_badge\": 123,\n \"checkout_selling\": true,\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.xmenu.it/api/menu/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pos_uid\": \"<string>\",\n \"categories\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ],\n \"products\": [\n {\n \"ext_id\": \"<string>\",\n \"category_ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 123,\n \"prices_table\": {},\n \"image\": \"<string>\",\n \"allergens\": [\n \"<string>\"\n ],\n \"symbols\": [\n \"<string>\"\n ],\n \"suggested\": true,\n \"price_sale_alert\": true,\n \"price_sale_badge\": 123,\n \"checkout_selling\": true,\n \"hidden\": true,\n \"position\": 123,\n \"options\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"min_selectable\": 123,\n \"max_selectable\": 123,\n \"max_quantity\": 123,\n \"note\": \"<string>\",\n \"hidden\": true,\n \"position\": 123,\n \"primary\": true,\n \"first_default\": true,\n \"show_caption\": true,\n \"print_caption\": true,\n \"option_values\": [\n {\n \"ext_id\": \"<string>\",\n \"name\": \"<string>\",\n \"short_name\": \"<string>\",\n \"price_operand\": 123,\n \"hidden\": true,\n \"checked_default\": true,\n \"position\": 123,\n \"restrict_to_primary_value_uids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"error": "<string>",
"message": "<string>"
}