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

# 获取批量订单状态

使用 `getVirtualCardBulkOrderStatus` 查询来检查批量创建虚拟卡订单的状态，并在订单处理过程中检索已创建卡片的详细信息。

<Info>
  **先决条件：** 具有 `CREATE_VIRTUALCARD` 范围的用户访问令牌，以及 [创建批量订单](/features/create-bulk-order) 返回的 `orderId`。
</Info>

<Warning>
  响应包含明文的完整卡号、CVV 和到期日期。将其作为敏感持卡人数据处理——通过 TLS 传输、切勿记录日志，并仅向授权用户展示。
</Warning>

## 参数

* `input` (`GetVirtualCardBulkOrderStatusInput!`): 包含该批量订单标识符的输入对象。

## GetVirtualCardBulkOrderStatusInput 字段

| 字段        | 类型        | 描述                                             | 必填 |
| :-------- | :-------- | :--------------------------------------------- | :- |
| `orderId` | `String!` | 批量订单的唯一标识符，来自 `createVirtualCardBulkOrder` 变更。 | 是  |

## cURL 示例

```bash 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": "query GetVirtualCardBulkOrderStatus { getVirtualCardBulkOrderStatus( input: { orderId: \"ZTBhYTg2YmQtZWQwYS00OWQxLTk5ZmUtZDBhZGY3ZjYxZGUyfDI0NjMyM2NmLTBkMzEtNGI2YS04NGQ2LTRmNGI2NzMzNmU5Yw==\" } ) { orderStatus orderId virtualCards { cardNumber expiryMMYY cvv cardHolderName virtualCardId billingAddress { city } } successfulCardCreations failedCardCreations totalCards } }"
  }'
```

## 示例查询

```graphql theme={null}
query GetVirtualCardBulkOrderStatus {
    getVirtualCardBulkOrderStatus(
        input: {
            orderId: "<<ORDER_ID>>"
        }
    ) {
        orderStatus
        orderId
        virtualCards {
            cardNumber
            expiryMMYY
            cvv
            cardHolderName
            virtualCardId
            billingAddress {
                city
            }
        }
        successfulCardCreations
        failedCardCreations
        totalCards
    }
}
```

## 示例响应

```json theme={null}
{
    "data": {
        "getVirtualCardBulkOrderStatus": {
            "orderStatus": "COMPLETED",
            "orderId": "<<ORDER_ID>>",
            "virtualCards": [
                {
                    "cardNumber": "5111147189413564",
                    "expiryMMYY": "08/29",
                    "cvv": "143",
                    "cardHolderName": "Test",
                    "virtualCardId": "104b50d2-97e5-49ee-b9fd-b42120d68212",
                    "billingAddress": {
                        "city": "San Jose"
                    }
                },
                {
                    "cardNumber": "5111143166431356",
                    "expiryMMYY": "08/29",
                    "cvv": "135",
                    "cardHolderName": "Test",
                    "virtualCardId": "03291f04-8358-44f7-ac58-73a6643ac07f",
                    "billingAddress": {
                        "city": "San Jose"
                    }
                }
            ],
            "successfulCardCreations": 4,
            "failedCardCreations": 0,
            "totalCards": 4
        }
    }
}
```

## 响应字段

| 字段                              | 类型                            | 描述                                          |
| ------------------------------- | ----------------------------- | ------------------------------------------- |
| `orderId`                       | `String`                      | 批量创建订单的唯一标识符。                               |
| `orderStatus`                   | `VirtualCardBulkOrderStatus!` | 批量订单的状态（例如 `COMPLETED`、`PENDING`、`FAILED`）。 |
| `virtualCards`                  | `[VirtualCardDetails]`        | 每张成功创建的卡的完整详情。会在卡片创建时逐步填充。                  |
| `virtualCards[].cardNumber`     | `String`                      | 16 位完整虚拟卡号。                                 |
| `virtualCards[].expiryMMYY`     | `String`                      | 卡片的到期日期，格式为 MM/YY。                          |
| `virtualCards[].cvv`            | `String`                      | 卡片的 3 位安全码。                                 |
| `virtualCards[].cardHolderName` | `String`                      | 分配给持卡人的姓名。                                  |
| `virtualCards[].virtualCardId`  | `UUID`                        | 虚拟卡的唯一标识符。                                  |
| `virtualCards[].billingAddress` | `Object`                      | 与虚拟卡关联的账单地址。                                |
| `successfulCardCreations`       | `Int`                         | 目前已成功创建的卡片数量。                               |
| `failedCardCreations`           | `Int`                         | 创建失败的卡片数量。                                  |
| `totalCards`                    | `Int`                         | 订单中请求的卡片总数。                                 |

<Tip>
  轮询此查询，直到 `orderStatus` 为 `COMPLETED`（或 `FAILED`）。在 `PENDING` 期间，`virtualCards` 会逐步填充，且 `successfulCardCreations` 会逐步接近 `totalCards`。
</Tip>

## 后续步骤

<CardGroup cols={2}>
  <Card title="显示一张虚拟卡" icon="eye" href="/recipes/reveal-virtual-card">
    安全检索单张卡的敏感卡片详情。
  </Card>

  <Card title="虚拟卡错误代码" icon="triangle-alert" href="/features/virtual-card-error-codes">
    解读 `failedCardCreations` 并处理部分失败的情况。
  </Card>
</CardGroup>
