Skip to content

Square: Gift cards schemas

14 Square schemas with complete fields and constraints.

← Gift cards operations · All schemas

Create Gift Card — request body — body

FieldTypePresenceDescription and constraints
$objectRootRepresents a [CreateGiftCard](api-endpoint:GiftCards-CreateGiftCard) request.
gift_cardModelRequired within parentExpand Create Gift Card — request body — body gift card
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](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#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.
idempotency_keystringRequired within parentA unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
Maximum length: 128
Minimum length: 1
location_idstringRequired within parentThe ID of the [location](entity:Location) where the gift card should be registered for
reporting purposes. Gift cards can be redeemed at any of the seller's locations.
Minimum length: 1

Referenced models: Create Gift Card — request body — body gift card

Create Gift Card — request body — body gift card

FieldTypePresenceDescription and constraints
$objectRootRepresents a Square gift card.
balance_moneyModelOptionalExpand Create Payment — request body — body tip money
The current gift card balance. This balance is always greater than or equal to zero.
Read only: true
created_atstringOptionalThe timestamp when the gift card was created, in RFC 3339 format.
In the case of a digital gift card, it is the time when you create a card
(using the Square Point of Sale application, Seller Dashboard, or Gift Cards API).
In the case of a plastic gift card, it is the time when Square associates the card with the
seller at the time of activation.
Read only: true
customer_idsarrayOptionalThe IDs of the [customer profiles](entity:Customer) to whom this gift card is linked.
Read only: true
customer_ids[]stringEach item
ganJSONOptional
gan (anyOf 1)stringAlternativeThe gift card account number (GAN). Buyers can use the GAN to make purchases or check
the gift card balance.
gan (anyOf 2)nullAlternative
gan_sourceJSONOptional
gan_source (anyOf 1)stringAlternativeIndicates the source that generated the gift card
account number (GAN).
The source that generated the gift card account number (GAN). The default value is `SQUARE`.
See [GANSource](#type-gansource) for possible values
One of: SQUARE, OTHER
gan_source (anyOf 2)nullAlternative
idstringOptionalThe Square-assigned ID of the gift card.
Read only: true
statestringOptionalIndicates the gift card state.
The current gift card state.
See [Status](#type-status) for possible values
One of: ACTIVE, DEACTIVATED, BLOCKED, PENDING
Read only: true
typestringRequired within parentIndicates the gift card type.
The gift card type.
See [Type](#type-type) for possible values
One of: PHYSICAL, DIGITAL

Referenced models: Create Payment — request body — body tip money

Create Gift Card — response body

FieldTypePresenceDescription and constraints
$objectRootA response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request
resulted in errors.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
gift_cardModelOptionalExpand Create Gift Card — response body — gift card
The new gift card.

Referenced models: Get Shift — response body — errors item, Create Gift Card — response body — gift card

Create Gift Card — response body — gift card

FieldTypePresenceDescription and constraints
$objectRootRepresents a Square gift card.
balance_moneyModelOptionalExpand Pay Order — response body — order total money
The current gift card balance. This balance is always greater than or equal to zero.
Read only: true
created_atstringOptionalThe timestamp when the gift card was created, in RFC 3339 format.
In the case of a digital gift card, it is the time when you create a card
(using the Square Point of Sale application, Seller Dashboard, or Gift Cards API).
In the case of a plastic gift card, it is the time when Square associates the card with the
seller at the time of activation.
Read only: true
customer_idsarrayOptionalThe IDs of the [customer profiles](entity:Customer) to whom this gift card is linked.
Read only: true
customer_ids[]stringEach item
ganJSONOptional
gan (anyOf 1)stringAlternativeThe gift card account number (GAN). Buyers can use the GAN to make purchases or check
the gift card balance.
gan (anyOf 2)nullAlternative
gan_sourceJSONOptional
gan_source (anyOf 1)stringAlternativeIndicates the source that generated the gift card
account number (GAN).
The source that generated the gift card account number (GAN). The default value is `SQUARE`.
See [GANSource](#type-gansource) for possible values
Known values: SQUARE, OTHER
gan_source (anyOf 2)nullAlternative
idstringOptionalThe Square-assigned ID of the gift card.
Read only: true
statestringOptionalIndicates the gift card state.
The current gift card state.
See [Status](#type-status) for possible values
Known values: ACTIVE, DEACTIVATED, BLOCKED, PENDING
Read only: true
typestringRequired within parentIndicates the gift card type.
The gift card type.
See [Type](#type-type) for possible values
Known values: PHYSICAL, DIGITAL

Referenced models: Pay Order — response body — order total money

Link Customer To Gift Card — request body — body

FieldTypePresenceDescription and constraints
$objectRootA request to link a customer to a gift card.
customer_idstringRequired within parentThe ID of the customer to link to the gift card.
Maximum length: 191
Minimum length: 1

Link Customer To Gift Card — response body

FieldTypePresenceDescription and constraints
$objectRootA response that contains the linked `GiftCard` object. If the request resulted in errors,
the response contains a set of `Error` objects.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
gift_cardModelOptionalExpand Create Gift Card — response body — gift card
The gift card with the ID of the linked customer listed in the `customer_ids` field.

Referenced models: Get Shift — response body — errors item, Create Gift Card — response body — gift card

List Gift Cards — response body

FieldTypePresenceDescription and constraints
$objectRootA response that contains a list of `GiftCard` objects. If the request resulted in errors,
the response contains a set of `Error` objects.
cursorstringOptionalWhen a response is truncated, it includes a cursor that you can use in a
subsequent request to retrieve the next set of gift cards. If a cursor is not present, this is
the final response.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
gift_cardsarrayOptionalThe requested gift cards or an empty object if none are found.
gift_cards[]ModelEach itemExpand Create Gift Card — response body — gift card

Referenced models: Get Shift — response body — errors item, Create Gift Card — response body — gift card

Retrieve Gift Card From GAN — request body — body

FieldTypePresenceDescription and constraints
$objectRootA request to retrieve gift cards by their GANs.
ganstringRequired within parentThe 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.
Maximum length: 255
Minimum length: 1

Retrieve Gift Card From GAN — response body

FieldTypePresenceDescription and constraints
$objectRootA response that contains a `GiftCard`. This response might contain a set of `Error` objects
if the request resulted in errors.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
gift_cardModelOptionalExpand Create Gift Card — response body — gift card
A gift card that was fetched, if present. It returns empty if an error occurred.

Referenced models: Get Shift — response body — errors item, Create Gift Card — response body — gift card

Retrieve Gift Card From Nonce — request body — body

FieldTypePresenceDescription and constraints
$objectRootA request to retrieve a gift card by using a payment token.
noncestringRequired within parentThe payment token of the gift card to retrieve. Payment tokens are generated by the
Web Payments SDK or In-App Payments SDK.
Minimum length: 1

Retrieve Gift Card From Nonce — response body

FieldTypePresenceDescription and constraints
$objectRootA response that contains a `GiftCard` object. If the request resulted in errors,
the response contains a set of `Error` objects.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
gift_cardModelOptionalExpand Create Gift Card — response body — gift card
The retrieved gift card.

Referenced models: Get Shift — response body — errors item, Create Gift Card — response body — gift card

Retrieve Gift Card — response body

FieldTypePresenceDescription and constraints
$objectRootA response that contains a `GiftCard`. The response might contain a set of `Error` objects
if the request resulted in errors.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
gift_cardModelOptionalExpand Create Gift Card — response body — gift card
The gift card retrieved.

Referenced models: Get Shift — response body — errors item, Create Gift Card — response body — gift card

Unlink Customer From Gift Card — request body — body

FieldTypePresenceDescription and constraints
$objectRootA request to unlink a customer from a gift card.
customer_idstringRequired within parentThe ID of the customer to unlink from the gift card.
Maximum length: 191
Minimum length: 1

Unlink Customer From Gift Card — response body

FieldTypePresenceDescription and constraints
$objectRootA response that contains the unlinked `GiftCard` object. If the request resulted in errors,
the response contains a set of `Error` objects.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
gift_cardModelOptionalExpand Create Gift Card — response body — gift card
The gift card with the ID of the unlinked customer removed from the `customer_ids` field.
If no other customers are linked, the `customer_ids` field is also removed.

Referenced models: Get Shift — response body — errors item, Create Gift Card — response body — gift card

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.