1. Merchant endpoints
1.1. GET
1.1.1. Retrieve a list of all the merchants currently stored in the database.
1.1.2. Retrieve information for the merchant with the supplied id.
1.1.3. /merchant/test_gateway
1.1.3.1. Ensure that the URL is in https for security purposes.
1.2. PUT
1.2.1. Verify and add a new merchant to the database. The gateway information has to be verified. In case of gateway errors, the data should still be stored in the database.
1.3. POST
1.3.1. Update the merchant’s details based on the given information.
2. Affiliate Endpoints
2.1. GET
2.1.1. /affiliate
2.1.1.1. Retrieve a list of all the affiliates currently stored in the database
2.1.2. /affiliate/{id}
2.1.2.1. Retrieve information for the affiliate with the supplied id, including a list of all merchants available in the database, specifying which merchants this affiliate has access to.
2.2. PUT
2.2.1. /affiliate
2.2.1.1. Verify and add a new affiliate to the database.
2.3. POST
2.3.1. /affiliate/{id}
2.3.1.1. Update the affiliate’s details based on the given information.
3. Helper endpoints
3.1. PUT
3.1.1. /user
3.1.1.1. Verify and add a new user to the database.
3.1.2. /user_merchant
3.1.2.1. Verify ids and add a new relation to the database.
3.1.3. /user_affiliate
3.1.3.1. Verify ids and add a new relation to the database.
3.1.4. /merchant_affiliate
3.1.4.1. Verify ids and add a new relation to the database.
3.2. DEL
3.2.1. /user/{id}
3.2.1.1. Remove user with the supplied id.
3.2.2. /merchant/{id}
3.2.2.1. Remove merchant with the supplied id.
3.2.3. /user_merchant
3.2.3.1. Verify ids and remove the relation from the database.
3.2.4. /user_affiliate
3.2.4.1. Verify ids and remove the relation from the database.
3.2.5. /merchant_affiliate
3.2.5.1. Verify ids and remove the relation from the database.
3.3. POST
3.3.1. /user/{id}
3.3.1.1. Update the user’s details based on the given information.
4. Overview The Affiliate & Merchant management portal is a new application that has to be developed in order to facilitate the management of merchants and affiliates of Instacoins.
5. Affiliate
5.1. An affiliate is a person or an entity, not necessarily a member of Instacoins, that promotes the functionality of Instacoins to merchants which are integrated through a gateway. The people that take up the affiliate’s offer are called merchants. An affiliate can have multiple merchants under his wing. The reason an affiliate promotes Instacoins to merchants is because the affiliate takes a cut in all of the transactions made by his merchants. The percentage of commission taken is set up on an affiliate by affiliate basis.
6. Merchant The merchant is an entity that uses Instacoins as an intermediary to accept deposits from the merchant’s customer base. For every transaction carried out by Instacoins, initiated by a Merchant’s customer, an Instacoins fee is deducted from the amount deposited to the Merchant. Each merchant has his own gateway which stores the transactions related to a merchant. The management and verification of the merchant’s gateway URL is part of this application’s responsibilities. An example for a merchant can be an online casino that needs a way of receiving funds from the players. The player tops up his account with them and can spend it by gambling. If they integrate Flexipay's gateway, their customers will use the functionality of Instacoins to deposit and send funds to the online casino.
7. Merchant Management Portal Requirements
7.1. Use Cases
7.1.1. Retrieve a list of all Merchants
7.1.2. Reset Merchant Password
7.1.3. Test Merchant gateway
7.1.4. Save
7.1.5. Add new Merchants
7.1.6. Update an existing Merchant
7.1.7. De-activate an existing, active, Merchant.
8. Affiliate Management Portal Requirements
8.1. Use Cases:
8.1.1. Retrieve a list of all Affiliates
8.1.2. Add Affiliate
8.1.3. Add new Affiliates
8.1.4. Reset Affiliate Password
8.1.5. Update an existing Affiliate.
8.1.5.1. Update of the Affiliate’s information.
8.1.5.2. Addition/Removal of merchants that fall under said affiliate
8.1.6. De-activate an existing, active, Affiliate