Create gift card
Creates a digital gift card or registers a physical (plastic) gift card.
After the gift card is created, you must call CreateGiftCardActivity to activate the card with an initial balance before it can be used for payment.
Name | Description |
---|---|
idempotency_
Required
|
A unique identifier for this request, used to ensure idempotency. For more information, see Idempotency. |
location_
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. |
gift_
Required
|
The gift card to create. The To direct Square to generate a 16-digit GAN, omit To provide a custom GAN, include
To register an unused, physical gift card that the seller previously ordered from Square,
include |
Response Fields
Name | Description |
---|---|
errors
|
Any errors that occurred during the request. |
gift_
|
The new gift card. |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/gift-cards \
-X POST \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"idempotency_key": "NC9Tm69EjbjtConu",
"location_id": "81FN9BNFZTKS4",
"gift_card": {
"type": "DIGITAL"
}
}'
{
"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"
}
}