Website logo
⌘K
Triple Basics
Triple Overview
Getting Started With Triple's API
Introduction to Triple API Endpoints and Webhooks
Getting Started Overview
Triple API and Webhooks
Affiliate Links
Webhooks
Card Accounts
Offer Display
Offer Activation
Card Programs
Tools
Offer Providers
Offer Filters
Portfolio Management
Rewards
Transactions
User Events
Triple White Label UI
Platform Status
Docs powered by Archbee
Getting Started With Triple's ...
Getting Started Overview

Step 4: Fetch Offers

4min

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.

Prerequisites

Before you perform this step, make sure that:

  • You have an active authentication token.

Display the Offers in a Sample Interface

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:

Get Offer Categories
Search Available Offers
Get Offer Details
curl --location 'https://api.tripleup.dev/partner/card-accounts/CARD_HOLDER_ID/offers.details' \
--header 'Authorization: Bearer MY_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
  "offer_id": "4930",
  "proximity_target": {
    "country_code": "US",
    "latitude": null,
    "longitude": null,
    "postal_code": null,
    "radius": null
  }
}'


More about this endpoint can be found in the Triple API Endpoints and Webhooks section.

Capture User Events

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:

Curl
curl --location 'https://api.tripleup.dev/partner/user-events' \
--header 'Authorization: Bearer MY_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
    "event_timestamp": d.isoformat(),
    "event_type": EVENT_TYPE,
    "user_postal_code_location": {
        "country_code": COUNTRY_CODE,
        "postal_code": POSTAL_CODE
    },
    "user_coordinates": {
        "latitude": LATITUDE,
        "longitude": LONGITUDE
    },
    "card_account_id": CARD_HOLDER_ID,
    "user_interface": USER_INTERFACE,
    "offer_id": OFFER_ID
}'


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).

Updated 30 Jun 2023
Did this page help you?
PREVIOUS
Step 3: Register Card Accounts
NEXT
Step 5: Set up Webhooks for Notifications (optional)
Docs powered by Archbee
TABLE OF CONTENTS
Prerequisites
Display the Offers in a Sample Interface
Capture User Events
Docs powered by Archbee