🔌 Dokumentasi API Impor
Setiap modul menyediakan endpoint impor REST: POST /api/import/{module}, menerima unggahan body CSV / Excel / JSON. Semua impor API tetap melewati alur validasi → pratinjau → persetujuan Human-Gate → masuk database; tidak pernah menulis langsung tanpa persetujuan.
⚠️ Catatan: impor API adalah operasi tulis berisiko tinggi — endpoint hanya membuat tugas validasi setelah menerima file; masuk database wajib disetujui Human-Gate.
👥 Pelanggan🖨️ Produk🧾 Pesanan💳 Pembayaran📦 Stok🏭 Pemasok🛒 Pembelian🛠️ Purna Jual📚 Basis Pengetahuan⚙️ Suku Cadang♻️ Daur Ulang🎨 Desain POD💬 Kontak Pesan☁️ File Cloud💰 Laporan Keuangan🗺️ Pelanggan Peta👷 Teknisi🏪 Merchant🚚 Logistik🧮 Pajak🔍 Audit🔐 Hak Akses📣 Pemasaran📊 Laporan📈 Dasbor🌐 Chat Ekosistem
🔐 API Key
Autentikasi: sertakan X-API-Key di header; kunci hanya diterbitkan untuk staf internal, pengirim selalu tercatat dan ditampilkan tersamar.
🔑 Ajukan kunci API di Pusat Developer →👥 Pelanggan (customers)
Tabel tujuan:
uc_scrm_customersEndpoint impor:
POST /api/import/customers
POST /api/import/customers
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
customer_name | text | Wajib |
wa_number | text | Wajib |
city | text | Opsional |
grade | text | Opsional |
source_channel | text | Opsional |
follow_state | text | Opsional |
consumable_cycle_days | integer | Opsional |
notes | text | Opsional |
Contoh 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
🖨️ Produk (products)
Tabel tujuan:
uc_productsEndpoint impor:
POST /api/import/products
POST /api/import/products
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
sku | text | Wajib |
product_name | text | Wajib |
category | text | Opsional |
print_method | text | Opsional |
material | text | Opsional |
unit | text | Opsional |
cost_idr | bigint | Opsional |
price_idr | bigint | Wajib |
stock_qty | integer | Opsional |
Contoh 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
🧾 Pesanan (orders)
Tabel tujuan:
uc_sales_ordersEndpoint impor:
POST /api/import/orders
POST /api/import/orders
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
order_no | text | Wajib |
customer_id | text | Wajib |
sku | text | Wajib |
qty | integer | Wajib |
amount_idr | bigint | Wajib |
order_date | date | Wajib |
status | text | Opsional |
payment_method | text | Opsional |
Contoh 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
💳 Pembayaran (payments)
Tabel tujuan:
uc_paymentsEndpoint impor:
POST /api/import/payments
POST /api/import/payments
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
payment_no | text | Wajib |
order_no | text | Wajib |
amount_idr | bigint | Wajib |
paid_at | timestamptz | Wajib |
method | text | Opsional |
bank_ref | text | Opsional |
status | text | Opsional |
verified_by | text | Opsional |
Contoh 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
📦 Stok (inventory)
Tabel tujuan:
uc_inventoryEndpoint impor:
POST /api/import/inventory
POST /api/import/inventory
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
sku | text | Wajib |
warehouse | text | Wajib |
qty_on_hand | integer | Wajib |
qty_reserved | integer | Opsional |
safety_stock | integer | Opsional |
unit | text | Opsional |
last_counted_at | timestamptz | Opsional |
Contoh 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
🏭 Pemasok (suppliers)
Tabel tujuan:
uc_suppliersEndpoint impor:
POST /api/import/suppliers
POST /api/import/suppliers
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
supplier_name | text | Wajib |
contact_person | text | Opsional |
phone | text | Opsional |
city | text | Opsional |
country | text | Opsional |
materials | text | Opsional |
lead_time_days | integer | Opsional |
rating | numeric | Opsional |
Contoh 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
🛒 Pembelian (purchase)
Tabel tujuan:
uc_purchase_ordersEndpoint impor:
POST /api/import/purchase
POST /api/import/purchase
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
po_no | text | Wajib |
supplier_id | text | Wajib |
sku | text | Wajib |
qty | integer | Wajib |
unit_cost_idr | bigint | Wajib |
expected_at | date | Opsional |
status | text | Opsional |
remark | text | Opsional |
Contoh 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
🛠️ Purna Jual (aftersales)
Tabel tujuan:
uc_aftersales_ticketsEndpoint impor:
POST /api/import/aftersales
POST /api/import/aftersales
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
ticket_no | text | Wajib |
customer_id | text | Wajib |
machine_model | text | Opsional |
issue_type | text | Wajib |
severity | text | Opsional |
status | text | Opsional |
technician | text | Opsional |
created_at | timestamptz | Opsional |
Contoh 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
📚 Basis Pengetahuan (knowledge)
Tabel tujuan:
uc_knowledgeEndpoint impor:
POST /api/import/knowledge
POST /api/import/knowledge
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
doc_no | text | Wajib |
title | text | Wajib |
category | text | Opsional |
lang | text | Opsional |
tags | text | Opsional |
content_summary | text | Opsional |
updated_at | timestamptz | Opsional |
views | integer | Opsional |
Contoh 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
⚙️ Suku Cadang (parts)
Tabel tujuan:
uc_partsEndpoint impor:
POST /api/import/parts
POST /api/import/parts
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
part_no | text | Wajib |
part_name | text | Wajib |
machine_model | text | Opsional |
unit | text | Opsional |
cost_idr | bigint | Opsional |
price_idr | bigint | Wajib |
stock_qty | integer | Opsional |
supplier_id | text | Opsional |
Contoh 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
♻️ Daur Ulang (recycle)
Tabel tujuan:
uc_recycle_ordersEndpoint impor:
POST /api/import/recycle
POST /api/import/recycle
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
recycle_no | text | Wajib |
customer_id | text | Wajib |
machine_model | text | Opsional |
condition_grade | text | Opsional |
estimated_price_idr | bigint | Opsional |
status | text | Opsional |
received_at | timestamptz | Opsional |
Contoh 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
🎨 Desain POD (pod_design)
Tabel tujuan:
uc_pod_designsEndpoint impor:
POST /api/import/pod_design
POST /api/import/pod_design
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
design_no | text | Wajib |
title | text | Wajib |
category | text | Opsional |
style_tags | text | Opsional |
source_file | text | Wajib |
preview_file | text | Opsional |
status | text | Opsional |
created_by | text | Opsional |
Contoh 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
💬 Kontak Pesan (msg_contacts)
Tabel tujuan:
uc_msg_contactsEndpoint impor:
POST /api/import/msg_contacts
POST /api/import/msg_contacts
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
contact_name | text | Wajib |
channel | text | Wajib |
channel_id | text | Wajib |
phone | text | Opsional |
city | text | Opsional |
tags | text | Opsional |
last_msg_at | timestamptz | Opsional |
opt_in | boolean | Opsional |
Contoh 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
☁️ File Cloud (cloud_files)
Tabel tujuan:
uc_cloud_filesEndpoint impor:
POST /api/import/cloud_files
POST /api/import/cloud_files
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
file_id | text | Wajib |
category | text | Wajib |
file_type | text | Wajib |
name | text | Wajib |
size_bytes | bigint | Opsional |
format | text | Opsional |
updated_at | timestamptz | Opsional |
Contoh 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
💰 Laporan Keuangan (finance_report)
Tabel tujuan:
uc_finance_reportsEndpoint impor:
POST /api/import/finance_report
POST /api/import/finance_report
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
report_no | text | Wajib |
report_type | text | Wajib |
period | text | Wajib |
revenue_idr | bigint | Wajib |
cost_idr | bigint | Wajib |
profit_idr | bigint | Opsional |
generated_at | timestamptz | Opsional |
status | text | Opsional |
Contoh 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
🗺️ Pelanggan Peta (map_customers)
Tabel tujuan:
uc_gmap_customersEndpoint impor:
POST /api/import/map_customers
POST /api/import/map_customers
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
place_name | text | Wajib |
keyword | text | Opsional |
city | text | Opsional |
phone | text | Opsional |
address | text | Opsional |
rating | numeric | Opsional |
batch_id | text | Wajib |
imported_at | timestamptz | Opsional |
Contoh 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
👷 Teknisi (technicians)
Tabel tujuan:
uc_techniciansEndpoint impor:
POST /api/import/technicians
POST /api/import/technicians
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
tech_name | text | Wajib |
phone | text | Wajib |
city | text | Opsional |
skills | text | Opsional |
level | text | Opsional |
jobs_done | integer | Opsional |
rating | numeric | Opsional |
active | boolean | Opsional |
Contoh 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
🏪 Merchant (merchants)
Tabel tujuan:
uc_merchantsEndpoint impor:
POST /api/import/merchants
POST /api/import/merchants
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
merchant_name | text | Wajib |
owner_name | text | Opsional |
phone | text | Opsional |
city | text | Opsional |
category | text | Opsional |
grade | text | Opsional |
joined_at | date | Opsional |
status | text | Opsional |
Contoh 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
🚚 Logistik (logistics)
Tabel tujuan:
uc_logistics_shipmentsEndpoint impor:
POST /api/import/logistics
POST /api/import/logistics
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
tracking_no | text | Wajib |
order_no | text | Wajib |
courier | text | Wajib |
service | text | Opsional |
weight_kg | numeric | Opsional |
cost_idr | bigint | Opsional |
status | text | Opsional |
shipped_at | timestamptz | Opsional |
Contoh 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
🧮 Pajak (tax)
Tabel tujuan:
uc_tax_documentsEndpoint impor:
POST /api/import/tax
POST /api/import/tax
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
tax_no | text | Wajib |
doc_type | text | Wajib |
period | text | Wajib |
npwp | text | Opsional |
amount_idr | bigint | Wajib |
tax_idr | bigint | Wajib |
status | text | Opsional |
filed_at | timestamptz | Opsional |
Contoh 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 (audit)
Tabel tujuan:
uc_audit_logsEndpoint impor:
POST /api/import/audit
POST /api/import/audit
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
log_id | text | Wajib |
actor | text | Wajib |
action | text | Wajib |
module | text | Wajib |
target_id | text | Opsional |
result | text | Opsional |
ip_masked | text | Opsional |
created_at | timestamptz | Opsional |
Contoh 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
🔐 Hak Akses (rbac)
Tabel tujuan:
uc_rbac_rolesEndpoint impor:
POST /api/import/rbac
POST /api/import/rbac
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
role_key | text | Wajib |
role_name | text | Wajib |
scope | text | Wajib |
permissions | text | Wajib |
members | integer | Opsional |
active | boolean | Opsional |
updated_at | timestamptz | Opsional |
Contoh 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
📣 Pemasaran (marketing)
Tabel tujuan:
uc_marketing_campaignsEndpoint impor:
POST /api/import/marketing
POST /api/import/marketing
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
campaign_no | text | Wajib |
name | text | Wajib |
channel | text | Wajib |
audience | text | Opsional |
budget_idr | bigint | Opsional |
status | text | Opsional |
start_at | date | Opsional |
end_at | date | Opsional |
Contoh 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
📊 Laporan (reports)
Tabel tujuan:
uc_biz_reportsEndpoint impor:
POST /api/import/reports
POST /api/import/reports
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
report_no | text | Wajib |
name | text | Wajib |
module | text | Wajib |
period | text | Wajib |
generated_by | text | Opsional |
generated_at | timestamptz | Opsional |
format | text | Opsional |
status | text | Opsional |
Contoh 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
📈 Dasbor (dashboard)
Tabel tujuan:
uc_dashboard_widgetsEndpoint impor:
POST /api/import/dashboard
POST /api/import/dashboard
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
widget_no | text | Wajib |
name | text | Wajib |
module | text | Wajib |
chart_type | text | Opsional |
metric | text | Wajib |
refresh_sec | integer | Opsional |
active | boolean | Opsional |
updated_at | timestamptz | Opsional |
Contoh 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
🌐 Chat Ekosistem (eco_chat)
Tabel tujuan:
uc_eco_chat_threadsEndpoint impor:
POST /api/import/eco_chat
POST /api/import/eco_chat
Skema kolom:
| Kolom | Tipe | Wajib? |
|---|---|---|
thread_no | text | Wajib |
participant_type | text | Wajib |
participant_name | text | Wajib |
subject | text | Opsional |
msg_count | integer | Opsional |
last_msg_at | timestamptz | Opsional |
status | text | Opsional |
Contoh 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