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

# Issue 100 Cards at Once

> Create a bulk virtual card order, poll it to completion, and handle partial failures — the programmatic issuance pattern at scale.

This Quickstart issues 100 virtual cards in one request. You'll place an asynchronous bulk order, poll its status as cards are created, and retrieve the full card details — the same pattern whether you're issuing 10 cards or 10,000.

<Info>
  **Prerequisites**

  * A **Fluz account with a staging application** — Steps 1–2 of any quickstart, or see [Prepare your accounts](/get-started/prepare-accounts) and [API credentials](/get-started/api-credentials).
  * A token with the **`CREATE_VIRTUALCARD`** scope.
  * Enough available balance to cover the order — 100 cards × the spend limit you set. Every mutation needs a unique `idempotencyKey` — see [Idempotency](/concepts/idempotency).
</Info>

## The full flow

<Steps>
  <Step title="Place the bulk order" icon="layers">
    One `createVirtualCardBulkOrder` call creates all 100 cards. Each entry in `orderItems` is a card configuration with a `quantity` — here, 100 identical single-use disbursement cards:

    <CodeGroup>
      ```graphql Mutation theme={null}
          mutation createVirtualCardBulkOrder($input: CreateVirtualCardBulkOrderInput!) {
            createVirtualCardBulkOrder(input: $input) {
              orderId
              orderStatus
            }
          }
      ```

      ```json Variables theme={null}
          {
            "input": {
              "idempotencyKey": "9f2a1c30-7b8d-4e1f-a6c2-5d3e8f901b2c",
              "offerId": "592c394e-26cc-44ac-a145-a5f81301fe77",
              "orderItems": [
                {
                  "quantity": 100,
                  "spendLimit": 25.00,
                  "lockCardNextUse": true,
                  "cardNickname": "July payout batch",
                  "primaryFundingSource": "FLUZ_BALANCE"
                }
              ]
            }
          }
      ```

      ```json Response theme={null}
          {
            "data": {
              "createVirtualCardBulkOrder": {
                "orderId": "ZTBhYTg2YmQt...",
                "orderStatus": "PENDING"
              }
            }
          }
      ```
    </CodeGroup>

    The `offerId` applies to **every** card in the order; mix configurations by adding more `orderItems` entries (e.g., 80 × $25 single-use plus 20 × $100 monthly). `lockCardNextUse: true` makes each card self-destruct after its first charge — the standard disbursement pattern.

    <Note>
      Bulk orders are **asynchronous** — the response is an `orderId` and `PENDING`, not cards. Save the `orderId`; it's your handle for everything that follows.
    </Note>
  </Step>

  <Step title="Poll the order to completion" icon="list-checks">
    Track progress with `getVirtualCardBulkOrderStatus`. Cards populate incrementally while the order is `PENDING`:

    <CodeGroup>
      ```graphql Query theme={null}
          query getVirtualCardBulkOrderStatus($input: GetVirtualCardBulkOrderStatusInput!) {
            getVirtualCardBulkOrderStatus(input: $input) {
              orderId
              orderStatus
              successfulCardCreations
              failedCardCreations
              totalCards
              virtualCards {
                virtualCardId
                cardNumber
                expiryMMYY
                cvv
                cardHolderName
              }
            }
          }
      ```

      ```json Variables theme={null}
          { "input": { "orderId": "<ORDER_ID_FROM_STEP_1>" } }
      ```
    </CodeGroup>

    Poll with backoff until `orderStatus` is `COMPLETED` (or `FAILED`) — while pending, `successfulCardCreations` climbs toward `totalCards` and `virtualCards` fills in.

    <Warning>
      The response contains **full PANs, CVVs, and expiry dates in plaintext**. Treat it as sensitive cardholder data: TLS only, never log it, surface it only to authorized users.
    </Warning>
  </Step>

  <Step title="Handle partial failures" icon="triangle-alert">
    A bulk order can partially succeed: `successfulCardCreations: 98, failedCardCreations: 2` on a completed order means 98 real, spendable cards and 2 that need retrying. Reconcile by comparing the counts to `totalCards`, then re-issue only the shortfall — with a **new** `idempotencyKey`, since it's a new order:

    ```json theme={null}
        {
          "input": {
            "idempotencyKey": "<NEW_UUID>",
            "offerId": "592c394e-26cc-44ac-a145-a5f81301fe77",
            "orderItems": [{ "quantity": 2, "spendLimit": 25.00, "lockCardNextUse": true }]
          }
        }
    ```

    Persistent failures usually trace to program limits or funding — check [Virtual Card Error Codes](/features/virtual-card-error-codes) and your available balance.
  </Step>
</Steps>

## You're done 🎉

One hundred configured cards from one request, with a poll loop that's production-ready as-is. Next:

<CardGroup cols={2}>
  <Card title="Get virtual card transactions" icon="receipt" href="/features/get-virtual-card-transactions">
    Monitor spend across the whole batch — up to 10 cards per query, or account-wide by date.
  </Card>

  <Card title="Send cards to recipients" icon="send" href="/quickstart/send-a-card">
    Distributing to people outside your org? Hosted claim links handle onboarding for you.
  </Card>
</CardGroup>

<Note>
  **Want to learn more?** Contact us at [support@fluz.app](mailto:support@fluz.app) to speak with our experts or request a demo.
</Note>
