Gift Cards API and Gift Card Activities API

Applies to: Gift Cards API | Gift Card Activities API | Orders API | Payments API | Refunds API | Customers API | Web Payments SDK | In-App Payments SDK

Use the Gift Cards API and Gift Card Activities API to create and manage Square gift cards.

Link to section

Overview

Square gift cards allow sellers to offer a complete gifting program that can boost sales and attract new customers. Gift cards can be purchased online or in person and redeemed at all of the seller's locations. Buyers can send gift cards to friends and family to introduce them to a seller's business.

Developers use the Gift Cards API and Gift Card Activities API to integrate gift cards into their applications. Watch the following video to see how the APIs work:

You can also send Square GraphQL queries for read-only access to gift card data and use webhook events to keep track of activities.

Note

Sellers use Square Point of Sale and the Seller Dashboard to sell, redeem, track, or reload Square gift cards. Sellers can publish an eGift Card Order Site where buyers can purchase gift cards.

Buyers can view and manage their gift cards from their Square profile.

Link to section

Requirements and limitations

The following requirements, limitations, and other considerations apply when working with the Gift Cards API and Gift Card Activities API:

  • OAuth permissions - Applications using OAuth require GIFTCARDS_READ for read operations and GIFTCARDS_WRITE for write operations.

    Additional permissions might be required in gift card flows. For example:

    • CUSTOMERS_READ - To get a customer ID to link a gift card.
    • PAYMENTS_WRITE - To charge a gift card on file.
    • PAYMENTS_WRITE and ORDERS_WRITE - To activate or reload gift cards using Orders API integration.

    Learn more about OAuth and endpoint permission requirements.

  • Gift card delivery - The developer is responsible for delivering information for digital gift cards created using the Gift Cards API.

  • Security of custom GANs - The developer is responsible for ensuring the security of custom GANs. For example, to mitigate the risk of fraud, don't use repeatable patterns or GANs that are easy to guess (such as 12345678).

  • No application fees - Developers cannot collect application fees for gift card payments.CreatePayment returns a BAD_REQUEST error if the app_fee_money field is included in a request to create a Square gift card payment.

  • Load fees - Sellers in the following countries pay 2.5% of the amount added to a Square gift card, in addition to standard payment processing rates:

    • Australia
    • Canada
    • United States

    Load fees apply to ACTIVATE, LOAD, and ADJUST_INCREMENT activities. There are no fees when a gift card is redeemed or refunded. For more information, see Gift cards pricing.

    Square deducts or refunds load fees in seller payouts. To see all load fee deductions and refunds for a given payout, call ListPayoutEntries and iterate through the results to find following entry types:

  • Customer linking limits - When saving gift cards on file:

    • The maximum number of gift cards you can link to a customer profile is 50.
    • The maximum number of customer profiles you can link to a gift card is 10.
  • Seller Dashboard reporting - When third-party applications use Orders API or Payments API integration to reload or redeem a gift card, the Seller Dashboard reports include these transactions. In contrast, there's no reporting when reloading and redeeming gift cards using non-Square APIs.

    All activated gift cards are listed in the Seller Dashboard regardless of the system used to process the gift card order. However, if the gift card order was processed with non-Square APIs, the Receipt link to the transaction isn't available from the gift card's Activity card in the Gift Cards section.

  • Square API integration - Additional requirements and limitations apply when integrating with other Square APIs.

  • Activity history - ACTIVATE, CLEAR_BALANCE, and IMPORT activities that occurred before March 2, 2016, aren't included in ListGiftCardActivities results or when viewing the activity history in the Seller Dashboard.

Link to section

Gift Cards API

You can create gift cards, retrieve gift card information, and manage gift cards on file.

The following example CreateGiftCard request creates a DIGITAL gift card. You can also use this endpoint to register a PHYSICAL gift card.

Create gift card

New gift cards have a PENDING state and zero balance. After creating a gift card, call CreateGiftCardActivity to activate it with an initial balance before first use. For steps, see Sell Square Gift Cards.

The id and gan fields are used in API requests. For example, use:

  • gan with the Web Payments SDK or In-App Payments SDK to generate a source_id for a gift card payment in a CreatePayment request.
  • id as the source_id for a gift card on file payment in a CreatePayment request.
  • id as the destination_id when issuing store credit in a CreateRefund request. This is an alternative method for activating a gift card.
Link to section

Gift Card Activities API

You can activate a gift card with a balance, load additional funds, redeem the gift card for purchases, and create other activities that change the gift card balance or state.

A CreateGiftCardActivity request defines a specific activity type and includes a corresponding <activity-type>_activity_details field that provides the information needed to create the activity. The following example creates an ACTIVATE type based on the provided activate_activity_details:

Create gift card activity

Built-in integration with other Square APIs helps simplify activate, reload, redeem, and refund flows.

Link to section

Supported activity types for CreateGiftCardActivity

Gift card activities are used to manage a gift card's balance or state. You can use the CreateGiftCardActivity endpoint to create the following activity types:

Activity type Description

ACTIVATE

Activates a gift card with a balance. A gift card must be in the ACTIVE state to be used for any other activity. For more information, see Sell Square Gift Cards.

Details field: activate_activity_details

LOAD

Loads a gift card with additional funds. For more information, see Reload Square Gift Cards.

Details field: load_activity_details

REDEEM

Redeems funds from a gift card after a gift card payment.

If your application uses the Payments API to make a gift card payment, Square automatically creates a REDEEM activity that updates the gift card balance after the payment is completed. For more information, see Redeem Square Gift Cards.

Details field: redeem_activity_details

CLEAR_BALANCE

Sets a gift card balance to zero. This activity should be called before reusing a physical gift card.

When a physical gift card reaches a zero balance for any reason, Square automatically unlinks all customers from the gift card. This behavior helps keep the linked customer profile setting up to date if the card is reused.

Details field: clear_balance_activity_details

DEACTIVATE

Permanently blocks a gift card from any future balance-changing activities. This activity should be called to prevent a gift card from being used (for example, before discarding a physical gift card or if the card is lost or stolen).

Details field: deactivate_activity_details

ADJUST_INCREMENT

Increases a gift card balance when the adjustment isn't related to a gift card order or payment. To increase the balance based on gift card orders or payments, use the appropriate LOAD, REFUND, or UNLINKED_ACTIVITY_REFUND activity.

Details field: adjust_increment_activity_details

ADJUST_DECREMENT

Decreases a gift card balance when the adjustment isn't related to a gift card payment. To decrease the balance based on a gift card payment, use the REDEEM activity.

Details field: adjust_decrement_activity_details

REFUND

Adds money to a gift card from a refunded transaction. Refunds linked to a Square payment have a payment_id. Refunds to the same gift card used to make the payment have a redeem_activity_id.

If your application uses the Refunds API to refund a payment to a gift card, Square automatically creates a REFUND activity that updates the gift card balance. Applications that use a custom processing system for same-tender gift card refunds must explicitly create a REFUND activity and specify the redeem_activity_id.

Details field: refund_activity_details

UNLINKED_ACTIVITY_REFUND

Adds money to a gift card from a refunded transaction that wasn't paid with the same gift card.

This activity type is used by applications that use a custom processing system for cross-tender gift card refunds.

Details field: unlinked_activity_refund_activity_details

You cannot use CreateGiftCardActivities to create the following activity types:

  • BLOCK or UNBLOCK - Square manages these activities while processing chargeback transactions for disputed payments.
  • IMPORT or IMPORT_REVERSAL - Sellers must work with Square Support to import third-party gift cards or reverse previously imported gift cards.
  • TRANSFER_BALANCE_TO or TRANSFER_BALANCE_FROM - Square creates these activities when a buyer transfers money between gift cards linked to their Square profile.

However, these activity types are included in ListGiftCardActivities results and invoke gift_card.activity.created and gift_card.updated webhook events.

Note

You can call ListGiftCardActivities to view all activities or a filtered set of activities. The response includes gift card activities initiated by sellers and buyers using Square products, third-party applications calling Square APIs, and Square. For more information, see List gift card activities.

Link to section

Integration with Square APIs

Square provides integrated gift card workflows for applications that use the Orders API, Payments API, or Refunds API.

With Orders API integration, Square reads information from the order used to sell or reload a gift card. You provide an order_id and line_item_uid (of the GIFT_CARD line item) when you create the ACTIVATE or LOAD activity. The following are typical high-level flows:

  • Selling a gift card - Includes creating an ACTIVATE activity:

    CreateOrder -> CreatePayment -> CreateGiftCard -> CreateGiftCardActivity

  • Reloading a gift card - Includes creating a LOAD activity:

    CreateOrder -> CreatePayment -> CreateGiftCardActivity

Resulting ACTIVATE and LOAD activities include the order_id and line_item_uid you provided in the CreateGiftCardActivity request, as shown in the following examples. The amount of the GIFT_CARD line item is added to the gift card balance.

For more information, see Sell Square Gift Cards and Reload Square Gift Cards.

Link to section

Requirements and limitations for Orders API integration

  • order_id - The specified order must be in the COMPLETED state before you can activate or load the gift card.

  • line_item_uid - The specified line item with the gift card amount must explicitly set GIFT_CARD as the item_type. Otherwise, the order isn't processed as a gift card sale and you cannot use Orders API integration to activate or load the gift card.

  • If a gift card order is later refunded, the Refunds API doesn't automatically update the gift card balance. To deduct the funds from the balance, call CreateGiftCardActivity and create an ADJUST_DECREMENT activity with the PURCHASE_WAS_REFUNDED reason. Note that the Refunds API does update the balance after refunding a payment to a gift card.

If your application doesn't use the Orders API to process orders, you must call CreateGiftCardActivity to create the ACTIVATE or LOAD activity. Provide the following activity details in the request:

  • amount_money
  • buyer_payment_instrument_ids
  • reference_id (optional)

With Payments API integration, Square automatically creates a REDEEM activity that updates the gift card balance after the payment is processed. Your application doesn't need to call CreateGiftCardActivity.

Resulting REDEEM activities have a payment_id, as shown in the following example. The payment amount is deducted from the gift card balance.

For more information, see Redeem Square Gift Cards.

Link to section

Gift card details in a Payment object

For gift card payments, the card_brand field is SQUARE_GIFT_CARD. Note that Square supports partial payment flows using gift cards.

If your application doesn't use the Payments API to process payments, you must call CreateGiftCardActivity to create the REDEEM activity. Provide the following activity details in the request:

  • amount_money
  • reference_id (optional)

With Refunds API integration, you can process same-tender gift card refunds and cross-tender gift card refunds. Square automatically creates a REFUND activity that updates the gift card balance after the refund is processed. Your application doesn't need to call CreateGiftCardActivity.

Note

You can issue a cross-tender refund to a new gift card by first calling CreateGiftCard to create the gift card and then refunding directly to the new gift card. Doing so automatically changes the state from PENDING to ACTIVE.

Resulting REFUND activities include a payment_id if the refund is linked to a payment processed by Square and a redeem_activity_id if the payment was redeemed from the same gift card. The refund amount is added to the gift card balance.

Link to section

Gift card details in a Refund object

The refund flow determines whether gift card details are included in the refund. For gift card transactions, the card_details.card.card_brand field is set to SQUARE_GIFT_CARD.

Gift card details aren't included in a same-tender refund. To get details about the gift card that made the payment and received the refund, call GetPayment using the payment_id from the refund and check the card_details field.

{ "refund": { "id": "9WIIrJKZXMgSF9dI7SX9pOlWy7DZY_JnAde8lQt5pt9MLAMZ4UgaXt0sN3ZGqr62Ohx23tGGH", "status": "COMPLETED", "amount_money": { "amount": 1500, "currency": "USD" }, "payment_id": "9WIIrJKZXMgSF9dI7SX9pOlWy7DZY", "order_id": "kayuaH6E5v63RuuaXLSyJa8Qrc4F", "created_at": "2024-08-15T15:59:30.564Z", "updated_at": "2024-08-15T15:59:45.590Z", "location_id": "M8AKAD8160XGR", "destination_type": "CARD" } }

Refunds to the SQUARE_GIFT_CARD card brand don't affect a seller's payment processing balance. Note that a refund might take up to 14 days to complete. For more information about refund flows, see Refund Payments.

Link to section

Requirements and limitations for Refunds API integration

  • Square API version 2024-08-21 or later is required for the following features related to cross-tender refunds:
    • Using RefundPayment to create cross-tender gift card refunds.
    • Using GetRefund or ListRefunds to retrieve cross-tender gift card refunds. When using earlier Square API versions, GetRefund returns an API_VERSION_INCOMPATIBLE error and ListRefunds omits cross-tender gift card refunds from the results.
    • Using GetPayment or ListPayments to get refunded_money or refund_ids details related to the refund. When using earlier Square API versions, this information is omitted from the returned payments. Therefore, the payment IDs in corresponding REFUND activity details aren't useful for tracking refund activity.
  • Refunding to a new gift card activates the card by changing the PENDING state to ACTIVE and adding an initial balance equal to the refund amount. This process creates a REFUND activity but doesn't create an ACTIVATE activity.
  • Gift cards with custom GANs cannot receive cross-tender refunds using the Refunds API.

If your application doesn't use the Refunds API to process refunds, you must call CreateGiftCardActivity to create the REFUND or UNLINKED_ACTIVITY_REFUND activity.

  • For same-tender gift card refunds - Create a REFUND activity and provide the following activity details in the request:
    • amount_money
    • redeem_activity_id
    • reference_id (optional)
  • For cross-tender gift card refunds - Create an UNLINKED_ACTIVITY_REFUND activity and provide the following activity details in the request:
    • amount_money
    • reference_id (optional)

REFUND and UNLINKED_ACTIVITY_REFUND activities created by custom processing systems don't have a payment_id because they aren't linked to a Square payment.

Link to section

Custom GANs

The CreateGiftCard endpoint allows you to specify a custom GAN when you create a gift card. The custom GAN that you provide in the request must meet the following requirements:

  • The custom GAN must be unique for the Square seller account.
  • The custom GAN must contain 8 to 20 alphanumeric characters.
  • The custom GAN cannot start with:
    • A bank identification number (BIN) pattern used by major credit cards (such as Visa, Mastercard, and American Express).
    • A BIN used by Square gift cards: 778273 (physical) or 778332 (digital).

Gift cards created with a custom GAN have a gan_source of OTHER.

Note

For an example CreateGiftCard request that creates a gift card with a custom GAN, see Create or register the gift card.

Custom GANs can enable scenarios that aren't possible with Square-assigned GANs. For example, they can be used for gift card redemptions across multiple Square sellers and channels, to attach a value to non-gift-card items such as tickets, and to allow sellers to accept gift cards created by external sites. Gift cards with custom GANs can be redeemed just like gift cards with Square-assigned GANs.

Buyers use GANs to make gift card payments and check the gift card balance. It's the responsibility of the developer to ensure the security of their custom GANs. For example, to mitigate the risk of fraud, avoid using repeatable patterns or GANs that are easy to guess (such as 12345678).

You should be aware of the following limitations for gift cards with custom GANs:

  • After using the LinkCustomerToGiftCard endpoint to add a gift card on file for a customer profile, the customer ID is added to the customer_ids field of the gift_card object. However, linked gift cards that have custom GANs aren't currently visible as a card on file for the customer in Square products, such as Square Point of Sale or the Seller Dashboard.

  • Gift cards with custom GANs cannot receive cross-tender refunds in the Seller Dashboard, Square Point of Sale, or Refunds API.

Link to section

Physical gift cards

Note the following when working with physical (plastic) gift cards:

  • Physical gift cards are imprinted with a 16-digit GAN and a barcode. The GAN is numeric only and starts with 778273. The GAN is stored in the gan field of the GiftCard object.

  • To sell physical gift cards, the seller must have previously ordered the gift card from Square and the gift card must be unused. Sellers can order a pack of Square gift cards in the Seller Dashboard.

  • Testing physical gift cards in the Square Sandbox isn't supported.

  • When a physical gift card reaches a zero balance for any reason, Square automatically unlinks all customers from the gift card. This behavior helps keep the linked customer profiles setting current if the card is reused.

Link to section

Third-party gift cards

If a seller previously purchased gift cards from another gift card provider (not from Square) and sold them to customers, the seller must follow a one-time process with Square Support to import these third-party gift cards into Square. The seller can then accept these gift cards for redemption like Square gift cards. Third-party gift cards cannot be reloaded.

For third-party gift cards, the gan field can contain a maximum of 255 characters and gan_source is OTHER.

Note

If you attempt to migrate third-party gift cards by creating digital Square gift cards programmatically, you might receive compliance limit or rate limit errors. For more information, contact Developer Support.

Link to section

Sandbox testing

You can create and manage Square gift cards in the Square Sandbox. In addition, Square provides a test value that you can use to test gift card payments. For more information, see Testing gift card payments in the Sandbox.

The following limitations apply to testing gift card payments in the Sandbox:

  • Creating, managing, and testing with physical gift cards isn't supported.
  • The Virtual Terminal doesn't accept gift card payments.
  • The Web Payments SDK and In-App Payments SDK only accept Sandbox test values provided by Square. These values aren't tied to any gift cards in your account, so you cannot check whether the balance of the gift card is updated.
Link to section

Compliance limits

Square enforces the following compliance limits for gift card activities that load funds onto digital or physical gift cards:

  • Maximum balance amount per gift card - The maximum amount for a gift card balance.
  • Maximum load amount per gift card per day - The maximum amount that can be loaded onto a gift card in a 24-hour period.
  • Maximum load amount per payment card per day - The maximum amount that a single payment card can load onto gift cards in a 24-hour period.
  • Maximum outstanding balance amount per seller - The maximum amount of the total outstanding balance across all gift cards issued for a single seller.

If a limit is exceeded, the CreateGiftCardActivity endpoint returns an error and doesn't complete the activity.

Link to section

Per-country compliance limits

The following tables contain the per-country limits that are enforced by Square:

Limits for Australia (AU)Amount in AUD
Maximum balance amount per gift card$2,000
Maximum load amount per gift card per day$2,000
Maximum load amount per payment card per day$10,000
Maximum outstanding balance amount per sellerNot applicable
Limits for Canada (CA)Amount in CAD
Maximum balance amount per gift card$2,000
Maximum load amount per gift card per day$2,000
Maximum load amount per payment card per day$10,000
Maximum outstanding balance amount per sellerNot applicable
Limits for France (FR) and Ireland (IR) Amount in EUR
Maximum balance amount per gift card750 EUR
Maximum load amount per gift card per day750 EUR
Maximum load amount per payment card per day7.500 EUR / 7,500 EUR
Maximum outstanding balance amount per sellerNot applicable
Limits for Japan (JP)Amount in YEN
Maximum balance amount per gift card¥50,000
Maximum load amount per gift card per day¥50,000
Maximum load amount per payment card per day¥1,000,000
Maximum outstanding balance amount per seller¥10,000,000
Limits for Spain (ES)Amount in EUR
Maximum balance amount per gift card250 EUR (card cannot be reloaded)
Maximum load amount per gift card per day250 EUR (card cannot be reloaded)
Maximum load amount per payment card per day7,500 EUR
Maximum outstanding balance amount per sellerNot applicable
Limits for the United Kingdom (UK)Amount in GBP
Maximum balance amount per gift card£750
Maximum load amount per gift card per day£750
Maximum load amount per payment card per day£7,500
Maximum outstanding balance amount per sellerNot applicable
Limits for the United States (US)Amount in USD
Maximum balance amount per gift card$2,000
Maximum load amount per gift card per day$2,000
Maximum load amount per payment card per day$10,000
Maximum outstanding balance amount per sellerNot applicable
Link to section

Compliance limit errors

Square returns the following errors when compliance limits are exceeded:

  • Maximum balance amount per gift card:

    { "code": "BAD_REQUEST", "detail": "Cannot load balance on this giftcard as the card maximum value has been reached", "category": "INVALID_REQUEST_ERROR" }
  • Maximum load amount per gift card per day:

    { "code": "PAYMENT_LIMIT_EXCEEDED", "detail": "The gift card limit for increasing balance reached.", "category": "PAYMENT_METHOD_ERROR" }
  • Maximum load amount per payment card per day:

    { "code": "BAD_REQUEST", "detail": "Load amount exceeds maximum buyer daily amount.", "category": "INVALID_REQUEST_ERROR" }
  • Maximum outstanding balance amount per seller:

    { "code": "PAYMENT_LIMIT_EXCEEDED", "detail": "The merchant cannot accrue any more liability.", "category": "PAYMENT_METHOD_ERROR" }

The following migration notes apply to the Gift Cards API or Gift Card Activities API.

Link to section

Activity type is changed from UNLINKED_ACTIVITY_REFUND to REFUND for cross-tender refunds made from Square products

Effective date: 2022-06-16

All cross-tender refunds made from Square Point of Sale or the Seller Dashboard are now processed as REFUND activities instead of UNLINKED_ACTIVITY_REFUND activities. This type of refund occurs when a gift card is refunded for a payment that was processed by Square and paid for using a credit card or different gift card. The resulting REFUND activity has a payment_id but doesn't have a redeem_activity_id.

Existing UNLINKED_ACTIVITY_REFUND activities that represent cross-tender refunds made from Square Point of Sale or the Seller Dashboard are now also returned as REFUND activities for a ListGiftCardActivities request. This change applies to all Square versions.

However, new and existing UNLINKED_ACTIVITY_REFUND activities that are explicitly created by third-party applications continue to be returned as UNLINKED_ACTIVITY_REFUND activities.

Link to section

See also