Beschikbaarheid van items bijwerken
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_bodyBeschikbaarheid van items bijwerken
Gebruik de POS availability API om voorraadniveaus van menu-items op PLU-code bij te werken en items als uitverkocht te markeren, realtime tussen systemen.
POST
/
pos
/
availability
Beschikbaarheid van items bijwerken
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_bodyWerk de beschikbaarheid en voorraad van menu-items in een store bij. Items worden gematcht op basis van hun PLU (Price Look-Up) code.
Verzoek
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
De externe store-ID (UUID-formaat). Dit is de ID die je aan de store hebt toegewezen bij het opzetten van je integratie.
array
required
Een array met items om bij te werken. Moet minstens één item bevatten.
Show Item-eigenschappen
Show Item-eigenschappen
string
required
De PLU-code van het menu-item. Moet overeenkomen met de PLU die is geconfigureerd in het storekit-dashboard.
boolean
required
Of het item momenteel beschikbaar is om te bestellen.
integer
De huidige voorraadstand. Moet 0 of hoger zijn. Als de voorraad op 0 komt, overweeg dan
isAvailable op false te zetten.Response
"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"
}
Gedrag
- Items worden op PLU gematcht binnen het actieve menu van de store
- Als de PLU van een item niet gevonden wordt, wordt het stilzwijgend overgeslagen (er wordt geen fout teruggegeven)
- Wijzigingen in beschikbaarheid zijn direct van kracht
- De menu-cache wordt na updates automatisch ongeldig gemaakt
Voorbeeld: items als uitverkocht markeren
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
}
]
}'
Voorbeeld: items terug op voorraad zetten
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