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

# Lock Virtual Card

The `lockVirtualCard` mutation allows you to lock an existing virtual card, preventing further transactions.

<Info>
  **Prerequisites:** a user access token with the `EDIT_VIRTUALCARD` scope, and the `virtualCardId` of the card to lock.
</Info>

## Arguments

* **`input`** (`LockVirtualCardInput!`): The input object containing the ID of the virtual card to lock.

## LockVirtualCardInput fields

| Field           | Type    | Description               | Required |
| :-------------- | :------ | :------------------------ | :------- |
| `virtualCardId` | `UUID!` | The virtual card to lock. | Yes      |

## Sample mutation

```graphql theme={null}
mutation {
  lockVirtualCard(input: { virtualCardId: "07df5653-43a8-4532-9881-3ab5857bbe11" }) {
    virtualCardId
    locked
  }
}
```

## cURL example

```curl theme={null}
curl -X POST \
  https://transactional-graph.staging.fluzapp.com/api/v1/graphql \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_USER_ACCESS_TOKEN' \
  -d '{
    "query": "mutation { lockVirtualCard(input: { virtualCardId: \"07df5653-43a8-4532-9881-3ab5857bbe11\" }) { virtualCardId locked } }"
  }'
```

## Sample response

```json theme={null}
{
  "data": {
    "lockVirtualCard": {
      "virtualCardId": "07df5653-43a8-4532-9881-3ab5857bbe11",
      "locked": true
    }
  }
}
```

## Response fields

| Field           | Type      | Description                                                              |
| --------------- | --------- | ------------------------------------------------------------------------ |
| `virtualCardId` | `UUID`    | The unique identifier of the virtual card that was targeted for locking. |
| `locked`        | `Boolean` | `true` if the card was successfully locked, `false` otherwise.           |

<Tip>
  To lock a card automatically after its first successful authorization, set `lockCardNextUse: true` at creation instead — see [Create Virtual Card](/features/create-card).
</Tip>

## Next steps

<Card title="Unlock a virtual card" icon="lock-open" horizontal href="/features/unlock-virtual-card">
  Re-enable a locked card so authorizations succeed again.
</Card>
