GiftCards
Retrieves, creates, and updates gift card records in Square, including card type, balance, state, account details, and customer associations.
Table Specific Information
Select
The add-in uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the add-in.
Retrieve all GiftCards:
SELECT * from GiftCards
Retrieve a gift card using the gift card ID:
SELECT * from GiftCards where id = 'gftc:3c0c38e043a742c58431e3cca603c5b9'
Insert
To create a gift card, you need to specify the LocationId and gift card type. LocationId is a pseudocolumn used only while creating a new gift card:
INSERT INTO GiftCards(LocationId, Type) VALUES('92BYHNBR6W77E','DIGITAL')
The LocationId column is only allowed for INSERT operations.
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The Square-assigned Id of the gift card. |
| Type | String | False |
The gift card type (for example, physical or digital). |
| GiftCardAccountNumberSource | String | False |
The source that generated the gift card account number (GAN). The default value is SQUARE. |
| State | String | True |
The current status of the gift card (for example, active, inactive, redeemed, or deactivated). |
| BalanceMoneyAmount | Int64 | True |
The current gift card balance amount. This balance is always greater than or equal to zero. |
| BalanceMoneyCurrency | String | True |
The currency code for the balance amount, in ISO 4217 format (for example, USD or CAD). |
| GiftCardAccountNumber | String | False |
The gift card account number (GAN). Buyers can use the GAN to make purchases or check the gift card balance. |
| CreatedAt | Datetime | True |
The 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). |
| CustomerIds | String | True |
The Ids of the customer profiles to whom this gift card is linked. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| LocationId | String |
The Id of the location where the gift card should be registered for reporting purposes. Allowed only for performing INSERT operations. |