> Documentation index: [Saleor](/llms.txt) · [This section](/api-reference/gift-cards/llms.txt)
> Source: https://docs.saleor.io/api-reference/gift-cards/mutations/gift-card-assign-user

# giftCardAssignUser Mutation

Restrict a gift card so only the given customer can use it.

Added in Saleor 3.23.

Requires the MANAGE\_GIFT\_CARD permission.

Triggers the following webhook events:

-   GIFT\_CARD\_UPDATED (async): A gift card was updated.

```graphql
giftCardAssignUser(
  id: ID!
  userId: ID!
): GiftCardAssignUser
```

Details

```graphql
type GiftCardAssignUser {
  giftCard: GiftCard
  giftCardErrors: [GiftCardError!]! @deprecated
  errors: [GiftCardError!]!
}
```

<a id="arguments"></a>

### Arguments

<a id="id"></a>

#### [`id`](#id) ● [`ID!`](/api-reference/miscellaneous/scalars/id.md)

ID of the gift card.

<a id="user-id"></a>

#### [`userId`](#user-id) ● [`ID!`](/api-reference/miscellaneous/scalars/id.md)

ID of the customer to restrict the card to.

<a id="type"></a>

### Type

<a id="giftcardassignuser"></a>

#### [`GiftCardAssignUser`](/api-reference/gift-cards/objects/gift-card-assign-user.md)

Restrict a gift card so only the given customer can use it.

Added in Saleor 3.23.

Requires the MANAGE\_GIFT\_CARD permission.

Triggers the following webhook events:

-   GIFT\_CARD\_UPDATED (async): A gift card was updated.
