Link customer to gift card
POST
/v2/gift-cards/{gift_card_id}/link-customer
Links a customer to a gift card, which is also referred to as adding a card on file.
Name | Description |
---|---|
gift_
Required
|
The ID of the gift card to be linked. |
Name | Description |
---|---|
customer_
Required
|
The ID of the customer to link to the gift card. |
Response Fields
Name | Description |
---|---|
errors
|
Any errors that occurred during the request. |
gift_
|
The gift card with the ID of the linked customer listed in the |
Examples
POST
/v2/gift-cards/{gift_card_id}/link-customer
cURL
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/gift-cards/gftc%3A71ea002277a34f8a945e284b04822edb/link-customer \
-X POST \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW"
}'
Response JSON
{
"gift_card": {
"id": "gftc:71ea002277a34f8a945e284b04822edb",
"type": "DIGITAL",
"gan_source": "SQUARE",
"state": "ACTIVE",
"balance_money": {
"amount": 2500,
"currency": "USD"
},
"gan": "7783320005440920",
"created_at": "2021-03-25T05:13:01Z",
"customer_ids": [
"GKY0FZ3V717AH8Q2D821PNT2ZW"
]
}
}