Step 4: Fetch Offers
Triple let's you build custom user interfaces and experiences by leveraging API responses in your own code. Alternatively, you can leverage the existing Triple UI components or interface, which you can white label (contact Triple for more information).
For this getting started example, we'll show you how to fetch offers, offer details, and capture user events. You can then use the various responses to create your own user interfaces.
Before you perform this step, make sure that:
- You have an active authentication token.
Here is a sample interface with endpoints that are called to display relevant offers to the customer.
These are the endpoints that we will use.
- GET partner/card-accounts/{cardholder_id}/offers/categories
- POST partner/card-accounts/{cardholder_id}/offers.search
- GET partner/card-accounts/{cardholder_id}/offers.details
Code Sample:
More about this endpoint can be found in the Triple API Endpoints and Webhooks section.
Add code to capture events that occur as the user interacts with the offer, such as whether the user likes or dislikes an offer. Capturing these events help Triple to better target offers in the future.
The endpoint used in this example is POST partner/user-events.
Code Sample:
More about this endpoint can be found in the Triple API Endpoints and Webhooks section.
For the next step, continue to Step 5: Set up Webhooks for Notifications (optional).