Step 1: Set up a Loyalty Program

Square sellers can subscribe to Square Loyalty and set up a loyalty program to help increase repeat visits to their business. A loyalty program defines how buyers can earn points and redeem points for discounts. For more information, see Loyalty Program Overview.

Did you know?

Check out the Sandbox 101: Loyalty API video, which shows how to set up a loyalty program in the Sandbox, create a loyalty account, and then add and redeem loyalty points using steps that are similar to this walkthrough.

In this walkthrough, you create and manage resources (such as a loyalty account and orders) by calling Square APIs in the Square Sandbox environment. Before you begin, you need to get your Sandbox account credentials and set up a loyalty program that you can use for testing. Note that the Loyalty API cannot be used to create or update a loyalty program.

It's helpful to understand some of the Sandbox features used in this walkthrough:

  • Sandbox test account - A fake seller account used for testing. This walkthrough assumes you're using the default test account created by Square, which has full access to Sandbox resources.

    You can optionally create and authorize another test account if you want to test OAuth permissions or test an account in a different country. If so, grant the permissions required for the API requests used in this walkthrough and use the new account's access token in your API requests.

  • Sandbox Seller Dashboard - The Sandbox version of the Seller Dashboard that sellers use to manage their business.

    You'll subscribe to Square Loyalty and set up a test loyalty program in the Sandbox Seller Dashboard. You can also optionally use the dashboard throughout the walkthrough to view the changes you make with Square APIs.

  • Sandbox payment methods - Test credit card numbers and other values used to make fake payments.

    First, you'll use a test credit card number to subscribe to Square Loyalty on behalf of your test seller account. Then, you'll use a test payment token to pay for orders on behalf of a buyer. Note that Sandbox payment methods are never charged.

Link to section

Gather account information

Follow these steps to get the access token and location ID used in this walkthrough.

  1. Sign in to the Developer Dashboard and open your application. If you don't have a Square account, see Get Started to learn how to create an account and an application.

  2. Get your Sandbox access token:

    1. At the top of the page, in the Sandbox and Production toggle, choose Sandbox.
    2. On the Credentials page, under Sandbox Access Token, choose Show and then copy the token. All Square API requests require an access token for authorization. This personal access token grants full access to the Sandbox resources in your account.

    Important

    The Sandbox access token is a secure secret. Don't share it with anyone.

  3. Get your location ID:

    1. In the left pane, choose Locations.
    2. On the Locations page, keep Default Test Account selected and copy a location ID.

    An animation showing how to get the Sandbox access token and location ID in the Developer Dashboard.

    Note

    To retrieve location IDs programmatically, call ListLocations.

Link to section

Set up a loyalty program

Follow these steps to set up a loyalty program in the Sandbox Seller Dashboard. Note that the Loyalty API cannot be used to create or update a loyalty program.

  1. Open the Sandbox Seller Dashboard:

    1. Return to the Developer Dashboard home page.
    2. In the left pane, choose Sandbox test accounts.
    3. Next to Default Test Account, choose Square Dashboard.
  2. In the left pane of the Sandbox Seller Dashboard, choose Customers, and then choose Loyalty.

  3. On the Build repeat business and reward your customers page, choose Get Started.

    A screenshot of the Loyalty subscription page where you can start setting up a loyalty program.

    You now follow a series of steps to set up your loyalty program.

    Note

    These steps assume that you're setting up a loyalty program for the first time. To change an existing program, choose Settings on the Loyalty page, and then edit the Earning Points and Redeeming Rewards settings to match the settings described in this topic.

  4. On the Customize your program step, keep the default Points terminology, and then choose Next.

  5. On the Select a program type step, define an accrual rule that enables customers to earn points on every dollar spent.

    1. Choose Amount spent.

    2. For Every time customers spend, enter 1.00.

    3. For Customers earn, enter 1.

    4. Choose Next.

      A screenshot showing how sellers set up an "Amount spent" program type where buyers earn 1 point for every dollar spent.

  6. On the Set up your rewards step, define a reward tier that offers a percentage discount on the entire sale.

    1. For Reward type, choose Discount on entire sale.
    2. For Discount amount, choose % to change to Discount percentage, and then enter 10.
    3. For Points needed to earn this reward, enter 10.
    4. Choose Next.

    A screenshot showing how sellers can set up a "Discount on entire sale" reward so buyers can redeem 10 points for 10% off a purchase.

  7. On the Review and subscribe step, review your loyalty program settings, and then choose Finish.

  8. In the Subscribe to Square Loyalty dialog box, enter information for the Sandbox test credit card. This test credit card lets you sign up for Square Loyalty in the Sandbox environment for free.

    1. For Name on Card, enter a name.
    2. For Card Number, enter 4111 1111 1111 1111.
    3. For CVV, enter 111.
    4. For Expiration Date, enter a future month and year in MM/YY format.
    5. For ZIP, enter a postal code.

    A screenshot showing where sellers can enter test credit card information.

Your loyalty program is now set up. On the Loyalty page in the Seller Dashboard, you can choose Settings to view or edit the program settings.

Note

A loyalty program can also have loyalty promotions that enable buyers to earn points in addition to those earned from an accrual rule. For more information, see Manage Loyalty Promotions.