Development
  • Guides
  • API Reference
  • API Explorer
  • SDKs
  • Sample apps
  • System status
Support
  • Developer forums
  • Developer blog
  • YouTube
  • X
More
  • Square Home
  • Square Developer
  • App Marketplace
  • Partner with Square
  • Solutions Partner Program
  • Pricing
  • Sales

© 2026 Square, Inc.

  • Developer terms of service
  • Developer Integration and Marketing Agreement
  • Privacy policy
  • Partnerships
  • Sign In
  • Sign In

    Gift Cards

  • List gift cards

  • Create gift card

  • Retrieve gift card from GAN

  • Retrieve gift card from nonce

  • Link customer to gift card

  • Unlink customer from gift card

  • Retrieve gift card

  • Webhooks

  • gift_card.created

  • gift_card.customer_linked

  • gift_card.customer_unlinked

  • gift_card.updated

<- Gift Cards API

Gift Cards API

All versions ->

Create gift card

POST

 /v2/gift-cards

Creates a digital gift card or registers a physical (plastic) gift card.

The resulting gift card has a PENDING state. To activate a gift card so that it can be redeemed for purchases, call CreateGiftCardActivity and create an ACTIVATE activity with the initial balance. Alternatively, you can use RefundPayment to refund a payment to the new gift card.

Permissions:GIFTCARDS_WRITE

Guide

Sell gift cards

Try in API Explorer
Link to section

Request body

Example code

Link to section

idempotency_key

string

Required

A unique identifier for this request, used to ensure idempotency. For more information, see Idempotency.

Min Length
1
Max Length
128
Link to section

location_id

string

Required

The ID of the location where the gift card should be registered for reporting purposes. Gift cards can be redeemed at any of the seller's locations.

Min Length
1
Link to section

gift_card

Required

The gift card to create. The type field is required for this request. The gan_source and gan fields are included as follows:

To direct Square to generate a 16-digit GAN, omit gan_source and gan.

To provide a custom GAN, include gan_source and gan.

  • For gan_source, specify OTHER.
  • For gan, provide a custom GAN containing 8 to 20 alphanumeric characters. The GAN must be unique for the seller and cannot start with the same bank identification number (BIN) as major credit cards. Do not use GANs that are easy to guess (such as 12345678) because they greatly increase the risk of fraud. It is the responsibility of the developer to ensure the security of their custom GANs. For more information, see Custom GANs.

To register an unused, physical gift card that the seller previously ordered from Square, include gan and provide the GAN that is printed on the gift card.

Link to section

Response fields

Link to section

errors

Any errors that occurred during the request.

Link to section

gift_card

The new gift card.

Link to section

Examples

All versions ->

POST /v2/gift-cards
curl https://connect.squareup.com/v2/gift-cards \ -X POST \ -H 'Square-Version: 2026-11-18' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "idempotency_key": "NC9Tm69EjbjtConu", "location_id": "81FN9BNFZTKS4", "gift_card": { "type": "DIGITAL" } }'

Response JSON

{ "gift_card": { "id": "gftc:6cbacbb64cf54e2ca9f573d619038059", "type": "DIGITAL", "gan_source": "SQUARE", "state": "PENDING", "balance_money": { "amount": 0, "currency": "USD" }, "gan": "7783320006753271", "created_at": "2021-05-20T22:26:54.000Z" } }

Error descriptions

503 Service unavailable

{ "errors": [ { "code": "TEMPORARY_ERROR", "category": "PAYMENT_METHOD_ERROR" } ] }