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

# Set Virtual Card PIN

The `setVirtualCardPIN` mutation allows you to set a PIN on eligible virtual cards that have not had a PIN set on them yet. When creating virtual cards through the Fluz API, your cards are created without setting the PIN. Most of the time, you will not need one. However, if you'd like to set one you can use this mutation to automatically identify and update all cards that support a PIN, but haven't had their PIN set yet.

<Info>
  **Prerequisites:** a user access token with the `CREATE_VIRTUALCARD` scope. The PIN you set must match your user PIN.
</Info>

<Note>
  This mutation adds the eligible cards to a queue for processing. The actual updating of the PINs can take several minutes — the response indicates whether the enqueuing was successful, not whether every card has been updated yet.
</Note>

## Arguments

* **`input`** (`SetVirtualCardPINInput!`): The input object that contains the PIN to be set on the cards. It must match your user PIN.

## Sample mutation

```graphql theme={null}
mutation {
  setVirtualCardPIN(input: { pin: "1234" }) {
    success
    pinError
  }
}
```

## cURL example

```curl theme={null}
curl -X POST \
  https://transactional-graph.staging.fluzapp.com/api/v1/graphql \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_USER_ACCESS_TOKEN' \
  -d '{
    "query": "mutation { setVirtualCardPIN(input: { pin: \"1234\" }) { success pinError } }"
  }'
```

## Sample response

```json theme={null}
{
  "data": {
    "setVirtualCardPIN": {
      "success": true,
      "pinError": null
    }
  }
}
```

## Response fields

| Field      | Type      | Description                                                                       |
| ---------- | --------- | --------------------------------------------------------------------------------- |
| `success`  | `Boolean` | Indicates whether the request to set PINs was successfully queued for processing. |
| `pinError` | `String`  | Text that will alert you if there was an error verifying your PIN.                |

## Code example

<Recipe slug="set-virtual-card-pin" title="Set Virtual Card PIN" />

## Next steps

<Card title="Digital wallet push provisioning" icon="smartphone" horizontal href="/digital-wallet-push-provisioning">
  Push a virtual card into Apple Pay or Google Wallet for tap-to-pay.
</Card>

<StickyContactSalesBanner />
