curl --request POST \
--url https://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve \
--header 'Content-Type: application/json' \
--data '
{
"reservedBy": "pos-475-2",
"reservedUntil": "2026-11-06T12:22:11.7939119Z",
"couponIds": [
"6679b89b-f37c-46d0-a3cd-0a25302e75a9",
"168f3e64-da3f-4f48-acbb-552d66110e77"
]
}
'import requests
url = "https://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve"
payload = {
"reservedBy": "pos-475-2",
"reservedUntil": "2026-11-06T12:22:11.7939119Z",
"couponIds": ["6679b89b-f37c-46d0-a3cd-0a25302e75a9", "168f3e64-da3f-4f48-acbb-552d66110e77"]
}
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({
reservedBy: 'pos-475-2',
reservedUntil: '2026-11-06T12:22:11.7939119Z',
couponIds: ['6679b89b-f37c-46d0-a3cd-0a25302e75a9', '168f3e64-da3f-4f48-acbb-552d66110e77']
})
};
fetch('https://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve', 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://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve",
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([
'reservedBy' => 'pos-475-2',
'reservedUntil' => '2026-11-06T12:22:11.7939119Z',
'couponIds' => [
'6679b89b-f37c-46d0-a3cd-0a25302e75a9',
'168f3e64-da3f-4f48-acbb-552d66110e77'
]
]),
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://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve"
payload := strings.NewReader("{\n \"reservedBy\": \"pos-475-2\",\n \"reservedUntil\": \"2026-11-06T12:22:11.7939119Z\",\n \"couponIds\": [\n \"6679b89b-f37c-46d0-a3cd-0a25302e75a9\",\n \"168f3e64-da3f-4f48-acbb-552d66110e77\"\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://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve")
.header("Content-Type", "application/json")
.body("{\n \"reservedBy\": \"pos-475-2\",\n \"reservedUntil\": \"2026-11-06T12:22:11.7939119Z\",\n \"couponIds\": [\n \"6679b89b-f37c-46d0-a3cd-0a25302e75a9\",\n \"168f3e64-da3f-4f48-acbb-552d66110e77\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve")
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 \"reservedBy\": \"pos-475-2\",\n \"reservedUntil\": \"2026-11-06T12:22:11.7939119Z\",\n \"couponIds\": [\n \"6679b89b-f37c-46d0-a3cd-0a25302e75a9\",\n \"168f3e64-da3f-4f48-acbb-552d66110e77\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"couponIds": [
"6679b89b-f37c-46d0-a3cd-0a25302e75a9",
"168f3e64-da3f-4f48-acbb-552d66110e77"
]
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Reserve coupons
The POS calls this before it applies coupons it chose itself, so the same coupons cannot be used at another POS or online while this sale completes. Send the coupon ids, who reserves them in reservedBy, and until when in reservedUntil. Lobyco recommends 1 to 5 minutes.
Every coupon must be found and usable by the customer, otherwise the call is refused and nothing is reserved. While a reservation is active, a call with the same reservedBy extends it or adds coupons to it; a call with another reservedBy is refused. An expired reservation can be taken over by anyone. The reservation ends at reservedUntil, when the coupons are redeemed, or when it is released with POST /api/v1/customers/{customerId}/coupons/cancel-reservation.
A POS that lets Lobyco calculate the discounts does not call this: the calculation reserves the coupons it applied for a short time, 1 minute by default, under the basket’s id.
curl --request POST \
--url https://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve \
--header 'Content-Type: application/json' \
--data '
{
"reservedBy": "pos-475-2",
"reservedUntil": "2026-11-06T12:22:11.7939119Z",
"couponIds": [
"6679b89b-f37c-46d0-a3cd-0a25302e75a9",
"168f3e64-da3f-4f48-acbb-552d66110e77"
]
}
'import requests
url = "https://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve"
payload = {
"reservedBy": "pos-475-2",
"reservedUntil": "2026-11-06T12:22:11.7939119Z",
"couponIds": ["6679b89b-f37c-46d0-a3cd-0a25302e75a9", "168f3e64-da3f-4f48-acbb-552d66110e77"]
}
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({
reservedBy: 'pos-475-2',
reservedUntil: '2026-11-06T12:22:11.7939119Z',
couponIds: ['6679b89b-f37c-46d0-a3cd-0a25302e75a9', '168f3e64-da3f-4f48-acbb-552d66110e77']
})
};
fetch('https://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve', 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://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve",
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([
'reservedBy' => 'pos-475-2',
'reservedUntil' => '2026-11-06T12:22:11.7939119Z',
'couponIds' => [
'6679b89b-f37c-46d0-a3cd-0a25302e75a9',
'168f3e64-da3f-4f48-acbb-552d66110e77'
]
]),
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://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve"
payload := strings.NewReader("{\n \"reservedBy\": \"pos-475-2\",\n \"reservedUntil\": \"2026-11-06T12:22:11.7939119Z\",\n \"couponIds\": [\n \"6679b89b-f37c-46d0-a3cd-0a25302e75a9\",\n \"168f3e64-da3f-4f48-acbb-552d66110e77\"\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://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve")
.header("Content-Type", "application/json")
.body("{\n \"reservedBy\": \"pos-475-2\",\n \"reservedUntil\": \"2026-11-06T12:22:11.7939119Z\",\n \"couponIds\": [\n \"6679b89b-f37c-46d0-a3cd-0a25302e75a9\",\n \"168f3e64-da3f-4f48-acbb-552d66110e77\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/coupon/api/v1/customers/{customerId}/coupons/reserve")
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 \"reservedBy\": \"pos-475-2\",\n \"reservedUntil\": \"2026-11-06T12:22:11.7939119Z\",\n \"couponIds\": [\n \"6679b89b-f37c-46d0-a3cd-0a25302e75a9\",\n \"168f3e64-da3f-4f48-acbb-552d66110e77\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"couponIds": [
"6679b89b-f37c-46d0-a3cd-0a25302e75a9",
"168f3e64-da3f-4f48-acbb-552d66110e77"
]
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Headers
Body
The coupons to reserve, who reserves them and until when.
The coupons to reserve, who reserves them and until when.