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

# 编辑一张虚拟卡

> 更新现有卡的消费限额、昵称或锁定日期。

```javascript theme={null}
import { GraphQLClient, gql } from 'graphql-request';

const API_URL = 'https://transactional-graph.staging.fluzapp.com/api/v1/graphql';

const EDIT_VIRTUAL_CARD = gql`
  mutation {
    editVirtualCard(
      input: {
        virtualCardId: "59c7e092-7d5b-4ae7-946c-f119c93a830c"
        spendLimit: 200.00
        spendLimitDuration: LIFETIME
        lockDate: "2032-10-10"
        lockCardNextUse: false
        cardNickname: "Updated nickname"
        primaryFundingSource: FLUZ_BALANCE
      }
    ) {
      virtualCardId
      cardholderName
      virtualCardLast4
      status
      initialAmount
    }
  }
`;

const client = new GraphQLClient(API_URL, {
  headers: {
    Authorization: `Bearer <<USER_ACCESS_TOKEN>>`,
    'Content-Type': 'application/json',
  },
});

const response = await client.request(EDIT_VIRTUAL_CARD);
console.log(response);
```

需要 `EDIT_VIRTUALCARD` 范围（scope）。
