> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thedecard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 快速开始

> 带您在沙盒环境中通过推荐的分步流程发出第一张虚拟卡：创建用户 → 申请 KYC 工单 → 申请虚拟卡。

***

## 📄 正文

本指南带您在沙盒环境调通核心接口，发出第一张虚拟卡。全程 5 步。

沙盒地址：`https://api.thedecard-sandbox.com`

> 以下示例省略鉴权头与字段加密。所有请求都需携带四个鉴权头（`X-DAPI-API-KEY` / `X-DAPI-TIMESTAMP` / `X-DAPI-NONCE` / `X-DAPI-SIGN`）并设置 `Content-Type: application/json`，手机号、邮箱、KYC 等敏感字段需 AES 加密——规则见 [鉴权指南](../integration-resources/authentication)。

> **分步路径的好处**（创建用户 → 申请 KYC → 申请卡）：
>
> * **KYC 工单可复用**：同一用户开第二张卡时无需重交资料，复用同一个 `kycTicketId`；
> * **状态可控、易排查**：KYC 与开卡解耦，各自有独立工单与状态线。

### 1. 创建用户

```http theme={null}
POST /open-api/customer/v1/create-customer
```

```json theme={null}
{ "phoneCountryCode": "SG", "phone": "+6591234567", "email": "user@example.com", "customerRef": "your-uniq-ref-001" }
```

响应返回 `customerId`，后续步骤都要用：

```json theme={null}
{ "code": "SYS_SUCCESS", "message": "success", "messageDetail": null, "data": { "customerId": "C100001", "status": "SUCCEED" } }
```

### 2. 申请 KYC 工单

> 证件文件要先上传：调 `POST /open-api/intent-ticket/v1/generate-pre-upload-url`（`businessType=CREATE_CARD_KYC`）取临时上传地址，PUT 文件后拿到 `objectKey`，填入下面的 `identityProofUrl`。完整步骤见[申请 KYC](../how-to-use/kyc/apply-kyc)「方式二步骤 1」。

```http theme={null}
POST /open-api/kyc-ticket/v1/apply-kyc
```

```json theme={null}
{
  "kycTicketRef": "your-kyc-ref-001",
  "customerId": "C100001",
  "identifyProofList": [ { "identityProofType": "PASSPORT", "identityProofUrl": "<预上传返回的 objectKey>" } ],
  "addressProofList": [],
  "kycCareerInfo": { "employmentStatus": "EMPLOYED", "occupation": "..." }
}
```

响应返回 `kycTicketId`：

```json theme={null}
{ "data": { "kycTicketId": "KYC_1a2b", "kycTicketRef": "your-kyc-ref-001", "status": "PENDING" } }
```

> **等待工单 `PASSED`**：通过 `KYC_TICKET` Webhook 或查询接口拿结果。若状态为 `NEED_VERIFY`，需引导用户完成人脸认证。证件字段、状态机与拒绝码见 [申请 KYC](../how-to-use/kyc/apply-kyc)；可发地区与各地区证件要求见 [合规与 KYC 流程](../basic-concepts/compliance-kyc-flow)。

### 3. 申请虚拟卡（NORMAL 模式）

KYC 工单 `PASSED` 后，用 `kycTicketId` + `customerId` 开卡：

```http theme={null}
POST /open-api/card-order/v1/apply-virtual
```

```json theme={null}
{
  "profileId": "your-card-profile-id",
  "cardOrderRef": "your-order-ref-001",
  "cardApplyMode": "NORMAL",
  "customerId": "C100001",
  "kycTicketId": "KYC_1a2b"
}
```

> 响应返回 `cardOrderId`。同一用户后续再开卡，**复用同一个 `kycTicketId` 即可，无需重新提交 KYC**。

### 4. 查询卡订单，等待开卡成功

```http theme={null}
GET /open-api/card-order/v1/detail?cardOrderId=O100001
```

轮询直到 `status = COMPLETED`，响应中即包含 `cardId`：

```json theme={null}
{ "data": { "cardOrderId": "O100001", "status": "COMPLETED", "cardId": "CARD100001" } }
```

> 卡订单状态线：`PENDING → CUSTOMER_PASS → KYC_PASS → CHANNEL_CUSTOMER_PASS → COMPLETED`。若 `FAILED`，看 `errorCode` / `errorReason`（错误码见 [卡申请错误码](../how-to-use/cards/card-order-codes)）。

### 5. 查询卡详情 —— 卡已可消费

```http theme={null}
GET /open-api/card/v1/detail?cardId=CARD100001
```

```json theme={null}
{ "data": { "cardId": "CARD100001", "status": "ACTIVATED", "panFirst6": "441364", "panLast4": "1234" } }
```

> 虚拟卡**自动激活**（实体卡需激活）。完整卡号 / CVV 需通过专门接口获取，见 [获取卡敏感信息](../how-to-use/cards/secure-card)。
>
> 至此第一张虚拟卡已激活。持卡人消费时，DCS 会将授权请求**转发到您的 `auth_url`**，由您实时返回 Approve / Decline——这是合作伙伴自管模式的核心，见 [授权（转发决策）](../how-to-use/transactions/authorization)。

## 下一步

* 开卡完整流程与 KYC 细节 → [开卡流程](../how-to-use/cards/card-issuing)
* 冻结 / 解冻 / 换卡 / 重置 PIN → [卡管理](../how-to-use/cards/card-management)
* 理解资金如何流转 → [资金模型](../basic-concepts/fund-model)
