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

# 設定虛擬卡 PIN

`setVirtualCardPIN` 變更可讓你在尚未設定 PIN、且符合條件的虛擬卡上設定 PIN。透過 Fluz API 建立虛擬卡時，卡片最初不會設定 PIN。多數情況下你不需要 PIN。不過，如果你想設定 PIN，可以使用此變更自動識別並更新所有支援 PIN、但尚未設定 PIN 的卡片。

<Info>
  **先決條件：** 具有 `CREATE_VIRTUALCARD` 權限範圍的使用者存取權杖。你所設定的 PIN 必須與你的使用者 PIN 相符。
</Info>

<Note>
  此變更會將符合條件的卡片加入處理佇列。實際更新 PIN 可能需要數分鐘 — 回應表示的是是否成功加入佇列，並非每張卡片是否已完成更新。
</Note>

## Arguments

* **`input`** (`SetVirtualCardPINInput!`)：包含要設定至卡片之 PIN 的輸入物件。必須與你的使用者 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` | 指示設定 PIN 的請求是否已成功加入處理佇列。  |
| `pinError` | `String`  | 若在驗證你的 PIN 時發生錯誤，會提供提醒文字。 |

## Code example

<Recipe slug="set-virtual-card-pin" title="設定虛擬卡 PIN" />

## Next steps

<Card title="數位錢包即時配置" icon="smartphone" horizontal href="/digital-wallet-push-provisioning">
  將虛擬卡推送至 Apple Pay 或 Google Wallet 以進行感應支付。
</Card>

<StickyContactSalesBanner />
