Introducing RabbitStream⚡, earliest transaction detection from Solana Shreds with gRPC style filtering. Explore Now
shyft logo
Get API Key

Blogs

Dev Guides

How to reward Solana loyalty tokens on an eCommerce website(Part 2)

Shyft Logo

Team Shyft

· January 22, 2026

Loyalty rewards on eCommerce websites are quite common these days. This blog illustrates how you can build an eCommerce loyalty reward system on Solana.

Loyalty Points(or tokens) are the basis of Reward websites. In the previous part of this series, we have seen why we should consider replacing the traditional loyalty system on Solana. Let us now find out how we can do that. Consider the following scenario, we have a Web3-based e-commerce website, that rewards its users with some percentage of loyalty tokens after each purchase, or for various reward-worthy actions, such as writing a review, or recommending products to other users. Also, the users can redeem these tokens earned in exchange for free gifts or some form of discount. To make loyalty points on an e-commerce website feasible, we need to understand how loyalty points work. This can be defined using a few simple steps:

  • Rewarding users with Loyalty Tokens as soon as they complete a purchase, or any reward-worthy actions such as writing a review, or recommending products.
  • Checking the current token balance of one particular user.
  • Deducting Loyalty Tokens when the user redeems them in form of a discount on a purchase.

Now, let’s see how we can implement these steps in a Web3-based e-commerce website using SHYFT APIs.

In case you have already been through this part of the series, click here to read the next part.

Read the SHYFT API Documentation here.

Before getting started

To get started, we will need a few things.

Authentication: Getting your Shyft API key

x-api-key is an authentication parameter, which gives you access to SHYFT APIs. You can get your own API Key from the SHYFT website. Just signup with your email id here and you can get it for free.

Phantom Wallet

We will need the Phantom wallet browser extension, you can download it from the link below.

Chrome/Brave.

Firefox.

Once done, set up your Phantom wallet account. On-screen tips are available, which will guide you through setting up and getting started. You can also find a detailed guide related to this here.

Creating an SPL Token for the Website.

In reward-based e-commerce websites, the users are rewarded with loyalty points or coins for completing certain actions, such as buying or selling a product. From the Web3 perspective, let us assume that all the users of this e-com website have their own crypto wallets. Instead of rolling out normal loyalty points, we can roll out special SPL tokens or any form of cryptocurrency that the users can use or redeem on this website itself or elsewhere. But even before that, we will have to create an SPL token to reward. Let’s see how we can create a token using SHYFT APIs.

Endpoint to create a new token, without using the private key.

POST https://api.shyft.to/sol/v1/token/create_detach

This API accepts **x-api-key** in its header, which is an authorization parameter used by SHYFT. You can get your own **x-api-key** here for free. The content-type for this API call is **multipart/form-data**.

Parameters used for this API call:

  • network : Selects the Solana network cluster, which can be either devnet, testnet or mainnet-beta.
  • wallet : Accepts the Wallet address that will have the update authority of the token being created. In this case, it will be the wallet address of the e-com website owner.
  • name : Accepts the name of the loyalty token being created.
  • symbol : Accepts the symbol of the NFT being created.
  • decimals : Number of parts the Token can be split into. In our case this will be zero, as we want to give out non-divisible points.
  • description : Accepts a short description of the Token being created.
  • file : Accepts the image of the token being created.

For details on the parameters required for this API call, you can refer to our dev doc here, or you can also check out our blog on creating and minting tokens for a step-by-step approach.

{
  "success": true,
  "message": "Token create request generated successfully",
  "result": {
    "encoded_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDGMqfUcVHHu2+lyU5gx9wU2rGxk2NoSXtodMSdev+DxU149+BuHwrHyERE4lK+pDqz1cPOaPnPAO56DKHpPnPqQtwZbHj0XxFOJ1Sf2sEw81YuGxzGqD9tUm20bwD+ClGZ75+gzsF6WPLOQgC+tL75bEdK/l5cBP0MXH6KxOmXycBAgIBALwBDwEEAAAASG9sYQIAAABITFgAAABodHRwczovL25mdHN0b3JhZ2UubGluay9pcGZzL2JhZmtyZWlod2Vxd3lkd29iaG9yM2FzZjd1YWFocm5tc3c2cDdnNnh5cnl6a2p4dTJuM2ZrZ2d6dnd5BQABAQAAABjKn1HFRx7tvpclOYMfcFNqxsZNjaEl7aHTEnXr/g8VAWQAAAEYyp9RxUce7b6XJTmDH3BTasbGTY2hJe2h0xJ16/4PFQEAAQE=",
    "mint": "EAmTA4TiEPShWKgy3G1iYyco3suogTocZVVbAwqjoPKV"
  }
}

To know about Signing Transactions on Solana, you can follow our dev guide here, or you can simply follow our blog on creating and minting tokens on Solana for a step-by-step approach. You can also check our GitHub repo for all the functions required to sign encoded transactions.

Once created, we can proceed to the next step, which is rewarding users for completing an action.

Rewarding users when they purchase an item.

Suppose the user has just completed a purchase from the e-com website or has completed any reward-worthy action such as writing a review, and we are to transfer some tokens to the user. This can be any token, be it the one we created in the previous step, or any other tokens previously available. We can use SHYFT’s mint_detach API to airdrop some tokens to the user’s wallet.

The API endpoint to be used:

POST <https://api.shyft.to/sol/v1/token/mint_detach>

All SHYFT APIs accept the x-api-key parameter in their header, which is freely available on the SHYFT website here.

Parameters used for this API call

  • network: Selects the Solana network cluster, which can be either devnet, testnet or mainnet-beta.
  • wallet: Accepts wallet address which has the update authority for the token to be transferred. Update authority is defined while creating the token.
  • receiver: Wallet address of the user who will receive the tokens. In this case, it will be the user who just completed a purchase or any reward-worthy action.
  • token_address: Accepts the address of the token which is to be minted and airdropped. This can be the token we just created in the previous step.
  • amount: Amount of tokens to be minted and airdropped. This will be the amount that will be rewarded to the user for completing a purchase.

As soon as an user completes a purchase or a reward-worthy action successfully, we can make this API call. This API call returns an encoded_transaction in their response which needs a signature from the update authority wallet to be successfully executed by the Solana Runtime.

{
  "success": true,
  "message": "Token mint request generated successfully",
  "result": {
    "encoded_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDGMqfUcVHHu2+lyU5gx9wU2rGxk2NoSXtodMSdev+DxU149+BuHwrHyERE4lK+pDqz1cPOaPnPAO56DKHpPnPqQtwZbHj0XxFOJ1Sf2sEw81YuGxzGqD9tUm20bwD+ClGZ75+gzsF6WPLOQgC+tL75bEdK/l5cBP0MXH6KxOmXycBAgIBALwBDwEEAAAASG9sYQIAAABITFgAAABodHRwczovL25mdHN0b3JhZ2UubGluay9pcGZzL2JhZmtyZWlod2Vxd3lkd29iaG9yM2FzZjd1YWFocm5tc3c2cDdnNnh5cnl6a2p4dTJuM2ZrZ2d6dnd5BQABAQAAABjKn1HFRx7tvpclOYMfcFNqxsZNjaEl7aHTEnXr/g8VAWQAAAEYyp9RxUce7b6XJTmDH3BTasbGTY2hJe2h0xJ16/4PFQEAAQE=",
    "mint": "EAmTA4TiEPShWKgy3G1iYyco3suogTocZVVbAwqjoPKV"
  }
}

To know more about Signing Transactions on Solana, you can follow our dev guide here, or you can simply follow our blog on creating and minting tokens on Solana for a step-by-step approach. You can also check our GitHub repo for all the functions required to sign encoded transactions.

Once successfully signed, the user will receive the tokens in their wallet, which they earned by performing some action.

Read the SHYFT API Documentation here.

So, that’s pretty much everything about this part of the blog where we see the initial steps of how we can integrate a web3 based loyalty reward system in an e-commerce website. In the next part of this series, we will see how a user can check his or her token balance and how an user can redeem the tokens he/she has earned from the website. Stay Tuned!

Up Next: How to check and redeem loyalty tokens on a Solana-based eCommerce loyalty system

In case you have missed the previous part of this series, click here.

Resources

SHYFT API Documentation

Shyft Website

Get API Key

GitHub

Join our Discord

Try out our APIs on Swagger UI

Membership
Solana Development
Solana Network

Related Posts

How to reconnect and replay slots with Solana Yellowstone gRPC
Shyft

How to reconnect and replay slots with Solana Yellowstone gRPC

In this article you will learn how to implement a reconnect logic for your Solana gRPC streams with replay functionality...

January 24, 2026

How to modify Solana Yellowstone gRPC subscribe requests without disconnecting
Shyft

How to modify Solana Yellowstone gRPC subscribe requests without disconnecting

Learn how to modify your yellowstone gRPC Subscribe Requests on Solana without stopping your stream or losing data ...

January 24, 2026

Real-Time Solana Data Streaming with gRPC: Accounts, Transactions, Blocks
Shyft

Real-Time Solana Data Streaming with gRPC: Accounts, Transactions, Blocks

A comprehensive guide on how to stream Transactions, Accounts, and Block updates swiftly using Shyft’s gRPC Services ...

January 22, 2026

Get in touch with our discord community and keep up with the latest feature
releases. Get help from our developers who are always here to help you take off.

GithubTwitterLinked inDiscordTelegramBlogsBlogs

Products

RabbitStreamgRPC NetworkSuperIndexerSolana APIs
Contact Us|Email: genesis@shyft.to