Are you a developer and want to integrate LYTTY loyalty program to your client's POS or Ecommerce ?

see some useful tips on how to do that in a simple mode. Find everything you need to integrate LYTTY into your own application

Lytty API Docs and Guides

Everything you need to know to work with the LYTTY Platform

Loyalty point Accumulation Authenticating (Existing customers)

The first thing you will need to do is to login to LYTTY account and import your customer data. We assume that, those who are going through this document has a valid Lytty account and already imported the customer data in to the same

Lets check how you can start integrating your LYTTY loyalty program to your Ecommerce of POS. The following image has got 4 scenarios which is detailed in the following pages.

  • Authenticate the Loyalty Customer by entering Loyalty ID.
  • Initiate the transaction at Lytty by providing the transaction id and transaction amount
  • Check the reward points based on the transaction amount and reward rules of the active loyalty program
  • Completing the transaction and the Loyalty points of the customer gets updated

1. Authenticating Existing loyalty Customers

 

Once a customer is added to LYTTY, each customer will be allocated a unique Loyalty ID, which is referred as "Loyalty ID" in the following sections.

Here the objective is to Validate or authenticate the customer for their genuine Loyalty ID. Once found Genuine ,you will get a return status as "Success". Use the following API for this operation - Please see the sample screenshot below.

 
 

API

json Input #REQUEST_URL#.php?inputarr={"request_mode":"API_UPDATE_LYTTY_ID","merchant_id":"CIFH0NQJ26","loyalty_id":"4109426365221984", "lyttyauth_key":"e563b7804e40245ee961d17a82c55436", "clientMobile":"9446529266"}

Return status

 
 

API_UPDATE_LYTTY_ID - Authenticates the loyalty ID. Returns Success/ Failure status and message

{"return_status":true,"return_message":"Loyalty ID Successfully Verified", "return_loyalty_id":"4109426365221984"}

Parameters used in this API

The parameter values of merchant_id and lyttyauth_key are obtained from the Lytty Merchant Login. Client related data like loyalty_id and clientMobile are to be provided by your application.

LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows.

 
loyalty_id 16 digit Loyalty ID of the customer
client_mobile Mobile No of the customer

The mobile number of the customer is used to de-dupe the customer at LYTTY. 16 digit Loyalty ID in combination with Customer Mobile number validates the Customer for Loyalty.


2. Adding new Loyalty Customers

 

New customers can be added to Loyalty either from POS or Ecommerce. Minimal customer data shall be captured at this point and Mobile number being mandatory. Its mobile number with which customers are de-duped at Lytty. If the mobile number provided does not exists in Lytty a new customer is added there a 16 digit Loyalty ID is assigned. IF the mobile number already exists there, the Loyalty ID is returned by the service.

API

 

 

#REQUEST_URL#.php?inputarr={{"request_mode":"API_LYTTY_CUSTOMER_ADD", "first_name":"","last_name":"","email_id":"", "mobile_no":"1231233212","city":"","zip":"", "loyalty_validation":0,"merchant_id":"CIFEZL8Q48", "lyttyauth_key":"43706528093a08491bd9a8dbeb6e4990"}}

 

API_UPDATE_LYTTY_ID - Authenticates the loyalty ID. Returns Success/ Failure status and message

Parameters used in this API

LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows:

 
sfirstname First name of the customer. Not mandatory
slastname Last name of the customer. Not mandatory
semail Email of the customer. Not mandatory
smobile Mobile no of the customer. Mandatory
scity Not mandatory
szip Not mandatory
 

The mobile number of the customer is used to de-dupe the customer at LYTTY. 16 digit Loyalty ID in combination with Customer Mobile number validates the Customer for Loyalty.

Return status

{"return_status":true,"return_message":"Customre added successfully","return_loyalty_id":"1234567834562345"}

If the mobile number provided does not exists in Lytty a new customer is added there a 16 digit Loyalty ID is assigned. IF the mobile number already exists there, the Loyalty ID is returned by the service. loyalty_id is the 16 digit Loyalty ID assigned to the customer. You may save it in your application.


3. Loyalty Transaction initiation

 

Once the Loyalty ID is authenticated, its required to Initiate a new Transaction at Lytty corresponding to the actual transaction happening at POS or Ecommerce. In other words this API is called in the final stage of Invoice or Sales order preparation. See the below image to know the touch points of this API

 

API

 

#REQUEST_URL#.php?inputarr={"request_mode":"API_UPDATE_CURRENT_TRANSACTION","merchant_id":"CIFH0NQJ26","loyalty_id":"4109426365221984", "lyttyauth_key":"e563b7804e40245ee961d17a82c55436", "transaction_id":"11223344","transaction_value":"500"}

 

Parameters used in this API

LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows:

 
loyalty_id 16 digit Loyalty ID of the customer
transaction_id A unique identifier for the current transaction
transaction_value Monetary value of the transaction

The mobile number of the customer is used to de-dupe the customer at LYTTY. 16 digit Loyalty ID in combination with Customer Mobile number validates the Customer for Loyalty.

Return status

 

API_UPDATE_CURRENT_TRANSACTION - Initiates a new transaction at Lytty and returns a Transaction Ref Id

{"return_status":true,"return_message":"Existing Data","return_lyttyref_id":"d1f491a404d6854880943e5c3cd9ca25"}

On successfully initiating a transaction at Lytty, you will get a lyttyref_id which need to be provided for all other services required to complete adding and redemption of Loyalty points and to complete the transaction.


4. Point accumulation

 

To find out how many points the customer will gain out of this transaction, the following API shall be called in succession. Additionally, the lyttyref_id is required to be provided. The Reward Rules applied to the active Loyalty Program will calculates and returns the reward points.

API

 

#REQUEST_URL#.php?inputarr={"request_mode":"API_SHOW_LYTTY_POINTS_CURRENT_TRANSACTION", "lyttyauth_key":"e563b7804e40245ee961d17a82c55436","merchant_id":"CIFH0NQJ26","loyalty_id":"4109426365221984", "lyttyref_id":"d1f491a404d6854880943e5c3cd9ca25", "transaction_value":"500"}

 

Return status

 

API_SHOW_LYTTY_POINTS_CURRENT_TRANSACTION - Fetch Loyalty points for the current transaction

{"return_status":true,"return_message":"You will earn 100 points with this purchase","return_points":100,"return_pointvalue":""}

Parameters used in this API

The transaction amount and Lytty reference Id are to be provided along with your Merchant ID and authentication key

LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows :

 
loyalty_id 16 digit Loyalty ID of the customer
lyttyref_id Lytty reference Id returned by Lytty on initiating a transaction
transaction_value Monetary value of the transaction

5. Point accumulation Transaction completion

 

The transaction can be now completed by calling the following API on the completion of your transaction. As reference the Invoice No shall be provided as transaction_refid

API

 

#REQUEST_URL#.php?inputarr= {"request_mode":"API_LYTTY_POINTS_REDEEM_SUCCESS","lyttyauth_key":"e563b7804e40245ee961d17a82c55436", "merchant_id":"CIFH0NQJ26", "loyalty_id":"4109426365221984","lyttyref_id":"d1f491a404d6854880943e5c3cd9ca25","transaction_refid":"ORD1234"}

 

Return status

 

API_LYTTY_POINTS_REDEEM_SUCCESS - Complete the transaction Returns Sale Value.

{"return_status":true,"return_message":"Transaction valid","return_salevalue":"500.00","return_redeemvalue":"0.00","transaction_status":null}

Parameters used in this API

The Lytty reference id and unique document no of the transaction shall be provided along with your Merchant ID and authentication key.

LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows.:

 
loyalty_id 16 digit Loyalty ID of the customer
lyttyref_id Lytty reference Id returned by Lytty on initiating a transaction
transaction_refid transaction document no like Invoice no or Order no

For Request url : Kindly send request to support@lytty.com


Redemption of Loyalty Points

Lets check how you can manage the Redemption of Loyalty points directly integrated to your Ecommerce or Point of Sales. The following image has got 4 API scenarios , which we will discuss in detail.

To redeem the loyalty points as discount at POS or Ecommerce, the following sequence of steps need to be executed.

  • Authenticate the Loyalty Customer. Either by entering Loyalty ID or by entering the registered Mobile number.
  • Initiate the transaction at Lytty by providing the transaction id and transaction amount
  • Check the redeem eligibility for the customer
  • Get the amount to be redeemed and validate it against the Redemption rules of the active loyalty program by providing transaction ref id and redeem value
  • The transaction can be completed by applying the redeem amount as discount. The Loyalty points of the customer gets updated.

1. Authenticating Existing loyalty Customers

 

While redeeming, the authenticity of the customer need to be varified. This is done in 4 ways. Either by Loyalty ID and an OTP or Loyalty ID alone or Mobile No and an OTP or Mobile No alone. The policy for authenticating the customer need to be defined at the Corporate Settings in Lytty. By default, it is Loaylty ID without otp. Following API is being used for this.

 
 

API

Josn Input : #REQUEST_URL#.php?inputarr={"request_mode":"API_UPDATE_LYTTY_ID","merchant_id":"CIFH0NQJ26","loyalty_id":"4109426365221984", "lyttyauth_key":"e563b7804e40245ee961d17a82c55436", "clientMobile":"9446529266"}

API_UPDATE_LYTTY_ID - Authenticates the loyalty ID. Returns Success/ Failure status and message

 

Parameters used in this API

The parameter values of merchant_id and lyttyauth_key are obtained from the Lytty Merchant Login. Client related data like loyalty_id and clientMobile are to be provided by your application.

LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows.

 
loyalty_id 16 digit Loyalty ID of the customer
client_mobile Mobile No of the customer

The mobile number of the customer is used to de-dupe the customer at LYTTY. 16 digit Loyalty ID in combination with Customer Mobile number validates the Customer for Loyalty.

 

Return status

 

{"return_status":true,"return_message":"Loyalty ID Successfully Verified", "return_loyalty_id":"4109426365221984"}


2.Loyalty Transaction initiation

 

Once the Loyalty ID is authenticated, its required to Initiate a new Transaction at Lytty corresponding to the actual transaction happening at POS or Ecommerce. In other words this API is called in the final stage of Invoice or Sales order preparation. See the below image to know the touch points of this API.

API

 

 

Josn Input : #REQUEST_URL#.php?inputarr={"request_mode":"API_UPDATE_CURRENT_TRANSACTION","merchant_id":"CIFH0NQJ26","loyalty_id":"4109426365221984", "lyttyauth_key":"e563b7804e40245ee961d17a82c55436", "transaction_id":"11223344","transaction_value":"500"}

 

API_UPDATE_CURRENT_TRANSACTION - Initiates a new transaction at Lytty and returns a Transaction Ref Id

 

Parameters used in this API

The transaction amount and a unique id to identify the transaction are to be provided along with your Merchant ID and authentication key.
LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows:

 
loyalty_id 16 digit Loyalty ID of the customer
client_mobile Mobile No of the customer
transaction_id A unique identifier for the current transaction
transaction_value Monetary value of the transaction
 

Return status

{"return_status":true,"return_message":"Existing Data","return_lyttyref_id":"d1f491a404d6854880943e5c3cd9ca25"}

On successfully initiating a transaction at Lytty, you will get a lyttyref_id which need to be provided for all other services required to complete adding and redemption of Loyalty points and to complete the transaction.


3. Check Redemption policy

 

The redeemable points of the customer can be checked by the following API by providing the transaction ref id and transaction value.

 

API

 

Josn Input : #REQUEST_URL#.php?inputarr={"request_mode":"API_SHOW_LYTTY_POINTS_REDEEMABLE", "lyttyauth_key":"e563b7804e40245ee961d17a82c55436","merchant_id":"CIFH0NQJ26","loyalty_id":"4109426365221984", "lyttyref_id":"d1f491a404d6854880943e5c3cd9ca25", "transaction_value":"500"}

 

API_UPDATE_CURRENT_TRANSACTION - Initiates a new transaction at Lytty and returns a Transaction Ref Id

Return status

 

API_SHOW_LYTTY_POINTS_REDEEMABLE - Fetch Loyalty redeemable points.

{"return_status":true,"return_message":"Transaction valid","return_points":"100.00","return_pointvalue ":"50.00"}

Parameters used in this API

 

The transaction amount and Lytty reference Id are to be provided along with your Merchant ID and authentication key:

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows.

 
loyalty_id 16 digit Loyalty ID of the customer
lyttyref_id Lytty reference Id returned by Lytty on initiating a transaction
transaction_value Monetary value of the transaction

4. Redemption - custom amount validating

 

The redeemable amount can be modified as the customer desires and the new amount shall be validated by the following API by providing the transaction ref id and redeem value. For eg: maximum points redeemable is 100 and corresponding monitory equivalent is 50. So the customer can get a maximum discount of 50. But he may wish to redeem only 30..

API

 

Josn Input : #REQUEST_URL#.php?inputarr={"request_mode":"API_LYTTY_POINTS_REDEEM", "lyttyauth_key":"e563b7804e40245ee961d17a82c55436","merchant_id":"CIFH0NQJ26","loyalty_id":"4109426365221984", "lyttyref_id":"d1f491a404d6854880943e5c3cd9ca25", "redumption_value":"30.00"}

 

Return status

 

API_LYTTY_POINTS_REDEEM - Validates Redemption value

{"return_status":true,"return_message":"Transaction valid"}

Parameters used in this API

 

The redemption amount and Lytty reference Id are to be provided along with your Merchant ID and authentication key.

LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows:

 
loyalty_id 16 digit Loyalty ID of the customer
lyttyref_id Lytty reference Id returned by Lytty on initiating a transaction
transaction_value Monetary value of the transaction

5. Redemption Transaction completion

 

The transaction can be now completed by calling the following API on the completion of your transaction. As reference the Invoice No shall be provided as transaction_refid

API

 

Josn Input : #REQUEST_URL#.php?inputarr= {"request_mode":"API_LYTTY_POINTS_REDEEM_SUCCESS","lyttyauth_key":"e563b7804e40245ee961d17a82c55436", "merchant_id":"CIFH0NQJ26", "loyalty_id":"4109426365221984","lyttyref_id":"d1f491a404d6854880943e5c3cd9ca25","transaction_refid":"ORD1234"}

 

Return status

 

API_LYTTY_POINTS_REDEEM_SUCCESS - Complete the transaction Returns Sale Value after discount and discount amount. These may be used to update your transaction.

{"return_status":true,"return_message":"Transaction valid","return_salevalue":"470.00","return_redeemvalue":"30.00","transaction_status":null}

Parameters used in this API

 

The redemption amount and Lytty reference Id are to be provided along with your Merchant ID and authentication key.

LYTTY app provided parameter values are as follows :

 
merchant_id LYTTY Merchant ID
lyttyauth_key LYTTY Authentication Key
 

Your software application needs to send the Parameter are as follows:

 
loyalty_id 16 digit Loyalty ID of the customer
lyttyref_id Lytty reference Id returned by Lytty on initiating a transaction
transaction_refid transaction document no like Invoice no or Order no

For Request url : Kindly send request to support@lytty.com