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

You are viewing an old version of the API
Create gift card activity BETA

POST /v2/gift-cards/activities

Creates a gift card activity.

For more information, see GiftCardActivity and Using activated gift cards.


Permissions
GIFTCARDS_WRITE
Try in API Explorer
Name Description
idempotency_key
string

Required

A unique string that identifies the CreateGiftCardActivity request.

Min Length 1 Max Length 128
gift_card_activity
GiftCardActivity

Required

An activity to create on the gift card. This includes the type of gift card activity and corresponding activity details.

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

gift_card_activity
GiftCardActivity

A gift card activity that was created.

Examples

You are viewing an old version of the API
POST /v2/gift-cards/activities
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/gift-cards/activities \
  -X POST \
  -H 'Square-Version: 2021-07-21' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "U16kfr-kA70er-q4Rsym-7U7NnY",
    "gift_card_activity": {
      "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20",
      "type": "ACTIVATE",
      "location_id": "81FN9BNFZTKS4",
      "activate_activity_details": {
        "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY",
        "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx"
      }
    }
  }'
Response JSON
{
  "gift_card_activity": {
    "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864",
    "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20",
    "gift_card_gan": "7783320002929081",
    "type": "ACTIVATE",
    "gift_card_balance_money": {
      "amount": 1000,
      "currency": "USD"
    },
    "location_id": "81FN9BNFZTKS4",
    "created_at": "2021-05-20T22:26:54.000Z",
    "activate_activity_details": {
      "amount_money": {
        "amount": 1000,
        "currency": "USD"
      },
      "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY",
      "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx"
    }
  }
}

Share feedback

Thanks for visiting the Square API documentation. What's on your mind?