Vouchers
A voucher gives a discount to a customer when the customer buys something. The application calls it Cupon de reducere. Expressoft applies the voucher at checkout, in the POS. There is no redeem operation in this API.
Read the vouchers of a customer
Query
query GetCustomerVouchers($customer: [Guid], $active: Boolean, $date: DateTime) {
customers {
customer(publicKey: $customer) {
items {
publicKey
loyalty {
vouchers {
vouchers(active: $active, date: $date) {
maximumUsageCount
usedCount
voucher {
publicKey
name
code
beginDate
endDate
isActive
maximumUsageCount
discountType
discountValue
currency { publicKey symbol }
locations { publicKey name }
products {
quantity
discountType
discountValue
salePrice
product { publicKey name }
}
}
}
}
}
}
}
}
}Variables
{
"customer": [
"<customer key>"
],
"active": true,
"date": "2026-10-15T00:00:00"
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "query GetCustomerVouchers($customer: [Guid], $active: Boolean, $date: DateTime) { customers { customer(publicKey: $customer) { items { publicKey loyalty { vouchers { vouchers(active: $active, date: $date) { maximumUsageCount usedCount voucher { publicKey name code beginDate endDate isActive maximumUsageCount discountType discountValue currency { publicKey symbol } locations { publicKey name } products { quantity discountType discountValue salePrice product { publicKey name } } } } } } } } } }", "variables": {"customer": ["<customer key>"], "active": true, "date": "2026-10-15T00:00:00"}}'Response
{
"data": {
"customers": {
"customer": {
"items": [
{
"publicKey": "00000000-0000-0000-0000-000000000001",
"loyalty": {
"vouchers": {
"vouchers": [
{
"maximumUsageCount": 1,
"usedCount": 0,
"voucher": {
"publicKey": "00000000-0000-0000-0000-000000000401",
"name": "Welcome voucher",
"code": "WELCOME10",
"beginDate": "2026-10-06",
"endDate": "2026-10-20",
"isActive": true,
"maximumUsageCount": 100,
"discountType": "PERCENT",
"discountValue": 10.0,
"currency": {
"publicKey": "00000000-0000-0000-0000-000000000211",
"symbol": "RON"
},
"locations": [
{
"publicKey": "00000000-0000-0000-0000-000000000051",
"name": "Downtown Restaurant"
}
],
"products": []
}
}
]
}
}
}
]
}
}
}
}active and date are optional filters. active: true returns the active vouchers. date returns the vouchers valid on that date.
Fields
Field | Meaning |
|---|---|
voucher.name, voucher.code | The name and the code of the voucher. |
voucher.beginDate, voucher.endDate | The validity period. Both are always set. |
voucher.discountType | PERCENT or AMOUNT. |
voucher.discountValue | The discount, according to discountType. |
voucher.currency | The currency of the discount, when it is an amount. |
voucher.locations | The locations where the voucher can be used. |
voucher.products | The products the voucher applies to, when it is restricted. Each rule has a quantity, a discount or a sale price. |
voucher.maximumUsageCount | The maximum number of uses of the voucher. null or 0 means unlimited. |
maximumUsageCount | The maximum number of uses for this customer. It overrides the voucher value when it is set. |
usedCount | How many times the customer used the voucher. |