> ## 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 GET_VIRTUAL_CARD_BALANCE = gql`
  query GetVirtualCardBalance {
    getVirtualCardBalance(
      input: {
        virtualCardIds: [
          "bd3be748-a0fb-4193-80a7-88419bc72dab"
          "9e42fdab-3c23-4eae-bd69-1fa746886505"
        ]
      }
    ) {
      virtualCardId
      spentAmount
      remainingBalance
      spendLimit
      spendLimitDuration
    }
  }
`;

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

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

需要 `PCI_COMPLIANCE` 和 `REVEAL_VIRTUALCARD` 范围（scopes）。
