> For the complete documentation index, see [llms.txt](https://docs.compliance.phalcon.blocksec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.compliance.phalcon.blocksec.com/zh-hant/api-documentation/customer/add-transactions-to-a-customer.md).

# 新增交易至客戶

## 将多笔交易批量绑定到客户

> 将已导入交易批量绑定到客户。

```json
{"openapi":"3.0.0","info":{"title":"Compliance API","version":"2.0.0"},"tags":[],"servers":[{"url":"https://api.blocksec.com/phalcon/compliance/v2","description":"生产环境服务器"}],"security":[{"API-Key":[]}],"components":{"securitySchemes":{"API-Key":{"type":"apiKey","in":"header","name":"API-Key"}},"schemas":{"CustomerAddTransaction":{"type":"object","required":["txHash","chainId"],"properties":{"txHash":{"type":"string","description":"待添加的 txHash。"},"chainId":{"type":"integer","description":"链 ID。关于所有支持的链及对应 chain ID，请查看：[https://docs.compliance.phalcon.blocksec.com/api-documentation/introduction/supported-chains](https://docs.compliance.phalcon.blocksec.com/api-documentation/introduction/supported-chains)。"},"toAddress":{"type":"string","description":"转账地址。"},"transferIndex":{"type":"integer","description":"交易索引。"}}},"CustomerAddTransactionResult":{"type":"object","properties":{"txHash":{"type":"string","description":"待添加的 txHash。"},"chainId":{"type":"integer","description":"链 ID。关于所有支持的链及对应 chain ID，请查看：[https://docs.compliance.phalcon.blocksec.com/api-documentation/introduction/supported-chains](https://docs.compliance.phalcon.blocksec.com/api-documentation/introduction/supported-chains)。"},"toAddress":{"type":"string","description":"转账地址。"},"transferIndex":{"type":"integer","description":"交易索引。"},"status":{"type":"integer"}}}}},"paths":{"/customers/{customer_id}/transactions":{"post":{"tags":["Customer"],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"},"description":"你系统中的客户 ID。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"transactions":{"type":"array","maxItems":50,"description":"待添加交易列表。每次请求最多 50 条。","items":{"$ref":"#/components/schemas/CustomerAddTransaction"}}}}}}},"responses":{"200":{"description":"响应。即使 HTTP 状态码为 200，`code` 非 0 也表示业务错误。","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","description":"该请求的状态码。关于所有可能出现的 code 和 message，请查看：[https://docs.compliance.phalcon.blocksec.com/api-documentation/introduction/error-messages](https://docs.compliance.phalcon.blocksec.com/api-documentation/introduction/error-messages)。"},"msg":{"type":"string","description":"该请求的 message。关于所有可能出现的 code 和 message，请查看：[https://docs.compliance.phalcon.blocksec.com/api-documentation/introduction/error-messages](https://docs.compliance.phalcon.blocksec.com/api-documentation/introduction/error-messages)。"},"data":{"type":"object","properties":{"customerId":{"type":"string","description":"客户 ID。"},"transactionCount":{"type":"integer","description":"该客户当前关联的交易总数（累计值，非本次新增数量）。"},"addedTransactions":{"type":"array","description":"添加成功的交易列表。","items":{"$ref":"#/components/schemas/CustomerAddTransaction"}},"failed":{"type":"array","description":"添加失败的交易列表。","items":{"$ref":"#/components/schemas/CustomerAddTransactionResult"}}}}}}}}},"401":{"description":"鉴权失败。`API-Key` 请求头缺失或无效。"},"429":{"description":"超出调用频率限制。请降低请求频率后重试。"}},"description":"将已导入交易批量绑定到客户。","summary":"将多笔交易批量绑定到客户"}}}}
```
