Square: Gift cards schemas
14 Square schemas with complete fields and constraints.
← Gift cards operations · All schemas
Create Gift Card — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [CreateGiftCard](api-endpoint:GiftCards-CreateGiftCard) request. |
gift_card | Model | Required within parent | Expand 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_key | string | Required within parent | A 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_id | string | Required within parent | The 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a Square gift card. |
balance_money | Model | Optional | Expand 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_at | string | Optional | 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). 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_ids | array | Optional | The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked. Read only: true |
customer_ids[] | string | Each item | |
gan | JSON | Optional | |
gan (anyOf 1) | string | Alternative | The gift card account number (GAN). Buyers can use the GAN to make purchases or check the gift card balance. |
gan (anyOf 2) | null | Alternative | |
gan_source | JSON | Optional | |
gan_source (anyOf 1) | string | Alternative | Indicates 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) | null | Alternative | |
id | string | Optional | The Square-assigned ID of the gift card. Read only: true |
state | string | Optional | Indicates 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 |
type | string | Required within parent | Indicates 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request resulted in errors. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
gift_card | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a Square gift card. |
balance_money | Model | Optional | Expand 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_at | string | Optional | 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). 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_ids | array | Optional | The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked. Read only: true |
customer_ids[] | string | Each item | |
gan | JSON | Optional | |
gan (anyOf 1) | string | Alternative | The gift card account number (GAN). Buyers can use the GAN to make purchases or check the gift card balance. |
gan (anyOf 2) | null | Alternative | |
gan_source | JSON | Optional | |
gan_source (anyOf 1) | string | Alternative | Indicates 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) | null | Alternative | |
id | string | Optional | The Square-assigned ID of the gift card. Read only: true |
state | string | Optional | Indicates 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 |
type | string | Required within parent | Indicates 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A request to link a customer to a gift card. |
customer_id | string | Required within parent | The ID of the customer to link to the gift card. Maximum length: 191 Minimum length: 1 |
Link Customer To Gift Card — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A response that contains the linked `GiftCard` object. If the request resulted in errors, the response contains a set of `Error` objects. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
gift_card | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A response that contains a list of `GiftCard` objects. If the request resulted in errors, the response contains a set of `Error` objects. |
cursor | string | Optional | When 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). |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
gift_cards | array | Optional | The requested gift cards or an empty object if none are found. |
gift_cards[] | Model | Each item | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A request to retrieve gift cards by their GANs. |
gan | string | Required within parent | 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. Maximum length: 255 Minimum length: 1 |
Retrieve Gift Card From GAN — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A response that contains a `GiftCard`. This response might contain a set of `Error` objects if the request resulted in errors. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
gift_card | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A request to retrieve a gift card by using a payment token. |
nonce | string | Required within parent | The 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A response that contains a `GiftCard` object. If the request resulted in errors, the response contains a set of `Error` objects. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
gift_card | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request resulted in errors. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
gift_card | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A request to unlink a customer from a gift card. |
customer_id | string | Required within parent | The ID of the customer to unlink from the gift card. Maximum length: 191 Minimum length: 1 |
Unlink Customer From Gift Card — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A response that contains the unlinked `GiftCard` object. If the request resulted in errors, the response contains a set of `Error` objects. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
gift_card | Model | Optional | Expand 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