Beta Release
This is pre-release documentation for an API in public beta and is subject to change.
Gift Cards API

Walkthrough 1: Sell a Gift Card

This walkthrough provides step-by-step instructions for you to create and activate a digital gift card.

Prepare Permalink Get a link to this section

To prepare for the walkthrough, do the following:

  • Review Sandbox testing considerations. You need to understand how to test the walkthrough in the Square Sandbox.

  • Gather account information. You need your Sandbox access token and location ID. You use the access token to authenticate requests and your location ID to create an order using the Orders API and create a gift card using the Gift Cards API.

Step 1: Sandbox testing considerations Permalink Get a link to this section

The Sandbox provides test values that make testing in the Sandbox environment easy. For this exercise, you use a test payment token (cnon:card-nonce-ok) to pay for an order. For more information, see Sandbox test values.

Note

This walkthrough creates a digital gift card in the Sandbox. Although testing physical gift cards is not supported in Sandbox, you can register and activate physical gift cards in the production environment using the process described in this walkthrough.

Step 2: Gather account information Permalink Get a link to this section

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

  1. Sign in to the Developer Dashboard.

  2. Open an application, which provides you with the credentials you use. If you do not have an application, you need to create one.

  3. Get Sandbox credentials:

    1. You can toggle between the Sandbox and Production accounts. Choose Sandbox.

    2. On the Credentials page, copy the token from Sandbox Access Token.

  4. Get a location ID:

    1. Choose Locations in the left navigation pane.

    2. On the Locations page, choose an ID from Location ID.

Next step Permalink Get a link to this section

You are now ready to sell a gift card. When a buyer wants to purchase a gift card, an application first takes an order and processes the payment (the amount to load on the gift card). The application then creates and activates a card.

Applications have the following options to process a gift card order: