🔌 API 导入文档
每个模块都提供 REST 导入端点:POST /api/import/{module},支持 CSV / Excel / JSON 正文上传。所有 API 导入同样走 校验 → 预览 → Human-Gate 批准 → 入库 流程,绝不绕过审批直接写库。
⚠️ 注意:API 导入属高风险写操作,端点收到文件后仅创建校验任务,入库必须经 Human-Gate 批准。
👥 客户🖨️ 产品🧾 订单💳 付款📦 库存🏭 供应商🛒 采购🛠️ 售后📚 知识库⚙️ 配件♻️ 回收🎨 POD 设计💬 消息联系人☁️ 云盘文件💰 财务报表🗺️ 地图客户👷 技术员🏪 商户🚚 物流🧮 税务🔍 审计🔐 权限📣 营销📊 报表📈 仪表🌐 生态聊天
👥 客户 (customers)
目标表:
uc_scrm_customers导入端点:
POST /api/import/customers
POST /api/import/customers
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
customer_name | text | 必填 |
wa_number | text | 必填 |
city | text | 可选 |
grade | text | 可选 |
source_channel | text | 可选 |
follow_state | text | 可选 |
consumable_cycle_days | integer | 可选 |
notes | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/customers \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @customers.csv
🖨️ 产品 (products)
目标表:
uc_products导入端点:
POST /api/import/products
POST /api/import/products
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
sku | text | 必填 |
product_name | text | 必填 |
category | text | 可选 |
print_method | text | 可选 |
material | text | 可选 |
unit | text | 可选 |
cost_idr | bigint | 可选 |
price_idr | bigint | 必填 |
stock_qty | integer | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/products \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @products.csv
🧾 订单 (orders)
目标表:
uc_sales_orders导入端点:
POST /api/import/orders
POST /api/import/orders
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
order_no | text | 必填 |
customer_id | text | 必填 |
sku | text | 必填 |
qty | integer | 必填 |
amount_idr | bigint | 必填 |
order_date | date | 必填 |
status | text | 可选 |
payment_method | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/orders \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @orders.csv
💳 付款 (payments)
目标表:
uc_payments导入端点:
POST /api/import/payments
POST /api/import/payments
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
payment_no | text | 必填 |
order_no | text | 必填 |
amount_idr | bigint | 必填 |
paid_at | timestamptz | 必填 |
method | text | 可选 |
bank_ref | text | 可选 |
status | text | 可选 |
verified_by | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/payments \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @payments.csv
📦 库存 (inventory)
目标表:
uc_inventory导入端点:
POST /api/import/inventory
POST /api/import/inventory
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
sku | text | 必填 |
warehouse | text | 必填 |
qty_on_hand | integer | 必填 |
qty_reserved | integer | 可选 |
safety_stock | integer | 可选 |
unit | text | 可选 |
last_counted_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/inventory \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @inventory.csv
🏭 供应商 (suppliers)
目标表:
uc_suppliers导入端点:
POST /api/import/suppliers
POST /api/import/suppliers
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
supplier_name | text | 必填 |
contact_person | text | 可选 |
phone | text | 可选 |
city | text | 可选 |
country | text | 可选 |
materials | text | 可选 |
lead_time_days | integer | 可选 |
rating | numeric | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/suppliers \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @suppliers.csv
🛒 采购 (purchase)
目标表:
uc_purchase_orders导入端点:
POST /api/import/purchase
POST /api/import/purchase
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
po_no | text | 必填 |
supplier_id | text | 必填 |
sku | text | 必填 |
qty | integer | 必填 |
unit_cost_idr | bigint | 必填 |
expected_at | date | 可选 |
status | text | 可选 |
remark | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/purchase \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @purchase.csv
🛠️ 售后 (aftersales)
目标表:
uc_aftersales_tickets导入端点:
POST /api/import/aftersales
POST /api/import/aftersales
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
ticket_no | text | 必填 |
customer_id | text | 必填 |
machine_model | text | 可选 |
issue_type | text | 必填 |
severity | text | 可选 |
status | text | 可选 |
technician | text | 可选 |
created_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/aftersales \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @aftersales.csv
📚 知识库 (knowledge)
目标表:
uc_knowledge导入端点:
POST /api/import/knowledge
POST /api/import/knowledge
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
doc_no | text | 必填 |
title | text | 必填 |
category | text | 可选 |
lang | text | 可选 |
tags | text | 可选 |
content_summary | text | 可选 |
updated_at | timestamptz | 可选 |
views | integer | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/knowledge \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @knowledge.csv
⚙️ 配件 (parts)
目标表:
uc_parts导入端点:
POST /api/import/parts
POST /api/import/parts
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
part_no | text | 必填 |
part_name | text | 必填 |
machine_model | text | 可选 |
unit | text | 可选 |
cost_idr | bigint | 可选 |
price_idr | bigint | 必填 |
stock_qty | integer | 可选 |
supplier_id | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/parts \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @parts.csv
♻️ 回收 (recycle)
目标表:
uc_recycle_orders导入端点:
POST /api/import/recycle
POST /api/import/recycle
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
recycle_no | text | 必填 |
customer_id | text | 必填 |
machine_model | text | 可选 |
condition_grade | text | 可选 |
estimated_price_idr | bigint | 可选 |
status | text | 可选 |
received_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/recycle \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @recycle.csv
🎨 POD 设计 (pod_design)
目标表:
uc_pod_designs导入端点:
POST /api/import/pod_design
POST /api/import/pod_design
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
design_no | text | 必填 |
title | text | 必填 |
category | text | 可选 |
style_tags | text | 可选 |
source_file | text | 必填 |
preview_file | text | 可选 |
status | text | 可选 |
created_by | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/pod_design \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @pod_design.csv
💬 消息联系人 (msg_contacts)
目标表:
uc_msg_contacts导入端点:
POST /api/import/msg_contacts
POST /api/import/msg_contacts
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
contact_name | text | 必填 |
channel | text | 必填 |
channel_id | text | 必填 |
phone | text | 可选 |
city | text | 可选 |
tags | text | 可选 |
last_msg_at | timestamptz | 可选 |
opt_in | boolean | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/msg_contacts \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @msg_contacts.csv
☁️ 云盘文件 (cloud_files)
目标表:
uc_cloud_files导入端点:
POST /api/import/cloud_files
POST /api/import/cloud_files
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
file_id | text | 必填 |
category | text | 必填 |
file_type | text | 必填 |
name | text | 必填 |
size_bytes | bigint | 可选 |
format | text | 可选 |
updated_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/cloud_files \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @cloud_files.csv
💰 财务报表 (finance_report)
目标表:
uc_finance_reports导入端点:
POST /api/import/finance_report
POST /api/import/finance_report
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
report_no | text | 必填 |
report_type | text | 必填 |
period | text | 必填 |
revenue_idr | bigint | 必填 |
cost_idr | bigint | 必填 |
profit_idr | bigint | 可选 |
generated_at | timestamptz | 可选 |
status | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/finance_report \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @finance_report.csv
🗺️ 地图客户 (map_customers)
目标表:
uc_gmap_customers导入端点:
POST /api/import/map_customers
POST /api/import/map_customers
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
place_name | text | 必填 |
keyword | text | 可选 |
city | text | 可选 |
phone | text | 可选 |
address | text | 可选 |
rating | numeric | 可选 |
batch_id | text | 必填 |
imported_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/map_customers \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @map_customers.csv
👷 技术员 (technicians)
目标表:
uc_technicians导入端点:
POST /api/import/technicians
POST /api/import/technicians
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
tech_name | text | 必填 |
phone | text | 必填 |
city | text | 可选 |
skills | text | 可选 |
level | text | 可选 |
jobs_done | integer | 可选 |
rating | numeric | 可选 |
active | boolean | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/technicians \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @technicians.csv
🏪 商户 (merchants)
目标表:
uc_merchants导入端点:
POST /api/import/merchants
POST /api/import/merchants
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
merchant_name | text | 必填 |
owner_name | text | 可选 |
phone | text | 可选 |
city | text | 可选 |
category | text | 可选 |
grade | text | 可选 |
joined_at | date | 可选 |
status | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/merchants \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @merchants.csv
🚚 物流 (logistics)
目标表:
uc_logistics_shipments导入端点:
POST /api/import/logistics
POST /api/import/logistics
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
tracking_no | text | 必填 |
order_no | text | 必填 |
courier | text | 必填 |
service | text | 可选 |
weight_kg | numeric | 可选 |
cost_idr | bigint | 可选 |
status | text | 可选 |
shipped_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/logistics \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @logistics.csv
🧮 税务 (tax)
目标表:
uc_tax_documents导入端点:
POST /api/import/tax
POST /api/import/tax
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
tax_no | text | 必填 |
doc_type | text | 必填 |
period | text | 必填 |
npwp | text | 可选 |
amount_idr | bigint | 必填 |
tax_idr | bigint | 必填 |
status | text | 可选 |
filed_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/tax \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @tax.csv
🔍 审计 (audit)
目标表:
uc_audit_logs导入端点:
POST /api/import/audit
POST /api/import/audit
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
log_id | text | 必填 |
actor | text | 必填 |
action | text | 必填 |
module | text | 必填 |
target_id | text | 可选 |
result | text | 可选 |
ip_masked | text | 可选 |
created_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/audit \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @audit.csv
🔐 权限 (rbac)
目标表:
uc_rbac_roles导入端点:
POST /api/import/rbac
POST /api/import/rbac
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
role_key | text | 必填 |
role_name | text | 必填 |
scope | text | 必填 |
permissions | text | 必填 |
members | integer | 可选 |
active | boolean | 可选 |
updated_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/rbac \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @rbac.csv
📣 营销 (marketing)
目标表:
uc_marketing_campaigns导入端点:
POST /api/import/marketing
POST /api/import/marketing
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
campaign_no | text | 必填 |
name | text | 必填 |
channel | text | 必填 |
audience | text | 可选 |
budget_idr | bigint | 可选 |
status | text | 可选 |
start_at | date | 可选 |
end_at | date | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/marketing \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @marketing.csv
📊 报表 (reports)
目标表:
uc_biz_reports导入端点:
POST /api/import/reports
POST /api/import/reports
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
report_no | text | 必填 |
name | text | 必填 |
module | text | 必填 |
period | text | 必填 |
generated_by | text | 可选 |
generated_at | timestamptz | 可选 |
format | text | 可选 |
status | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/reports \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @reports.csv
📈 仪表 (dashboard)
目标表:
uc_dashboard_widgets导入端点:
POST /api/import/dashboard
POST /api/import/dashboard
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
widget_no | text | 必填 |
name | text | 必填 |
module | text | 必填 |
chart_type | text | 可选 |
metric | text | 必填 |
refresh_sec | integer | 可选 |
active | boolean | 可选 |
updated_at | timestamptz | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/dashboard \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @dashboard.csv
🌐 生态聊天 (eco_chat)
目标表:
uc_eco_chat_threads导入端点:
POST /api/import/eco_chat
POST /api/import/eco_chat
字段 schema:
| 字段 | 类型 | 是否必填 |
|---|---|---|
thread_no | text | 必填 |
participant_type | text | 必填 |
participant_name | text | 必填 |
subject | text | 可选 |
msg_count | integer | 可选 |
last_msg_at | timestamptz | 可选 |
status | text | 可选 |
curl 示例:
curl -X POST https://ai.aifengdcs.com/api/import/eco_chat \ -H "X-API-Key: <your-key>" \ -H "Content-Type: text/csv" \ --data-binary @eco_chat.csv