🔌 Import API Documentation
Every module exposes a REST import endpoint: POST /api/import/{module}, accepting CSV / Excel / JSON payloads. All API imports follow the same validate → preview → Human-Gate approval → commit pipeline; nothing is ever written without approval.
⚠️ Note: API import is a high-risk write operation — the endpoint only creates a validation job after receiving a file; committing requires Human-Gate approval.
👥 Customers🖨️ Products🧾 Orders💳 Payments📦 Inventory🏭 Suppliers🛒 Purchase🛠️ After-Sales📚 Knowledge Base⚙️ Parts♻️ Recycle🎨 POD Design💬 Message Contacts☁️ Cloud Files💰 Finance Reports🗺️ Map Customers👷 Technicians🏪 Merchants🚚 Logistics🧮 Tax🔍 Audit🔐 Permissions📣 Marketing📊 Reports📈 Dashboard🌐 Ecosystem Chat
🔐 API Key
Auth: send an X-API-Key header; keys are issued to internal staff only, and submitters are always logged and shown masked.
🔑 Apply for an API key in the Developer Center →👥 Customers (customers)
Target table:
uc_scrm_customersImport endpoint:
POST /api/import/customers
POST /api/import/customers
Field schema:
| Field | Type | Required |
|---|---|---|
customer_name | text | Required |
wa_number | text | Required |
city | text | Optional |
grade | text | Optional |
source_channel | text | Optional |
follow_state | text | Optional |
consumable_cycle_days | integer | Optional |
notes | text | Optional |
curl example:
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 (products)
Target table:
uc_productsImport endpoint:
POST /api/import/products
POST /api/import/products
Field schema:
| Field | Type | Required |
|---|---|---|
sku | text | Required |
product_name | text | Required |
category | text | Optional |
print_method | text | Optional |
material | text | Optional |
unit | text | Optional |
cost_idr | bigint | Optional |
price_idr | bigint | Required |
stock_qty | integer | Optional |
curl example:
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 (orders)
Target table:
uc_sales_ordersImport endpoint:
POST /api/import/orders
POST /api/import/orders
Field schema:
| Field | Type | Required |
|---|---|---|
order_no | text | Required |
customer_id | text | Required |
sku | text | Required |
qty | integer | Required |
amount_idr | bigint | Required |
order_date | date | Required |
status | text | Optional |
payment_method | text | Optional |
curl example:
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 (payments)
Target table:
uc_paymentsImport endpoint:
POST /api/import/payments
POST /api/import/payments
Field schema:
| Field | Type | Required |
|---|---|---|
payment_no | text | Required |
order_no | text | Required |
amount_idr | bigint | Required |
paid_at | timestamptz | Required |
method | text | Optional |
bank_ref | text | Optional |
status | text | Optional |
verified_by | text | Optional |
curl example:
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 (inventory)
Target table:
uc_inventoryImport endpoint:
POST /api/import/inventory
POST /api/import/inventory
Field schema:
| Field | Type | Required |
|---|---|---|
sku | text | Required |
warehouse | text | Required |
qty_on_hand | integer | Required |
qty_reserved | integer | Optional |
safety_stock | integer | Optional |
unit | text | Optional |
last_counted_at | timestamptz | Optional |
curl example:
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 (suppliers)
Target table:
uc_suppliersImport endpoint:
POST /api/import/suppliers
POST /api/import/suppliers
Field schema:
| Field | Type | Required |
|---|---|---|
supplier_name | text | Required |
contact_person | text | Optional |
phone | text | Optional |
city | text | Optional |
country | text | Optional |
materials | text | Optional |
lead_time_days | integer | Optional |
rating | numeric | Optional |
curl example:
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 (purchase)
Target table:
uc_purchase_ordersImport endpoint:
POST /api/import/purchase
POST /api/import/purchase
Field schema:
| Field | Type | Required |
|---|---|---|
po_no | text | Required |
supplier_id | text | Required |
sku | text | Required |
qty | integer | Required |
unit_cost_idr | bigint | Required |
expected_at | date | Optional |
status | text | Optional |
remark | text | Optional |
curl example:
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
🛠️ After-Sales (aftersales)
Target table:
uc_aftersales_ticketsImport endpoint:
POST /api/import/aftersales
POST /api/import/aftersales
Field schema:
| Field | Type | Required |
|---|---|---|
ticket_no | text | Required |
customer_id | text | Required |
machine_model | text | Optional |
issue_type | text | Required |
severity | text | Optional |
status | text | Optional |
technician | text | Optional |
created_at | timestamptz | Optional |
curl example:
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 Base (knowledge)
Target table:
uc_knowledgeImport endpoint:
POST /api/import/knowledge
POST /api/import/knowledge
Field schema:
| Field | Type | Required |
|---|---|---|
doc_no | text | Required |
title | text | Required |
category | text | Optional |
lang | text | Optional |
tags | text | Optional |
content_summary | text | Optional |
updated_at | timestamptz | Optional |
views | integer | Optional |
curl example:
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 (parts)
Target table:
uc_partsImport endpoint:
POST /api/import/parts
POST /api/import/parts
Field schema:
| Field | Type | Required |
|---|---|---|
part_no | text | Required |
part_name | text | Required |
machine_model | text | Optional |
unit | text | Optional |
cost_idr | bigint | Optional |
price_idr | bigint | Required |
stock_qty | integer | Optional |
supplier_id | text | Optional |
curl example:
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 (recycle)
Target table:
uc_recycle_ordersImport endpoint:
POST /api/import/recycle
POST /api/import/recycle
Field schema:
| Field | Type | Required |
|---|---|---|
recycle_no | text | Required |
customer_id | text | Required |
machine_model | text | Optional |
condition_grade | text | Optional |
estimated_price_idr | bigint | Optional |
status | text | Optional |
received_at | timestamptz | Optional |
curl example:
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 Design (pod_design)
Target table:
uc_pod_designsImport endpoint:
POST /api/import/pod_design
POST /api/import/pod_design
Field schema:
| Field | Type | Required |
|---|---|---|
design_no | text | Required |
title | text | Required |
category | text | Optional |
style_tags | text | Optional |
source_file | text | Required |
preview_file | text | Optional |
status | text | Optional |
created_by | text | Optional |
curl example:
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
💬 Message Contacts (msg_contacts)
Target table:
uc_msg_contactsImport endpoint:
POST /api/import/msg_contacts
POST /api/import/msg_contacts
Field schema:
| Field | Type | Required |
|---|---|---|
contact_name | text | Required |
channel | text | Required |
channel_id | text | Required |
phone | text | Optional |
city | text | Optional |
tags | text | Optional |
last_msg_at | timestamptz | Optional |
opt_in | boolean | Optional |
curl example:
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 (cloud_files)
Target table:
uc_cloud_filesImport endpoint:
POST /api/import/cloud_files
POST /api/import/cloud_files
Field schema:
| Field | Type | Required |
|---|---|---|
file_id | text | Required |
category | text | Required |
file_type | text | Required |
name | text | Required |
size_bytes | bigint | Optional |
format | text | Optional |
updated_at | timestamptz | Optional |
curl example:
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 Reports (finance_report)
Target table:
uc_finance_reportsImport endpoint:
POST /api/import/finance_report
POST /api/import/finance_report
Field schema:
| Field | Type | Required |
|---|---|---|
report_no | text | Required |
report_type | text | Required |
period | text | Required |
revenue_idr | bigint | Required |
cost_idr | bigint | Required |
profit_idr | bigint | Optional |
generated_at | timestamptz | Optional |
status | text | Optional |
curl example:
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 (map_customers)
Target table:
uc_gmap_customersImport endpoint:
POST /api/import/map_customers
POST /api/import/map_customers
Field schema:
| Field | Type | Required |
|---|---|---|
place_name | text | Required |
keyword | text | Optional |
city | text | Optional |
phone | text | Optional |
address | text | Optional |
rating | numeric | Optional |
batch_id | text | Required |
imported_at | timestamptz | Optional |
curl example:
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 (technicians)
Target table:
uc_techniciansImport endpoint:
POST /api/import/technicians
POST /api/import/technicians
Field schema:
| Field | Type | Required |
|---|---|---|
tech_name | text | Required |
phone | text | Required |
city | text | Optional |
skills | text | Optional |
level | text | Optional |
jobs_done | integer | Optional |
rating | numeric | Optional |
active | boolean | Optional |
curl example:
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 (merchants)
Target table:
uc_merchantsImport endpoint:
POST /api/import/merchants
POST /api/import/merchants
Field schema:
| Field | Type | Required |
|---|---|---|
merchant_name | text | Required |
owner_name | text | Optional |
phone | text | Optional |
city | text | Optional |
category | text | Optional |
grade | text | Optional |
joined_at | date | Optional |
status | text | Optional |
curl example:
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 (logistics)
Target table:
uc_logistics_shipmentsImport endpoint:
POST /api/import/logistics
POST /api/import/logistics
Field schema:
| Field | Type | Required |
|---|---|---|
tracking_no | text | Required |
order_no | text | Required |
courier | text | Required |
service | text | Optional |
weight_kg | numeric | Optional |
cost_idr | bigint | Optional |
status | text | Optional |
shipped_at | timestamptz | Optional |
curl example:
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 (tax)
Target table:
uc_tax_documentsImport endpoint:
POST /api/import/tax
POST /api/import/tax
Field schema:
| Field | Type | Required |
|---|---|---|
tax_no | text | Required |
doc_type | text | Required |
period | text | Required |
npwp | text | Optional |
amount_idr | bigint | Required |
tax_idr | bigint | Required |
status | text | Optional |
filed_at | timestamptz | Optional |
curl example:
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 (audit)
Target table:
uc_audit_logsImport endpoint:
POST /api/import/audit
POST /api/import/audit
Field schema:
| Field | Type | Required |
|---|---|---|
log_id | text | Required |
actor | text | Required |
action | text | Required |
module | text | Required |
target_id | text | Optional |
result | text | Optional |
ip_masked | text | Optional |
created_at | timestamptz | Optional |
curl example:
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
🔐 Permissions (rbac)
Target table:
uc_rbac_rolesImport endpoint:
POST /api/import/rbac
POST /api/import/rbac
Field schema:
| Field | Type | Required |
|---|---|---|
role_key | text | Required |
role_name | text | Required |
scope | text | Required |
permissions | text | Required |
members | integer | Optional |
active | boolean | Optional |
updated_at | timestamptz | Optional |
curl example:
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 (marketing)
Target table:
uc_marketing_campaignsImport endpoint:
POST /api/import/marketing
POST /api/import/marketing
Field schema:
| Field | Type | Required |
|---|---|---|
campaign_no | text | Required |
name | text | Required |
channel | text | Required |
audience | text | Optional |
budget_idr | bigint | Optional |
status | text | Optional |
start_at | date | Optional |
end_at | date | Optional |
curl example:
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 (reports)
Target table:
uc_biz_reportsImport endpoint:
POST /api/import/reports
POST /api/import/reports
Field schema:
| Field | Type | Required |
|---|---|---|
report_no | text | Required |
name | text | Required |
module | text | Required |
period | text | Required |
generated_by | text | Optional |
generated_at | timestamptz | Optional |
format | text | Optional |
status | text | Optional |
curl example:
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 (dashboard)
Target table:
uc_dashboard_widgetsImport endpoint:
POST /api/import/dashboard
POST /api/import/dashboard
Field schema:
| Field | Type | Required |
|---|---|---|
widget_no | text | Required |
name | text | Required |
module | text | Required |
chart_type | text | Optional |
metric | text | Required |
refresh_sec | integer | Optional |
active | boolean | Optional |
updated_at | timestamptz | Optional |
curl example:
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
🌐 Ecosystem Chat (eco_chat)
Target table:
uc_eco_chat_threadsImport endpoint:
POST /api/import/eco_chat
POST /api/import/eco_chat
Field schema:
| Field | Type | Required |
|---|---|---|
thread_no | text | Required |
participant_type | text | Required |
participant_name | text | Required |
subject | text | Optional |
msg_count | integer | Optional |
last_msg_at | timestamptz | Optional |
status | text | Optional |
curl example:
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