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

# Crear una Tarjeta Virtual

> Emite una tarjeta virtual con un límite de gasto y fuente de fondos.

```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);
```

Requiere el alcance `CREATE_VIRTUALCARD`.

Relacionado: [Tarjetas virtuales](/solutions/virtual-cards).
