> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Create Gift Card Activity

> Creates a gift card activity to manage the balance or state of a [gift card](entity:GiftCard).

`square.createGiftCardActivity` creates a gift card activity to manage the balance or state of a [gift card](entity:GiftCard).

## Example

```ts automations/square-create-gift-card-activity.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { square } from "automate.ax/square"

export default automation("Create Square Gift Card Activity", () => {
  onDashboardRun({ title: "Create Square Gift Card Activity" })

  square.createGiftCardActivity({
    idempotencyKey: "U16kfr-kA70er-q4Rsym-7U7NnY",
    giftCardActivity: {
      type: "ACTIVATE",
      locationId: "81FN9BNFZTKS4",
      giftCardId: "gftc:6d55a72470d940c6ba09c0ab8ad08d20",
      activateActivityDetails: {
        orderId: "jJNGHm4gLI6XkFbwtiSLqK72KkAZY",
        lineItemUid: "eIWl7X0nMuO9Ewbh0ChIx",
      },
    },
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `GIFTCARDS_WRITE`.

| Field              | Type                      | Required | Default | Description                                                                                                                                                                                                                                            |
| ------------------ | ------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `idempotencyKey`   | `string`                  | Yes      | —       | A unique string that identifies the `CreateGiftCardActivity` request.                                                                                                                                                                                  |
| `giftCardActivity` | `Square.GiftCardActivity` | Yes      | —       | The activity to create for the gift card. This activity must specify `gift_card_id` or `gift_card_gan` for the target gift card, the `location_id` where the activity occurred, and the activity `type` along with the corresponding activity details. |

Use the official [CreateGiftCardActivity reference](https://developer.squareup.com/reference/square/gift-card-activities-api/create-gift-card-activity) for provider field semantics and limits.

## Output

Returns the official `Square.CreateGiftCardActivityResponse` response as a codec-safe object. Square integer money amounts remain `bigint` values.
