Artikelverfügbarkeit aktualisieren
curl --request POST \
--url https://api.example.com/pos/availability \
--header 'Content-Type: application/json' \
--data '
{
"storeId": "<string>",
"items": [
{
"plu": "<string>",
"isAvailable": true,
"inventory": 123
}
]
}
'import requests
url = "https://api.example.com/pos/availability"
payload = {
"storeId": "<string>",
"items": [
{
"plu": "<string>",
"isAvailable": True,
"inventory": 123
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
storeId: '<string>',
items: [{plu: '<string>', isAvailable: true, inventory: 123}]
})
};
fetch('https://api.example.com/pos/availability', 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://api.example.com/pos/availability",
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([
'storeId' => '<string>',
'items' => [
[
'plu' => '<string>',
'isAvailable' => true,
'inventory' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.example.com/pos/availability"
payload := strings.NewReader("{\n \"storeId\": \"<string>\",\n \"items\": [\n {\n \"plu\": \"<string>\",\n \"isAvailable\": true,\n \"inventory\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.example.com/pos/availability")
.header("Content-Type", "application/json")
.body("{\n \"storeId\": \"<string>\",\n \"items\": [\n {\n \"plu\": \"<string>\",\n \"isAvailable\": true,\n \"inventory\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/pos/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"storeId\": \"<string>\",\n \"items\": [\n {\n \"plu\": \"<string>\",\n \"isAvailable\": true,\n \"inventory\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyArtikelverfügbarkeit aktualisieren
Nutzen Sie die POS-Verfügbarkeits-API, um Artikelbestände per PLU-Code zu aktualisieren und ausverkaufte Artikel in Echtzeit zu synchronisieren.
POST
/
pos
/
availability
Artikelverfügbarkeit aktualisieren
curl --request POST \
--url https://api.example.com/pos/availability \
--header 'Content-Type: application/json' \
--data '
{
"storeId": "<string>",
"items": [
{
"plu": "<string>",
"isAvailable": true,
"inventory": 123
}
]
}
'import requests
url = "https://api.example.com/pos/availability"
payload = {
"storeId": "<string>",
"items": [
{
"plu": "<string>",
"isAvailable": True,
"inventory": 123
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
storeId: '<string>',
items: [{plu: '<string>', isAvailable: true, inventory: 123}]
})
};
fetch('https://api.example.com/pos/availability', 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://api.example.com/pos/availability",
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([
'storeId' => '<string>',
'items' => [
[
'plu' => '<string>',
'isAvailable' => true,
'inventory' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.example.com/pos/availability"
payload := strings.NewReader("{\n \"storeId\": \"<string>\",\n \"items\": [\n {\n \"plu\": \"<string>\",\n \"isAvailable\": true,\n \"inventory\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.example.com/pos/availability")
.header("Content-Type", "application/json")
.body("{\n \"storeId\": \"<string>\",\n \"items\": [\n {\n \"plu\": \"<string>\",\n \"isAvailable\": true,\n \"inventory\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/pos/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"storeId\": \"<string>\",\n \"items\": [\n {\n \"plu\": \"<string>\",\n \"isAvailable\": true,\n \"inventory\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyAktualisieren Sie den Verfügbarkeitsstatus und die Bestandsmenge für Menüartikel in einem Store. Artikel werden anhand ihres PLU-Codes (Price Look-Up) abgeglichen.
Anfrage
curl -X POST https://api.storekit.com/pos/availability \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"storeId": "550e8400-e29b-41d4-a716-446655440000",
"items": [
{
"plu": "BURGER-001",
"isAvailable": true,
"inventory": 50
},
{
"plu": "FRIES-001",
"isAvailable": false
}
]
}'
Request-Body
string
required
Die externe Store-ID (UUID-Format). Dies ist die ID, die Sie dem Store bei der Einrichtung Ihrer Integration zugewiesen haben.
array
required
Ein Array von zu aktualisierenden Artikeln. Muss mindestens einen Artikel enthalten.
Show Eigenschaften eines Artikels
Show Eigenschaften eines Artikels
string
required
Der PLU-Code des Menüartikels. Muss mit dem im storekit-Dashboard konfigurierten PLU übereinstimmen.
boolean
required
Ob der Artikel derzeit für Bestellungen verfügbar ist.
integer
Der aktuelle Bestand. Muss 0 oder größer sein. Wenn der Bestand 0 erreicht, sollten Sie
isAvailable auf false setzen.Antwort
"ok"
{
"statusCode": 404,
"error": "Not Found",
"message": "Not Found"
}
{
"statusCode": 404,
"error": "Not Found",
"message": "No active menu found for this venue"
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "\"storeId\" must be a valid GUID"
}
Verhalten
- Artikel werden anhand des PLU im aktiven Menü des Stores abgeglichen
- Wird der PLU eines Artikels nicht gefunden, wird er stillschweigend übersprungen (kein Fehler)
- Verfügbarkeitsänderungen werden sofort wirksam
- Der Menü-Cache wird nach Aktualisierungen automatisch invalidiert
Beispiel: Artikel als ausverkauft markieren
curl -X POST https://api.storekit.com/pos/availability \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"storeId": "550e8400-e29b-41d4-a716-446655440000",
"items": [
{
"plu": "SPECIAL-001",
"isAvailable": false,
"inventory": 0
}
]
}'
Beispiel: Artikel wieder auffüllen
curl -X POST https://api.storekit.com/pos/availability \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"storeId": "550e8400-e29b-41d4-a716-446655440000",
"items": [
{
"plu": "SPECIAL-001",
"isAvailable": true,
"inventory": 25
},
{
"plu": "DESSERT-001",
"isAvailable": true,
"inventory": 10
}
]
}'
Was this page helpful?
⌘I