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 loyalty vouchers at a time interval

GET
/api
Last modified:2025-02-07 15:16:24
Returns the vouchers that are still active and that have been activated in the indicated period startDate - endDate.
NB: returns only the vouchers active in the indicated period.
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 to get the records from 21 to 40.

Fields#

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}}&startDate=2021-03-17 08:45:00&endDate=2021-03-17 13:45:00' \
--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 voucher - success
application/json
Body

Example
{
    "success": true,
    "valueObjectList": [
        {
            "id": "502eddd9-0178-49d3-b7a7-18e8850f1c25",
            "barcode": "FAKE-123456",
            "totalAmount": 10,
            "documentType": "LOALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1001,
            "branchDescription": "TEST - MILANO SAN BABILA",
            "cardBarcode": "0099000001209",
            "clientCode": "31031989",
            "clientIdKeepit": "31031989",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2020-02-06 13:22:19",
            "endValidity": "2020-12-31 00:00:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "1001",
            "sellerDescription": "Marco Bianchi"
        },
        {
            "id": "8abe6b18-d81a-468f-b4dd-5de54d4956db",
            "barcode": "FAKE-123456",
            "totalAmount": 10,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1001,
            "branchDescription": "TEST - MILANO SAN BABILA",
            "cardBarcode": "0099000001209",
            "clientCode": "31031989",
            "clientIdKeepit": "31031989",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2020-02-06 13:22:19",
            "endValidity": "2020-12-31 00:00:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "1001",
            "sellerDescription": "Marco Bianchi"
        },
        {
            "id": "9ea137e7-24a4-4a8c-836f-6aa92cdc70f7",
            "barcode": "FAKE-123456",
            "totalAmount": 10,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1001,
            "branchDescription": "TEST - MILANO SAN BABILA",
            "cardBarcode": "0099000001209",
            "clientCode": "31031989",
            "clientIdKeepit": "31031989",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2020-02-06 13:22:19",
            "endValidity": "2020-12-31 00:00:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "1001",
            "sellerDescription": "Marco Bianchi"
        },
        {
            "id": "ac35f63f-eefc-46ba-a149-b46cc5adbd26",
            "barcode": "FAKE-123456",
            "totalAmount": 10,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1001,
            "branchDescription": "TEST - MILANO SAN BABILA",
            "cardBarcode": "0099000001209",
            "clientCode": "31031989",
            "clientIdKeepit": "31031989",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2020-02-06 13:22:19",
            "endValidity": "2020-12-31 00:00:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "1001",
            "sellerDescription": "Marco Bianchi"
        },
        {
            "id": "e7854e9b-e3d1-4271-80b0-b62a2b862cf3",
            "barcode": "FAKE-123456",
            "totalAmount": 10,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1001,
            "branchDescription": "TEST - MILANO SAN BABILA",
            "cardBarcode": "0099000001209",
            "clientCode": "31031989",
            "clientIdKeepit": "31031989",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2020-04-20 09:36:03",
            "endValidity": "2020-12-31 00:00:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "1001",
            "sellerDescription": "Marco Bianchi"
        },
        {
            "id": "f9483c8b-ecac-4569-b3e0-df5c3ad6fe7f",
            "barcode": "FAKE-123456",
            "totalAmount": 10,
            "documentType": "LOYALTY",
            "cause": "VOUCHER",
            "documentStatus": "ACTIVE",
            "branchCode": 1001,
            "branchDescription": "TEST - MILANO SAN BABILA",
            "cardBarcode": "0099000001209",
            "clientCode": "31031989",
            "clientIdKeepit": "31031989",
            "subjectDenomination": "Biasotto Luca",
            "confirmationDateOrder": "2020-02-06 13:22:19",
            "endValidity": "2020-12-31 00:00:00",
            "currency": "EUR",
            "currencySymbol": "€",
            "sellerCode": "1001",
            "sellerDescription": "Marco Bianchi"
        }
    ],
    "moreRows": false
}
🟠422Unique constraint error
Modified at 2025-02-07 15:16:24
Previous
Get customer loyalty vouchers
Next
Get last loyalty vouchers
Built with