Getting started
We are introducing the following APIs for managing coupons, stamp cards, adding new members, and updating member transactions. This document outlines the primary functionalities. For comprehensive documentation and example responses, please refer to: Diller API Documentation.
Authentication: Diller API v2 uses OpenId/OAuth 2.0 for client authentication.
Each POS register should be configured with a Client ID and Client Secret for authentication. Including a parameter for the department ID is beneficial to identify the origin of all members and transactions.
We recommend creating a small UI in the cash-register to configure the integration for easier setup.
Configuration APIs:
GET /api/v2.0/stores
Retrieve store information. Save the store ID for future use.
GET /api/v2.0/stores/{storeId}/departments
Retrieve a list of departments for the store. Select the one you are going to use and save the department ID for future use.
API Usage Workflow:
Member Search and Enrollment:
GET /api/v2.0/stores/{storeId}/members/search
We support search by :
Phone
personal identification number (SSN)
Drivers-license (Sweden) (QR or Barcode)
Email
Any additionalID you can utilize
Search for a member. If not found, enroll the member.
POST /api/v2.0/stores/{storeId}/members/enroll
Enroll a new member.
The member will receive an sms on their phone within seconds to finish the registration and update their preferances.
If member found : Retrieve Coupons and Stamp Cards:
GET /api/v2.0/stores/{storeId}/members/{memberId}/coupons
GET /api/v2.0/stores/{storeId}/members/{memberId}/stamp-cards
POS Calculation:
Calculate and apply discounts for coupons (either % or fixed amount).
do NOT calculate % discount on items with discounts. (Stamp-card or coupons) This would result in doublediscount and is NOT reccomended.
If the basket contains items with both stamp-carded/couponed items and other items eligble for % or fixed discount. Calculate separately, leaving already discounted items out.
If a product ID is attached to a coupon, the discount is valid only for those products and can be applied automatically.
If no product ID is attached, the coupon is valid for the entire purchase. A UI prompt should ask for coupon usage. Remember the above statement regarding doublediscounts.
Apply stamp card logic. Each product in the purchase corresponding to a stamp card should earn a stamp.
Stamp Card Usage:
If
required_stamps - stamps_collected > 0
, the card can be used. When stamping, ensure that when available stamps reach 0, the product is free (100% discount).If
stamp.is_restartable=true
, counting can restart from the required stamps number again.If
stamp.is_restartable=false
, the stamp card can only be used once. When available stamps = 0, it is no longer usable.
Transaction Updates:
POST /api/v2.0/stores/{storeId}/members/{memberId}/transactions
Add purchase information to Diller, including the usage of coupons and stamp cards.
Handling Returns:
If the previous
transactionId
is stored, cancel it in Diller. For partial returns, cancel everything and send the remainder as a new transaction.POST /api/v2.0/stores/{storeId}/transactions/{transactionId}/cancel
If the previous
transactionId
is not available, send a new transaction with a negative amount for the returned products (and the total amount negative as well).
Test Environment:
Test URL: https://api.prerelease.dillerapp.com/
Client ID: XXX
Client Secret: XXX
Production Environment:
Production URL: https://api.diller.app/
Client ID: XXX
Client Secret: XXX
For any further assistance or queries, please refer to the full API documentation or contact our support team.