Getting started for E-commerce

Edited

We are introducing the following APIs for calling and updating coupons, adding new members, and updating transactions on members.

The documentation below highlights the main functionalities. Please see the full documentation and example responses here: Diller API Documentation.

DillerAPI v2 uses OpenId/OAuth2.0 to authenticate clients. Each "POS register" should be configured with a Client ID and a client secret for authentication. It's also beneficial to have a parameter for department ID to identify where all members/transactions originate.

Diller suggests creating a small UI to configure the integration, making it easier to set up.

APIs for Configuration/Setup of Plugin

  • GET /api/v2.0/stores

    • Get 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 the member page).

Optional: Get All Coupons for Diller

  • GET /api/v2.0/stores/{storeId}/coupons

API Usage Workflow

  1. Creating a User in Ecommerce

    • GET /api/v2.0/stores/{storeId}/members/search

      • If a member is not found, add it to Diller:

        • POST /api/v2.0/stores/{storeId}/members

  2. Purchase Process

    • When the relevant step to use coupons arises:

      • GET /api/v2.0/stores/{storeId}/members/{memberId}/coupons/ to get the coupons available for this member.

    • Just before the checkout button:

      • Validate each coupon used:

        • GET /api/v2.0/stores/{storeId}/members/{memberId}/coupons/{couponId}/validate to check if it's still valid for the member.

    • After purchase:

      • Reserve the coupons in Diller with the reserve call:

        • POST /api/v2.0/stores/{storeId}/members/{memberId}/coupons/{couponCode}/reserve

  3. Order Shipment/Payment

    • Add purchase information to Diller (including the usage of coupons):

      • POST /api/v2.0/stores/{storeId}/members/{memberId}/transactions

  4. Purchase Return

    • If a purchase is returned, cancel it in Diller. If partially returned, cancel and send the remainder as a new transaction:

      • POST /api/v2.0/stores/{storeId}/transactions/{transactionId}/cancel

Test URL

UI Needed

  • Register Member Page

    • Register new members: name, address, email, phone, etc. (member object) and segments (create UI dynamically from the API call: GET /api/v2.0/stores/{storeId}/segments).

    • Important to get the two consents at the bottom.

  • Edit Member Information Page

    • Add to my page if possible. Here, you can also add some membership details, points, member level, etc.

Purchase Process Requirements

  • Customer Login

    • Ensure the customer is logged in to get available coupons.

    • At the appropriate moment in the purchase process, call GET Coupons to retrieve any coupons/discounts to be used.

    • Before the “buy now” button, validate the coupons to ensure they are still valid.

    • To send the transaction to Diller, typically done when you collect payment on the order:

      • Points are awarded, and coupons are deducted in Diller.

  • Guest Purchase

    • If a guest purchase occurs (not logged into ecommerce), add the two consent checkboxes to the purchase page so the customer can join the loyalty program.

    • If GDPR is checked, add to Diller and also store into ecommerce.