> ## 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.

# Edit Card Overview

The `editVirtualCard` mutation allows you to update various details of an existing virtual card, such as spend limits, lock date, and nickname.

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

## Arguments

* **`input`** (`EditVirtualCardInput!`): The input object containing the virtual card ID and the fields to update.

## EditVirtualCardInput fields

| Field                  | Type                            | Description                                               | Required |
| :--------------------- | :------------------------------ | :-------------------------------------------------------- | :------- |
| `virtualCardId`        | `UUID!`                         | The virtual card to update.                               | Yes      |
| `spendLimit`           | `Float`                         | The maximum amount that you can charge to the card.       | No       |
| `spendLimitDuration`   | `VirtualCardSpendLimitDuration` | Card limit duration type.                                 | No       |
| `lockDate`             | `String`                        | The date when the card will be locked. Format: yyyy-mm-dd | No       |
| `lockCardNextUse`      | `Boolean`                       | The setting to lock the card after next use.              | No       |
| `cardNickname`         | `String`                        | The card's nickname.                                      | No       |
| `primaryFundingSource` | `VirtualCardFundingSource`      | Primary Funding Source for Virtual Card.                  | No       |
| `bankAccountId`        | `UUID`                          | The unique identifier for the bank account.               | No       |
| `userCashBalanceId`    | `UUID`                          | The unique identifier for the user cash balance.          | No       |

## 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 { editVirtualCard( input: { virtualCardId: \"07df5653-43a8-4532-9881-3ab5857bbe11\", spendLimit: 200.00, spendLimitDuration: \"MONTHLY\", cardNickname: \"Edited Card Nickname\", lockCardNextUse: false } ) { virtualCardId cardholderName expiryMonth expiryYear virtualCardLast4 status cardType initialAmount usedAmount createdAt authorizationSetting { virtualCardAsaSettingsId lockDate dailySpendLimit monthlySpendLimit cardNickname lockCardNextUse } } }"
  }'
```

## Sample response

```json theme={null}
{
  "data": {
    "editVirtualCard": {
      "virtualCardId": "07df5653-43a8-4532-9881-3ab5857bbe11",
      "userId": "00a2ec0a-255f-4fe7-85ad-2958dc8d3c72",
      "cardholderName": "John Doe",
      "expiryMonth": "12",
      "expiryYear": "27",
      "virtualCardLast4": "7890",
      "status": "ACTIVE",
      "cardType": "MULTI_USE",
      "initialAmount": 200,
      "usedAmount": 0,
      "createdAt": "2023-10-26T10:00:00Z",
      "authorizationSetting": {
        "virtualCardAsaSettingsId": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
        "lockDate": "1875743999999",
        "dailySpendLimit": null,
        "monthlySpendLimit": "200.00",
        "cardNickname": "Edited Card Nickname",
        "lockCardNextUse": false
      }
    }
  }
}
```

## Response fields

| Field                                           | Type                              | Description                                                                                   |
| ----------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------------- |
| `virtualCardId`                                 | `UUID`                            | The unique identifier of the virtual card that was edited.                                    |
| `cardholderName`                                | `String`                          | The name of the cardholder associated with the virtual card.                                  |
| `expiryMonth`                                   | `String`                          | The expiration month of the virtual card.                                                     |
| `expiryYear`                                    | `String`                          | The expiration year of the virtual card.                                                      |
| `virtualCardLast4`                              | `String`                          | The last four digits of the virtual card number.                                              |
| `status`                                        | `VirtualCardStatus`               | The current status of the virtual card.                                                       |
| `cardType`                                      | `VirtualCardType`                 | The type of the virtual card (e.g., `MULTI_USE`).                                             |
| `initialAmount`                                 | `Float`                           | The initial amount (spend limit) set on the card when it was created.                         |
| `usedAmount`                                    | `Float`                           | The total amount spent on the virtual card.                                                   |
| `createdAt`                                     | `DateTime`                        | The timestamp when the virtual card was originally created.                                   |
| `authorizationSetting`                          | `VirtualCardAuthorizationSetting` | An object containing the authorization settings for the virtual card, reflecting any updates. |
| `authorizationSetting.virtualCardAsaSettingsId` | `UUID`                            | The unique identifier for this specific authorization setting.                                |
| `authorizationSetting.lockDate`                 | `String`                          | The date the card will be locked, if set.                                                     |
| `authorizationSetting.dailySpendLimit`          | `String`                          | The daily spending limit, if applicable.                                                      |
| `authorizationSetting.monthlySpendLimit`        | `String`                          | The monthly spending limit, if applicable.                                                    |
| `authorizationSetting.cardNickname`             | `String`                          | The updated nickname for the card.                                                            |
| `authorizationSetting.lockCardNextUse`          | `Boolean`                         | Indicates if the card will be locked after its next use.                                      |

## Next steps

<CardGroup cols={2}>
  <Card title="Lock a virtual card" icon="lock" href="/features/lock-virtual-card">
    Temporarily block all spend on a card without closing it.
  </Card>

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