> ## 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_TRANSACTIONS = gql`
  query GetVirtualCardTransactions {
    getVirtualCardTransactions(
      input: {
        virtualCardIds: ["2ed71ba0-d457-47ed-8ceb-d3fe6ce5c900"]
        paginate: { limit: 20, offset: 0 }
        filters: { transactionTypes: [PURCHASE] }
      }
    ) {
      virtualCardId
      transactions {
        transactionDate
        transactionType
        transactionStatus
        merchantName
        transactionAmount
      }
    }
  }
`;

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

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

需要 `PCI_COMPLIANCE` 與 `REVEAL_VIRTUALCARD` 權限範圍。
