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

# Create a Virtual Card

> Issue a virtual card with a spend limit and funding source.

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

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

const CREATE_VIRTUAL_CARD = gql`
  mutation {
    createVirtualCard(
      input: {
        idempotencyKey: "07df5653-43a8-4532-9881-3ab5857bbe12"
        spendLimit: 123.45
        spendLimitDuration: DAILY
        lockDate: "2030-10-10"
        lockCardNextUse: true
        cardNickname: "Team travel"
        primaryFundingSource: FLUZ_BALANCE
        offerId: "b3355504-ad30-4b2f-873d-b8795277b918"
      }
    ) {
      virtualCardId
      cardholderName
      expiryMonth
      expiryYear
      virtualCardLast4
      status
      initialAmount
      createdAt
    }
  }
`;

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

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

Requires the `CREATE_VIRTUALCARD` scope.

Related: [Virtual cards](/features/virtual-cards).
