• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Retrieve gift card from GAN

POST /v2/gift-cards/from-gan

Retrieves a gift card using the gift card account number (GAN).


Permissions
GIFTCARDS_READ
Try in API Explorer
Name Description
gan
string

Required

The gift card account number (GAN) of the gift card to retrieve. The maximum length of a GAN is 255 digits to account for third-party GANs that have been imported. Square-issued gift cards have 16-digit GANs.

Min Length 1 Max Length 255

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

gift_card
GiftCard

A gift card that was fetched, if present. It returns empty if an error occurred.

Examples

You are viewing an old version of the API
POST /v2/gift-cards/from-gan
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/gift-cards/from-gan \
  -X POST \
  -H 'Square-Version: 2022-09-21' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "gan": "7783320001001635"
  }'
Response JSON
{
  "gift_card": {
    "id": "gftc:6944163553804e439d89adb47caf806a",
    "type": "DIGITAL",
    "gan_source": "SQUARE",
    "state": "ACTIVE",
    "balance_money": {
      "amount": 5000,
      "currency": "USD"
    },
    "gan": "7783320001001635",
    "created_at": "2021-05-20T22:26:54.000Z"
  }
}