Client Initialization
Access the Gift Cards client through the main Square client:Core Methods
List
Retrieve a paginated list of gift cards with optional filters.Filter by gift card type:
PHYSICAL or DIGITAL.Filter by gift card state:
ACTIVE, DEACTIVATED, BLOCKED, or PENDING.Maximum results per page (1-200, default 30).
Pagination cursor from a previous response.
Filter by linked customer ID.
Array of gift card objects.
Pagination cursor for the next page.
Create
Create a new digital gift card or register a physical gift card.Unique key for idempotent operations.
Location ID for reporting purposes. Gift cards work at all locations.
Gift card type:
DIGITAL or PHYSICAL.GAN source:
SQUARE (default) or OTHER for custom GANs.Gift card account number (8-20 alphanumeric characters for custom GANs).
The newly created gift card object.
Get
Retrieve a gift card by its Square-issued ID.The Square-issued gift card ID.
The requested gift card object.
GetFromGan
Retrieve a gift card using its account number (GAN).The gift card account number (up to 255 digits for imported GANs, 16 for Square-issued).
GetFromNonce
Retrieve a gift card using a secure payment token.Payment token from Web Payments SDK or In-App Payments SDK.
LinkCustomer
Link a customer to a gift card (add card on file).The ID of the gift card to link.
The ID of the customer to link.
The gift card with updated customer_ids field.
UnlinkCustomer
Unlink a customer from a gift card (remove card on file).The ID of the gift card.
The ID of the customer to unlink.
Complete Example
Types
GiftCard
The main gift card object.GiftCardType
Gift card type enumeration.GiftCardStatus
Gift card state enumeration.GiftCardGanSource
GAN source enumeration.Gift Card States
- PENDING
- ACTIVE
- DEACTIVATED
- BLOCKED
Newly created gift card that hasn’t been activated yet. Create a gift card activity to activate it.
Best Practices
Activation Required
Activation Required
Newly created gift cards have a
PENDING state. You must create a gift card activity (ACTIVATE) or refund a payment to the card to activate it for use.Custom GAN Security
Custom GAN Security
When using custom GANs with
GiftCardGanSourceOther, ensure they:- Are 8-20 alphanumeric characters
- Don’t start with major credit card BINs
- Aren’t easily guessable (avoid 12345678)
- Are unique per seller
Location Registration
Location Registration
While gift cards are registered to a specific location for reporting, they can be redeemed at any of the seller’s locations.
Customer Linking
Customer Linking
Link gift cards to customers to enable features like viewing cards on file and tracking usage patterns.
Balance Tracking
Balance Tracking
The
balance_money field is always >= 0. To load or adjust balances, use the Gift Card Activities API.Use Cases
Digital Gift Cards
Create digital gift cards that customers can receive via email or text and redeem using their phone.
Physical Card Registration
Register physical gift cards ordered from Square by providing the printed GAN.
Customer Loyalty Integration
Link gift cards to customer profiles for seamless tracking and enhanced customer experience.
Balance Inquiry
Allow customers to check their gift card balance using GetFromGan or GetFromNonce.
Related Resources
- Customers API - Link gift cards to customers
- Payments API - Process gift card payments
- Refunds API - Handle gift card refunds
