Getting started for ecommerce
Diller API:
We will introduce the below API’s for calling and updating coupons, adding new members, and updating transactions on members. The documentation below is only pinpointing main functionality. Please see full documentation and example responses here: https://api.prerelease.dillerapp.com/swagger/index.html
DillerAPI v2 uses OpenId/Oauth2.0 to authenticate clients.
Each "Customer/Shop" should be configured with Client Id and a client secret for authentication, it's also beneficial to have a parameter for department Id, so we can identify where all members/transactions originate.
Diller suggest that you create a small UI to configure the integration, to make it easier to set it up.
(First do : POST {{RootURL}}/connect/token
API’s to call for configuration/setup of plugin:
GET /api/v2.0/stores
Get the information about the store. Save Id into config file for future usage
GET /api/v2.0/stores/{storeId}/departments
Get a list of departments for the store, select one and save Id for future use
GET /api/v2.0/stores/{storeId}/segments
Get a list of all segments and valid values for the store. (to be used on my member page)
Optional: Get all coupons for diller (if needed to be stored inside ecommerce)
GET /api/v2.0/stores/{storeId}/coupons
API Usage workflow:
When creating a user in ecommerce do a GET /api/v2.0/stores/{storeId}/members/search
If member not found, add it to Diller
POST /api/v2.0/stores/{storeId}/members
Purchase process, when relevant step to use coupons do a GET /api/v2.0/stores/{storeId}/members/{memberId}/coupons/ to get the coupons available for this member
Just before the checkout “button do a validate call for each coupon used /api/v2.0/stores/{storeId}/members/{memberId}/coupons/{couponId}/validate to check for is its still valid for the member.
After purchase, reserve the coupons in Diller with the reservce POST /api/v2.0/stores/{storeId}/members/{memberId}/coupons/{couponCode}/reserve
When the order is shipped/payed - Add purchase information to Diller (including usage of coupons)
POST /api/v2.0/stores/{storeId}/members/{memberId}/transactions
If purchase is returned - cancel it in Diller, if partial returned, cancel the send in remainder as a new transaction
POST /api/v2.0/stores/{storeId}/transactions/{transactionId}/cancel
Test URL: https://api.prerelease.dillerapp.com/
ClientId: XXX
ClientSecret: XXX
UI needed:
We need a “register member page” where we register new members.
Name address, email, phone ++ (member object) and segments (create UI dynamically from the API call
GET /api/v2.0/stores/{storeId}/segments
NB : Important to get the two consents at the bottom
We also need an edit page for this info.
Add to my page if possible 😊
Here you can also add some membership details, points memberlevel etc.
In the purchase process we require the customer to be logged in, so that we can get coupons available
Then at the appropriate moment in the purchase process call GET Coupons to get any coupons/discounts to be used.
Continue to the purchase screen. Then just before “buy now” button do a validate of the coupons.
So that you know they are still valid.
To send the transaction to diller, we normally do that when you collect payment on the order
Then we give points and deduct coupons in diller.
Also if a guest purchase is happening, not logged in to ecommerce, then add the two consent checkboxes to the purchase page. (so that the customer can join the loyalty program)
If GDPR is checked the add to diller and also store into ecommerce