Loyalty API: Walkthrough 1

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.

Prepare for the walkthrough Permalink Get a link to this section

Before you begin the walkthrough, do the following:

  • Review Sandbox testing considerations to understand how you use the Square Sandbox for this walkthrough.

  • Gather account information to use for your Square API requests.

Review Sandbox testing considerations Permalink Get a link to this section

In this walkthrough, you set up a loyalty program and create loyalty, order, and other Square resources in the Sandbox. The Sandbox is an isolated server environment provisioned for each Sandbox test account. When possible, you should use the Sandbox for testing. For more information, see Test in the Sandbox.

You use a Sandbox credit card to subscribe to Square Loyalty and a Sandbox payment token to pay for orders so your buyer can earn loyalty points. Sandbox payment methods are never charged.

To create a loyalty account for this walkthrough, you provide a Sandbox phone number using the following format (for example, +12085551111).

+1<valid-area-code>555<any-four-digits>

You also use the Sandbox Seller Dashboard to set up your loyalty program, and you can optionally use it to view the changes that you make with Square APIs.

Gather account information Permalink Get a link to this section

In this walkthrough, you use your Sandbox access token to authorize your calls to the Square API and your location ID to create orders and add points to a loyalty account. Your Square account must be activated in a country where Square Loyalty is available.

Follow these steps to gather account information for your Sandbox environment:

  1. Sign in to the Developer Dashboard. If you do not have a Square account, you can create one. For more information, see Get Started.

  2. Open your test application.

  3. Get your Sandbox access token:
    a. At the top of the page, in the Sandbox and Production toggle, choose Sandbox.
    b. On the Credentials page, under Sandbox Access Token, choose Show, and then copy the token. This personal access token grants full access to the Sandbox resources in your account.

  4. Get your location ID:
    a. In the navigation pane, choose Locations.
    b. On the Locations page, copy your location ID.

Set up a loyalty program Permalink Get a link to this section

Use the following steps to set up a loyalty program in the Sandbox Seller Dashboard:

  1. Open the Seller Dashboard in the Sandbox.
    a. Sign in to the Developer Dashboard.
    b. In the Sandbox Test Accounts section, choose Open for Default Test Account. This opens the Seller Dashboard where you create your loyalty program.

  2. In the navigation pane, choose Loyalty.

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

    loyalty_get_started_page

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

    Note

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

    The Loyalty page is available only if your Square account is activated in a supported country, or if you open the Seller Dashboard with a test account configured for a supported country. Custom test accounts use an OAuth access token instead of the Sandbox access token, so you must grant the account the required permissions for the Square APIs used in this walkthrough.

  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.
    a. Choose Amount spent.
    b. For Every time customers spend, enter 1.00.
    c. For Customers earn, enter 1.
    d. Choose Next.

    loyalty_amount_spent_accrual

  6. On the Set up your rewards step, define a reward tier that offers a percentage discount on the entire sale.
    a. For Reward type, choose Discount on entire sale.
    b. For Discount amount, choose % to change to Discount percentage, and then enter 10.
    c. For Points needed to earn this reward, enter 10.
    d. Choose Next.

    loyalty_entire_sale_reward

  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 test credit card information.
    a. For Name on Card, enter a name.
    b. For Card Number, enter 4111 1111 1111 1111.
    c. For CVV, enter 111.
    d. For Expiration Date, enter a future month and year in MM/YY format.
    e. For ZIP, enter a postal code.

    loyalty_subscribe_to_square_loyalty

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.

Previous

< Loyalty Walkthrough 1

Next

Enroll a Buyer >