• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Unlink customer from gift card BETA

POST /v2/gift-cards/{gift_card_id}/unlink-customer

Unlinks a customer from a gift card, which is also referred to as removing a card on file.


Permissions
GIFTCARDS_WRITE
Guide
Manage gift cards on file
Try in API Explorer
Name Description
gift_card_id
string

Required

The ID of the gift card to be unlinked.

Name Description
customer_id
string

Required

The ID of the customer to unlink from the gift card.

Min Length 1 Max Length 191

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

gift_card
GiftCard

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.

Examples

You are viewing an old version of the API
POST /v2/gift-cards/{gift_card_id}/unlink-customer
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/gift-cards/gftc%3A71ea002277a34f8a945e284b04822edb/unlink-customer \
  -X POST \
  -H 'Square-Version: 2022-05-12' \
  -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"
  }
}