Use Button for Loyalty and Rewards

Use Button for Loyalty and Rewards

With Button you can perform real-time loyalty & rewards transactions across the app ecosystem so you can begin rewarding your members for their daily purchases on their mobile devices.



Note: Want to work with companies not supported today? Just let us know and we'll work with them to make it happen!

What might I want to use Button to do?

Button can support a wide range of loyalty & rewards use-cases but here are a few we've seen:

  • Rewarding users for purchases made in apps or mobile web.
  • ⁣⁣Giving users points, digital items or currency for purchases.
  • ⁣Providing offers or deals from partners with closed-loop tracking.
  • Increase your mobile revenue by converting taps to transactions - we’ve found this can be an increase of >400%.


How does a Loyalty or Rewards Integration with Button work?

There are two components to a Loyalty or Rewards integration with Button:

  1. Showing your users products or services fetched from Button (either partners, or items from partners.) You can do this with our dropin UI components or through our APIs.

  2. Receiving Webhooks when users Install or Checkout in partner apps, and crediting your users as necessary.

What would that look like in a diagram?

It would look like this...


Set up loyalty with Button in 5 steps

1. Configure the SDK & set up user-level IDs

The first thing you'll need to do is add the Button SDK to your app, initialize it and identify your users with your unique User ID. This is so that when we later tell you about an order that happened, we can also tell you which user that was for so that you can credit them accordingly.


2. Show your users products / actions from Button

You can fetch actions from Button either by using our drop-in UI components (called Buttons 😉), by using our SDK's custom UI actions, or by directly accessing the Merchants API.

Each method has a different set of trade-offs, but generally we recommend the Merchants API if you want to offer Merchant-level actions (e.g. Shop at Jet and get 5% back) and Buttons or Custom Button UI if you want contextual item-level offers (e.g. Book a table at this restaurant and get 100 points).

Method Dropin Buttons Custom Button UI Merchants API
Effort 👾 👾 ⁣ 👾 👾 ⁣ 👾 ⁣ ⁣👾
Contextual Inventory
Rates Available
Partner Metadata


For more details on setting up the Merchant API, read our API documentation.


3. Send users to the partner app to purchase

If you're using drop-in Button UI components, this will happen when the user taps the Button. If not, you'll need to invoke the Button action when your user gets to the point you want to deep link them. (Invoke Action)

Note: If the user doesn't already have the app installed, they will install it inline and you will receive a Webhook on completion to inform you of the commission earned.




4. Configure Webhooks on Commission Events

In order to receive notifications when your users Install or Checkout in Button Marketplace apps, you need to configure a Webhook. Webhooks send you a notification by POSTing to an API endpoint you declare with the details of the user and transaction.

You can configure Webhooks in the Dashboard Webhooks tab.

Pending and Validated States

Your web hook will be sent Transaction: Pending and Transaction: Validated events from Button. These represent pending & validated transactions respectively.

Until a transaction is marked as validated, it can be changed and should not be redeemable / cash-out-able to a user. Pending transactions can be shown to users in a pending state (e.g. Balance vs. Available Balance.)



5. Give users their rewards from Webhooks!

When you receive a Webhook POST, you know that one of your users did something that you may want to reward them for!

The Webhook payload will contain a few fields that are particularly useful:

  • publisher_customer_id: The ID (your ID) for the user that transacted
  • category: The Category of transaction (New User, Existing User & Install)
  • order_total: For orders, this is the amount of the order
  • status: The status of the transaction
  • commerce_organization: The ID of the app that the purchase was in

Full Webhook documentation

In this case, if you wanted to give a user 100 points for purchasing in App A, we would perform logic like the following:

// Get the user that made the transaction
User affectedUser = User.userByID(webhook.publisher_customer_id);

if (webhook.commerce_organization == TARGET_COMMERCE_APP_ID) {
    if (webhook.status == "validated") {
        affectedUser.addPoints(100, "Purchasing in App X");
    }
    else if (webhook.status == "pending") {
        // Optionally tell them something here
    }
}

Note: Where you want to share the commission between yourselves & the user in question, we can work with you to break out webhooks to different accounts. Just contact us! That way you can immediately apply amounts from webhooks to the users account.


Testing your integration

Now it's time to test that everything is working correctly.

  • Display a Button in your app
  • Tap it and go through to the Commerce Partner app
  • Make a purchase
  • Your webhook will fire
  • Confirm that the webhook fires with the correct amount & userID.

Note: You can also use the Button Partner Test App to test out your integration, but it does not currently support userID so all webhooks will fire without a user ID.


Questions?

Have other use-cases in mind, or see something that doesn't make sense? Contact us and we'll get in touch!