4WS Suite
Home
API Reference
  • Data mangement API
  • Documents API
Home
API Reference
  • Data mangement API
  • Documents API
Fourwayshop
  1. Loyalty vouchers
  • Document Manager
    • Orders
      • Save Sale Order
      • Save Return Order
    • Orchestrated Orders
      • Orchestrated Order
      • Orchestrated Return order
      • Orchestrated Update order
    • Cart
      • Cart Validation
      • Cart Full Validation
    • Sales
      • Save receipt
      • Salve only Order
      • Replace or update sale
      • Get last digital order
    • Warehouse
      • Save Entry from supplier
      • Save Transfer document
      • Save Free Entry
    • Purchase
      • Save Purchase
    • Get Document
      GET
    • Update Document external references
      POST
  • Customer
    • Get Customer
      GET
    • Set Customer Opt-in
      POST
  • Loyalty vouchers
    • Get customer loyalty vouchers
      GET
    • Get loyalty vouchers at a time interval
      GET
    • Get last loyalty vouchers
      GET
  • Giftcard
    • Get Giftcard
      GET
    • Update Giftcard
      POST
    • Generate Gift Card Barcode
      POST
    • Gift Card PDF Generation
      POST
  • Stock
    • Get Stock
      POST
    • Get last stock
      GET
    • Insert Stock
      POST
  1. Loyalty vouchers

Get customer loyalty vouchers

GET
/api
Last modified:2025-02-07 15:16:09
Returns the active loyalty vouchers for the passed customer card barcode.
The web service response will be composed of:
success: Boolean that indicated wether the request was successful or not
moreRows: Boolean that indicated wether the are more rows to be retrieved or not
valueObjectList: Array of customer voucher

Actors#

API Client: The system or user initiating the request.
4ws.trade: The backend system that processes the request.

Pagination#

The request returns a maximum of 20 elements in the valueObjectList array. If moreRows is true, then you can request the next 20 elements by appending the query parameter &start=X on the request URL, where X is the first element to be retrieved.
For example, the first request returns 20 elements and moreRows is true. You can then make a new call to the web service, appending &start=20 on the URL and to get the records from 21 to 40.

Fields#

NB: if you want the user's barcode in a non-standard field, this field must be specified in pkFieldName

User data#

FieldDescriptionType
validTicketCurrent number of valid receipts for the issuance of the voucherNumber
remainingPurchasesNumber of valid purchases neeed for next voucherNumber
validSalesTotalAmountCurrent total valid amount of sales for the issuance of the voucherNumber
validSalesTotalCashbackTotal accumulated cashback for the issuance of the voucherNumber

Voucher#

FieldDescriptionType
idVoucher idString
barcodeVoucher barcodeString
totalAmountVoucher amountNumber
documentTypeDocument typeString
causeDocument causeString
documentStatusOPEN=voucher not used, CLOSE=voucher spentString
branchCodeBranch codeNumber
branchDescriptionBranch descriptionString
cardBarcodeCustomer fidelity cardString
clientCodeCustomer codeString
clientIdKeepitKeepIT subject idString
subjectDenominationSubject denominationString
confirmationDateOrderValidity start date with format "yyyy-MM-dd HH:mm:ss", using GMT timeString
endValidityEnd validity data with format "yyyy-MM-dd HH:mm:ss", using GMT timeString
currencyCurrency (ex EUR)String
currencySymbolCurrency symbolString
sellerCodeSeller codeString
sellerDescriptionSeller descriptionString

Request

Query Params

Header Params

Body Params application/x-www-form-urlencoded

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request GET '/api?cmd=getLoyaltyVouchers_v1&applicationId={{APPLICATION_ID}}&appId={{APPLICATION_ID}}&cardBarcode=0099000001209&pkFieldName=identifier' \
--header 'applicationId: {{APPLICATION_ID}}' \
--header 'appId: {{APPLICATION_ID}}' \
--header 'namespace: {{NAMESPACE}}' \
--header 'languageId: {{LANGUAGE}}' \
--header 'username: {{USERNAME}}' \
--header 'password: {{PASSWORD}}' \
--header 'companyId: {{COMPANY_ID}}' \
--header 'siteId: {{SITE_ID}}' \
--header 'loadRoles: Y'

Responses

🟢200Get customer loyalty vouchers - success
application/json
Body

Example
{
    "success": true,
    "validTicket": 2,
    "remainingPurchases": 1,
    "validSalesTotalAmount": 694,
    "validSalesTotalCashback": 70,
    "identifier" : "0099000001209",
    "valueObjectList": [
        {
            "id": "4e8d2fd9-8ed3-4bda-b783-ced258db8828",
            "barcode": "7000000000000017",
            "totalAmount": 330.18,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "identifier" : "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-03-17 10:42:52",
            "endValidity": "2021-04-17 10:42:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "69093ce7-b47e-4863-9338-6c3a91c6da9a",
            "barcode": "7000000000000055",
            "totalAmount": 72.9,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-03-24 10:38:59",
            "endValidity": "2021-04-24 10:39:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "0f6b06f3-4b97-4d53-9d0c-6a8cc2950815",
            "barcode": "7000000000000079",
            "totalAmount": 85,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-03-25 16:18:41",
            "endValidity": "2021-04-25 16:19:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "33a2449a-8f12-49ca-beaf-f6b5e4435a87",
            "barcode": "7000000000000109",
            "totalAmount": 98.3,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-03-29 08:46:51",
            "endValidity": "2021-04-29 08:47:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "d94b059b-0501-4cdb-97fd-ab931f177ec6",
            "barcode": "7000000000000093",
            "totalAmount": 98.3,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-03-29 08:46:51",
            "endValidity": "2021-04-29 08:47:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "ff1bf7d1-f6b6-495b-9714-fa66c86b55a1",
            "barcode": "7000000000000130",
            "totalAmount": 50.5,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-04-07 13:08:19",
            "endValidity": "2021-05-07 13:09:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "e1e72960-c1df-48ee-b002-c9b07c7def1b",
            "barcode": "7000000000000215",
            "totalAmount": 180.8,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-04-27 15:41:11",
            "endValidity": "2021-05-27 15:41:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "5657b193-88ab-4179-83b6-c7782b6d785e",
            "barcode": "7000000000005661",
            "totalAmount": 84.46,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-05-26 10:24:14",
            "endValidity": "2021-06-26 10:24:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "24a01070-34e7-4e98-95e4-91baaf3193a8",
            "barcode": "7001150000011",
            "totalAmount": 26.9,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-06-17 15:44:57",
            "endValidity": "2021-07-17 15:48:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "7c8d5441-19d6-456b-8dd9-7644efe97a8a",
            "barcode": "7001150000028",
            "totalAmount": 15.3,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-06-18 08:04:47",
            "endValidity": "2021-07-18 08:05:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "035b7e0b-4133-4922-ba57-dbe3172859da",
            "barcode": "7001150000042",
            "totalAmount": 32.7,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-06-24 09:02:41",
            "endValidity": "2021-07-24 09:02:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "58b9d908-b096-4516-8f75-b523f937d510",
            "barcode": "7001150000059",
            "totalAmount": 75,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-07-02 07:26:39",
            "endValidity": "2021-08-02 07:28:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "40d66852-6cdf-43a6-aae1-4d7c46df94ab",
            "barcode": "7001150000066",
            "totalAmount": 75,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-07-09 07:41:11",
            "endValidity": "2021-08-09 07:41:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "0af9d94b-4639-49fb-a795-b5a7f38efc08",
            "barcode": "7001150000103",
            "totalAmount": 96,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-08-02 16:09:59",
            "endValidity": "2021-09-02 16:10:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "85c743a8-6ecb-4f41-97ce-1a2e0358d752",
            "barcode": "7001150000646",
            "totalAmount": 72,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-08-19 14:57:17",
            "endValidity": "2021-09-19 14:57:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "06134cff-75b2-44d3-a42d-68eed537d416",
            "barcode": "7001150000653",
            "totalAmount": 98,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-08-19 16:04:46",
            "endValidity": "2021-09-19 16:05:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "93b499ec-32b7-4f11-abcc-10295677ea28",
            "barcode": "7001150000660",
            "totalAmount": 92,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-08-24 06:52:00",
            "endValidity": "2021-09-24 07:00:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        },
        {
            "id": "51501521-4411-4587-a5eb-761a95ce296d",
            "barcode": "7001150000837",
            "totalAmount": 52,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1150,
            "branchDescription": "Negozio Mobile shop (Michele)",
            "cardBarcode": "0099000001209",
            "clientCode": "60272",
            "clientIdKeepit": "60272",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2021-12-15 13:29:06",
            "endValidity": "2022-01-15 13:29:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "111",
            "sellerDescription": "Michele Bozzo"
        }
    ],
    "moreRows": false
}
🟠422Unique constraint error
Modified at 2025-02-07 15:16:09
Previous
Set Customer Opt-in
Next
Get loyalty vouchers at a time interval
Built with