- Use Case Number: 2-4-03
- Completed By: Software Developer
- Estimated Completion Time: <1 day
Basic Scenario
The subscriber logs into your self-care portal and selects to view their purchase history.Design Approach
As shown in the following diagram, the self-care portal uses the merchantAccountId to GET all the transactions associated with the subscriber account.
Retrieve Purchase History Using Subscribe APIs
To enable your self-care portal to retrieve the subscriber purchase history, use the Subscribe APIs as follows:-
Call the transactions endpoint using the merchantAccountId to GET the Transaction objects related to the account.
Sample Code:
- GET the transactions using the account ID: https://github.com/Vindicia/CashBoxRESTCodeSamples/blob/master/Transactions/Transaction.fetchByAccount.txt
- GET the transactions using the subscription ID: https://github.com/Vindicia/CashBoxRESTCodeSamples/blob/master/Transactions/Transaction_fetchBySubcriptionID.txt
- Use the limit feature to control how many transactions are returned. If the number of transactions exceeds the limit, use the next transaction attribute in the response which is populated with the next transaction ID to start with. This ID allows you to loop through and GET the next set of transactions.
- Continue the loop until you have all the transactions you want to display.

