curl --request POST \
--url https://{host}/promotion/v2/coupons/assign \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"memberId": "0e285102-0fe4-4b70-a710-7883d2a25f1b",
"householdId": null,
"campaignId": "b23f36ea-008d-45a8-aa80-003ac973e64c",
"reservationId": "32e9899b-71ad-4b3d-88d2-c35e03da2fac",
"pickUpEndDate": "2026-11-20T00:00:00Z",
"visibleFrom": null,
"storeId": null,
"assignedBy": "Summer game"
}
'import requests
url = "https://{host}/promotion/v2/coupons/assign"
payload = {
"memberId": "0e285102-0fe4-4b70-a710-7883d2a25f1b",
"householdId": None,
"campaignId": "b23f36ea-008d-45a8-aa80-003ac973e64c",
"reservationId": "32e9899b-71ad-4b3d-88d2-c35e03da2fac",
"pickUpEndDate": "2026-11-20T00:00:00Z",
"visibleFrom": None,
"storeId": None,
"assignedBy": "Summer game"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
memberId: '0e285102-0fe4-4b70-a710-7883d2a25f1b',
householdId: null,
campaignId: 'b23f36ea-008d-45a8-aa80-003ac973e64c',
reservationId: '32e9899b-71ad-4b3d-88d2-c35e03da2fac',
pickUpEndDate: '2026-11-20T00:00:00Z',
visibleFrom: null,
storeId: null,
assignedBy: 'Summer game'
})
};
fetch('https://{host}/promotion/v2/coupons/assign', 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}/promotion/v2/coupons/assign",
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([
'memberId' => '0e285102-0fe4-4b70-a710-7883d2a25f1b',
'householdId' => null,
'campaignId' => 'b23f36ea-008d-45a8-aa80-003ac973e64c',
'reservationId' => '32e9899b-71ad-4b3d-88d2-c35e03da2fac',
'pickUpEndDate' => '2026-11-20T00:00:00Z',
'visibleFrom' => null,
'storeId' => null,
'assignedBy' => 'Summer game'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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}/promotion/v2/coupons/assign"
payload := strings.NewReader("{\n \"memberId\": \"0e285102-0fe4-4b70-a710-7883d2a25f1b\",\n \"householdId\": null,\n \"campaignId\": \"b23f36ea-008d-45a8-aa80-003ac973e64c\",\n \"reservationId\": \"32e9899b-71ad-4b3d-88d2-c35e03da2fac\",\n \"pickUpEndDate\": \"2026-11-20T00:00:00Z\",\n \"visibleFrom\": null,\n \"storeId\": null,\n \"assignedBy\": \"Summer game\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://{host}/promotion/v2/coupons/assign")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"memberId\": \"0e285102-0fe4-4b70-a710-7883d2a25f1b\",\n \"householdId\": null,\n \"campaignId\": \"b23f36ea-008d-45a8-aa80-003ac973e64c\",\n \"reservationId\": \"32e9899b-71ad-4b3d-88d2-c35e03da2fac\",\n \"pickUpEndDate\": \"2026-11-20T00:00:00Z\",\n \"visibleFrom\": null,\n \"storeId\": null,\n \"assignedBy\": \"Summer game\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/promotion/v2/coupons/assign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"memberId\": \"0e285102-0fe4-4b70-a710-7883d2a25f1b\",\n \"householdId\": null,\n \"campaignId\": \"b23f36ea-008d-45a8-aa80-003ac973e64c\",\n \"reservationId\": \"32e9899b-71ad-4b3d-88d2-c35e03da2fac\",\n \"pickUpEndDate\": \"2026-11-20T00:00:00Z\",\n \"visibleFrom\": null,\n \"storeId\": null,\n \"assignedBy\": \"Summer game\"\n}"
response = http.request(request)
puts response.read_body{
"campaignId": "c15a5161-8fe6-4742-a6dd-7a2bf1f4a2d0",
"couponId": "5db603cd-e153-44d6-9383-92b2da083f94",
"posCouponId": null,
"campaignType": "appCoupon",
"campaignContent": {
"iconTags": [],
"title": "10% Off Coca-Cola & Fanta – Chain 1 Deal",
"description": "Refresh your day with a cool discount! For a limited time, get 10% off Coca-Cola or Fanta when purchased without any other offers. This exclusive deal for Chain 1 is your ticket to crisp, bubbly savings—no stacking needed.",
"brand": "Coca-Cola Refreshments",
"imageUrl": "https://example.com/assets/coke_fanta_discount.jpg",
"discountLabel": "10% Off Coca-Cola & Fanta",
"normalPriceLabel": "Non-member price 5EUR",
"pricePerUnitLabelEnabled": true,
"unitOfMeasure": "L",
"conditionLabel": "Buy 1 Coca-Cola or Fanta",
"receiptDisplayText": "10% off Coca-Cola or Fanta",
"tags": [],
"icons": [],
"autogenerateDiscountLabel": null
},
"validFrom": "2026-11-05T00:00:00Z",
"validTo": "2026-11-11T00:00:00Z",
"activationTime": null,
"storeIds": [],
"chainIds": [
"1"
],
"isRedeemed": false,
"prices": {
"currency": "EUR",
"normalPrice": 5,
"price": 4.5,
"normalPricePerUnit": 10,
"pricePerUnit": 9
},
"discount": {
"priority": 5,
"allowOtherDiscountsOnTop": false,
"itemsApplicationType": "NonDiscountedItems",
"impactLevel": "Line",
"maxDiscountAmount": 5,
"maxDiscountAmountPerCoupon": 0,
"maxNumberApplyPerReceipt": 1,
"maxNumberApplyPerReceiptDecimal": 1,
"applyOnHighestPrice": false,
"applicationType": "OnThreshold",
"discountType": "SimpleLine",
"checkoutTypes": null,
"rewardRedemptionSettings": null,
"rules": [
{
"type": "Percentage",
"value": 0.1,
"thresholdType": "Quantity",
"thresholdValue": 1,
"affiliations": [
{
"type": "Product",
"id": "coca-cola",
"applicationType": "Include"
},
{
"type": "Product",
"id": "fanta",
"applicationType": "Include"
}
]
}
]
},
"redemptionLimit": 1,
"redeemedCount": 0,
"displayPriority": 5,
"deletedAt": null,
"assignedBy": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Create coupon
Your backend calls this to give a customer a coupon for an offer, for example as the reward of a game or a challenge.
The coupon appears in the app at once, or from visibleFrom when that is set. For a preactivated offer the coupon is
activated in the same call.
The call is idempotent on memberId, campaignId and reservationId: repeating it returns the same coupon. When the
offer has a totalCoupons limit that is already reached, the call fails; a coupon reserved earlier under the same
reservationId is still assigned while the reservation is valid, and none of its fields can be changed on assignment.
Where your environment uses households, the coupon of an offer with scope: Household is created for the customer’s
household, so everyone in it sees the coupon and any of them can use it. The household comes from householdId when
your backend sends it; otherwise Lobyco looks it up for the customer, who must then be in exactly one household.
curl --request POST \
--url https://{host}/promotion/v2/coupons/assign \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"memberId": "0e285102-0fe4-4b70-a710-7883d2a25f1b",
"householdId": null,
"campaignId": "b23f36ea-008d-45a8-aa80-003ac973e64c",
"reservationId": "32e9899b-71ad-4b3d-88d2-c35e03da2fac",
"pickUpEndDate": "2026-11-20T00:00:00Z",
"visibleFrom": null,
"storeId": null,
"assignedBy": "Summer game"
}
'import requests
url = "https://{host}/promotion/v2/coupons/assign"
payload = {
"memberId": "0e285102-0fe4-4b70-a710-7883d2a25f1b",
"householdId": None,
"campaignId": "b23f36ea-008d-45a8-aa80-003ac973e64c",
"reservationId": "32e9899b-71ad-4b3d-88d2-c35e03da2fac",
"pickUpEndDate": "2026-11-20T00:00:00Z",
"visibleFrom": None,
"storeId": None,
"assignedBy": "Summer game"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
memberId: '0e285102-0fe4-4b70-a710-7883d2a25f1b',
householdId: null,
campaignId: 'b23f36ea-008d-45a8-aa80-003ac973e64c',
reservationId: '32e9899b-71ad-4b3d-88d2-c35e03da2fac',
pickUpEndDate: '2026-11-20T00:00:00Z',
visibleFrom: null,
storeId: null,
assignedBy: 'Summer game'
})
};
fetch('https://{host}/promotion/v2/coupons/assign', 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}/promotion/v2/coupons/assign",
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([
'memberId' => '0e285102-0fe4-4b70-a710-7883d2a25f1b',
'householdId' => null,
'campaignId' => 'b23f36ea-008d-45a8-aa80-003ac973e64c',
'reservationId' => '32e9899b-71ad-4b3d-88d2-c35e03da2fac',
'pickUpEndDate' => '2026-11-20T00:00:00Z',
'visibleFrom' => null,
'storeId' => null,
'assignedBy' => 'Summer game'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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}/promotion/v2/coupons/assign"
payload := strings.NewReader("{\n \"memberId\": \"0e285102-0fe4-4b70-a710-7883d2a25f1b\",\n \"householdId\": null,\n \"campaignId\": \"b23f36ea-008d-45a8-aa80-003ac973e64c\",\n \"reservationId\": \"32e9899b-71ad-4b3d-88d2-c35e03da2fac\",\n \"pickUpEndDate\": \"2026-11-20T00:00:00Z\",\n \"visibleFrom\": null,\n \"storeId\": null,\n \"assignedBy\": \"Summer game\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://{host}/promotion/v2/coupons/assign")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"memberId\": \"0e285102-0fe4-4b70-a710-7883d2a25f1b\",\n \"householdId\": null,\n \"campaignId\": \"b23f36ea-008d-45a8-aa80-003ac973e64c\",\n \"reservationId\": \"32e9899b-71ad-4b3d-88d2-c35e03da2fac\",\n \"pickUpEndDate\": \"2026-11-20T00:00:00Z\",\n \"visibleFrom\": null,\n \"storeId\": null,\n \"assignedBy\": \"Summer game\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/promotion/v2/coupons/assign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"memberId\": \"0e285102-0fe4-4b70-a710-7883d2a25f1b\",\n \"householdId\": null,\n \"campaignId\": \"b23f36ea-008d-45a8-aa80-003ac973e64c\",\n \"reservationId\": \"32e9899b-71ad-4b3d-88d2-c35e03da2fac\",\n \"pickUpEndDate\": \"2026-11-20T00:00:00Z\",\n \"visibleFrom\": null,\n \"storeId\": null,\n \"assignedBy\": \"Summer game\"\n}"
response = http.request(request)
puts response.read_body{
"campaignId": "c15a5161-8fe6-4742-a6dd-7a2bf1f4a2d0",
"couponId": "5db603cd-e153-44d6-9383-92b2da083f94",
"posCouponId": null,
"campaignType": "appCoupon",
"campaignContent": {
"iconTags": [],
"title": "10% Off Coca-Cola & Fanta – Chain 1 Deal",
"description": "Refresh your day with a cool discount! For a limited time, get 10% off Coca-Cola or Fanta when purchased without any other offers. This exclusive deal for Chain 1 is your ticket to crisp, bubbly savings—no stacking needed.",
"brand": "Coca-Cola Refreshments",
"imageUrl": "https://example.com/assets/coke_fanta_discount.jpg",
"discountLabel": "10% Off Coca-Cola & Fanta",
"normalPriceLabel": "Non-member price 5EUR",
"pricePerUnitLabelEnabled": true,
"unitOfMeasure": "L",
"conditionLabel": "Buy 1 Coca-Cola or Fanta",
"receiptDisplayText": "10% off Coca-Cola or Fanta",
"tags": [],
"icons": [],
"autogenerateDiscountLabel": null
},
"validFrom": "2026-11-05T00:00:00Z",
"validTo": "2026-11-11T00:00:00Z",
"activationTime": null,
"storeIds": [],
"chainIds": [
"1"
],
"isRedeemed": false,
"prices": {
"currency": "EUR",
"normalPrice": 5,
"price": 4.5,
"normalPricePerUnit": 10,
"pricePerUnit": 9
},
"discount": {
"priority": 5,
"allowOtherDiscountsOnTop": false,
"itemsApplicationType": "NonDiscountedItems",
"impactLevel": "Line",
"maxDiscountAmount": 5,
"maxDiscountAmountPerCoupon": 0,
"maxNumberApplyPerReceipt": 1,
"maxNumberApplyPerReceiptDecimal": 1,
"applyOnHighestPrice": false,
"applicationType": "OnThreshold",
"discountType": "SimpleLine",
"checkoutTypes": null,
"rewardRedemptionSettings": null,
"rules": [
{
"type": "Percentage",
"value": 0.1,
"thresholdType": "Quantity",
"thresholdValue": 1,
"affiliations": [
{
"type": "Product",
"id": "coca-cola",
"applicationType": "Include"
},
{
"type": "Product",
"id": "fanta",
"applicationType": "Include"
}
]
}
]
},
"redemptionLimit": 1,
"redeemedCount": 0,
"displayPriority": 5,
"deletedAt": null,
"assignedBy": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Authorizations
Body
The coupon to create: the customer, the offer and a reservation id of your choice.
A coupon to assign to a customer from an offer, for example as a game reward.
Response
The assigned coupon.
Coupon details