# 🛒 Tutorial Lengkap Koneksi Marketplace API — Bahasa Indonesia

**Update:** 2026-05-23 · **Untuk:** Adzkia35 Multi-Account AI Agent Dashboard

Tutorial step-by-step buka API marketplace Indonesia untuk integrate ke sistem AI agent. Tujuannya supaya AI bisa auto-listing produk, sync stok, ambil order, dan auto-balas chat dari buyer.

---

## 📊 Ringkasan Marketplace (Indonesia)

| Marketplace | Difficulty | Approval | KYC Required | Saran |
|---|---|---|---|---|
| **Shopee Open Platform** | Sedang | 3-7 hari | KTP + Rekening | ⭐ Mulai dari sini (market terbesar) |
| **Tokopedia Mitra API** | Mudah | 1-3 hari | KTP + NPWP | ⭐ Kedua, ekosistem lengkap |
| **TikTok Shop Partner** | Mudah | 1-5 hari | KTP + Shop verified | ⭐ Wajib kalau ada konten TikTok |
| **Lazada Open Platform** | Sedang | 3-5 hari | KTP/SIUP | Skip kalau belum ada PT |
| **Blibli Seller API** | Sulit | 7-14 hari | SIUP wajib | Skip dulu (B2B focus) |
| **Bukalapak Mitra** | Mudah | 2-5 hari | KTP | Optional (market share turun) |

**Saran urutan:** Shopee → Tokopedia → TikTok Shop → Lazada (kalau sudah PT).

---

## 1️⃣ Shopee Open Platform

**URL:** https://open.shopee.com/  
**Dokumentasi:** https://open.shopee.com/documents

### Prasyarat
- Akun Shopee Seller aktif (Mall/Star/regular semua bisa)
- KTP + foto selfie pegang KTP
- Rekening bank atas nama yang sama dengan KTP
- Email bisnis

### Langkah Daftar

**Step 1 — Buat Seller Account dulu**
1. Buka https://seller.shopee.co.id/
2. Daftar pakai email bisnis
3. Lengkapi profil toko (nama toko, logo, alamat warehouse)
4. Upload KTP + selfie KTP
5. Verifikasi rekening bank (transfer Rp 1 dari Shopee, confirm nominal)
6. Tunggu approval 1-3 hari

**Step 2 — Daftar Open Platform Developer**
1. Buka https://open.shopee.com/
2. Klik **"Become a Developer"** kanan atas
3. Login pakai akun Shopee Seller yang sudah aktif
4. Pilih **"Shop Partner"** (untuk seller sendiri) — bukan "Service Provider"
5. Isi form:
   - **Company Name:** Adzkia35 (atau nama bisnis Anda)
   - **Country:** Indonesia
   - **Business Type:** E-commerce Seller
   - **Use Case:** "AI-powered automation for inventory sync, order management, and customer service via integrated dashboard"
6. Submit + tunggu email approval 3-7 hari

**Step 3 — Buat Aplikasi**
1. Setelah di-approve, login ke https://open.shopee.com/
2. **"App Console"** → **"Create App"**
3. Pilih **"Shop"** type (bukan "Service")
4. Isi:
   - **App Name:** Adzkia35 AI Agent
   - **Region:** ID (Indonesia)
   - **Redirect URL:** `https://yourdomain.com/api/marketplace/shopee/oauth/callback`
   - **Scopes:** centang semua (order, item, logistics, payment, shop)
5. **Submit**

**Step 4 — Ambil Credentials**
Setelah app dibuat, dapat:
```
Partner ID: 12345678 (8 digit)
Partner Key: long-alphanumeric-string (32-64 char)
```

**Step 5 — Authorize Shop**
1. Generate authorization URL:
   ```
   https://partner.shopeemobile.com/api/v2/shop/auth_partner?partner_id={PARTNER_ID}&timestamp={UNIX_TS}&sign={HMAC_SHA256}&redirect={REDIRECT_URL}
   ```
2. User klik link → login Shopee → authorize → dapat `code` + `shop_id`
3. Exchange code → access_token (valid 4 jam, refresh_token valid 30 hari)

**Step 6 — Save ke Dashboard**
- Buka tab "Social Connect Hub" → "Shopee"
- Paste: Partner ID, Partner Key, Shop ID, Access Token, Refresh Token
- Click "Save & Test"

### Endpoint Yang Bisa Dipakai
- `GET /api/v2/product/get_item_list` — list semua produk
- `POST /api/v2/product/add_item` — listing produk baru
- `GET /api/v2/order/get_order_list` — list order masuk
- `POST /api/v2/order/ship_order` — proses pengiriman
- `GET /api/v2/payment/get_escrow_detail` — cek saldo

### Cost
- ✅ API gratis selamanya
- ⚠️ Commission seller: 1-5% per sale (sudah ada tanpa API)

---

## 2️⃣ Tokopedia Mitra API

**URL:** https://developer.tokopedia.com/  
**Dokumentasi:** https://developer.tokopedia.com/openapi/guide/

### Prasyarat
- Akun Tokopedia Seller "Power Merchant" atau "Official Store" (regular seller belum bisa)
- KTP + NPWP (kalau Power Merchant Pro+)
- Toko aktif minimal 3 bulan dengan minimum sales

### Langkah Daftar

**Step 1 — Upgrade ke Power Merchant**
1. Login https://seller.tokopedia.com/
2. **"Power Merchant"** → daftar
3. Syarat: rating ≥4.5, complete order rate ≥95%, response chat <12 jam
4. Bayar Rp 99.000-299.000/bulan (tergantung tier)
5. Approval otomatis kalau eligible

**Step 2 — Apply Mitra Tokopedia (Developer Access)**
1. Buka https://developer.tokopedia.com/
2. Klik **"Register as Partner"**
3. Pilih **"Seller Integration"** (bukan affiliate)
4. Isi form lengkap:
   - **Company:** Adzkia35
   - **NPWP:** 12.345.678.9-012.000 (kalau ada)
   - **Use Case:** "AI agent for multi-account inventory sync and automated order processing"
   - **Expected Daily API Calls:** 1000-5000
5. Submit + tunggu email 1-3 hari

**Step 3 — Buat App di Developer Console**
1. Login developer.tokopedia.com setelah di-approve
2. **"My Apps"** → **"Create New App"**
3. Isi:
   - **App Name:** Adzkia35 AI
   - **Redirect URI:** `https://yourdomain.com/api/marketplace/tokopedia/oauth/callback`
   - **Scopes:** product, order, logistic, finance, shop
4. Submit

**Step 4 — Ambil Credentials**
```
Client ID: tkpd-xxxxxxxxxxxxx
Client Secret: secret-xxxxxxxxxxxxxxxxxxxxxxxxx
FS ID (Fulfillment Service ID): 12345 (otomatis assign)
```

**Step 5 — OAuth Flow**
1. Authorize URL:
   ```
   https://accounts.tokopedia.com/authorize.pl?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&scope=product,order
   ```
2. Exchange code → access_token (valid 24 jam)
3. Refresh token untuk renew

**Step 6 — Save ke Dashboard**
Paste Client ID, Client Secret, FS ID, Access Token ke tab Tokopedia.

### Endpoint Penting
- `GET /v1/products/fs/{fs_id}/product` — list produk
- `POST /v3/products/fs/{fs_id}/upload` — upload produk baru
- `GET /v2/order/list` — order list
- `POST /v1/order/{order_id}/fs/{fs_id}/ack` — ack order

### Cost
- ✅ API gratis
- ⚠️ Power Merchant subscription: Rp 99rb-299rb/bulan (terpisah dari API)
- Commission: 1-3% per sale

---

## 3️⃣ TikTok Shop Partner Center

**URL:** https://partner.tiktokshop.com/  
**Dokumentasi:** https://partner.tiktokshop.com/docv2/

### Prasyarat
- TikTok Shop Seller account (toko di TikTok Shop aktif)
- KTP + foto KTP
- Toko verified (minimum 5 produk listed)

### Langkah Daftar

**Step 1 — Setup TikTok Shop Seller**
1. Buka https://seller-id.tiktok.com/ (regional Indonesia)
2. Daftar pakai akun TikTok personal/business
3. Upload KTP + verify identity
4. Setup shop info (nama, logo, kategori)
5. List minimum 5 produk untuk verifikasi shop

**Step 2 — Daftar Partner Center**
1. Buka https://partner.tiktokshop.com/
2. Pilih **"App Developer"** (bukan "Service Provider")
3. Login pakai akun TikTok Shop Seller
4. Isi form developer:
   - **Developer Type:** Self-developer (untuk toko sendiri)
   - **Company:** Adzkia35
   - **App Category:** ERP / Inventory Management
5. Submit + tunggu approval 1-5 hari

**Step 3 — Buat App**
1. **Developer Console** → **"Create App"**
2. Isi:
   - **App Name:** Adzkia35 AI Sync
   - **App Region:** ID
   - **Categories:** Order, Product, Logistics, Finance, FBT (centang yang perlu)
   - **Redirect URL:** `https://yourdomain.com/api/marketplace/tiktokshop/oauth/callback`
   - **Server Domain:** yourdomain.com
3. Submit

**Step 4 — Ambil Credentials**
```
App Key: xxxxxxxxxxxxxxxx (32 char)
App Secret: yyyyyyyyyyyyyyyyyyyyyy (40+ char)
```

**Step 5 — OAuth Authorization**
1. Generate auth URL:
   ```
   https://services.tiktokshop.com/open/authorize?app_key={APP_KEY}&state={RANDOM}
   ```
2. Seller approve → dapat `auth_code`
3. Exchange auth_code → `access_token` (valid 30 hari) + `refresh_token`

**Step 6 — Save Credentials**
Paste App Key, App Secret, Shop ID, Access Token ke dashboard tab TikTok Shop.

### Endpoint Penting
- `GET /api/products/search` — list produk
- `POST /api/products/product` — create produk
- `GET /api/orders/search` — list order
- `POST /api/logistics/ship/package` — ship order
- `GET /api/finance/order/statements` — finance

### Cost
- ✅ API gratis
- Commission: 1-5% + 0,5-2% transaction fee

---

## 4️⃣ Lazada Open Platform

**URL:** https://open.lazada.com/  
**Dokumentasi:** https://open.lazada.com/apps/doc/doc

### Prasyarat
- LazMall seller (butuh PT/CV) ATAU LazGlobal regular seller
- KTP/SIUP
- Akun seller aktif minimum 1 bulan

### Langkah Daftar

**Step 1 — Seller Account**
1. Daftar di https://www.lazada.co.id/sellercenter/
2. Pilih LazMall (PT) atau Marketplace (perorangan)
3. Upload dokumen sesuai jenis seller
4. Tunggu approval 3-7 hari

**Step 2 — Apply Developer Access**
1. Buka https://open.lazada.com/
2. **"Become a Developer"**
3. Login dgn akun Seller Center
4. Pilih **"Seller App"** (untuk toko sendiri)
5. Isi:
   - **Company:** Nama Anda / PT
   - **App Purpose:** Multi-platform AI automation
   - **Country:** ID (Indonesia)
6. Submit + tunggu 3-5 hari

**Step 3 — Create App**
1. Developer Console → **"Create App"**
2. Isi:
   - **App Name:** Adzkia35 AI Hub
   - **Type:** Seller App
   - **Callback URL:** `https://yourdomain.com/api/marketplace/lazada/oauth/callback`
3. Submit

**Step 4 — Credentials**
```
App Key: 123456 (6-8 digit)
App Secret: alphanumeric-32-char
```

**Step 5 — OAuth + Authorize Country**
1. Authorize URL (Indonesia specific):
   ```
   https://auth.lazada.com/oauth/authorize?response_type=code&force_auth=true&redirect_uri={CALLBACK}&client_id={APP_KEY}
   ```
2. Exchange code → access_token (valid 7 hari)
3. Refresh token

**Step 6 — Save**
Paste App Key, App Secret, Access Token, Country (ID), Seller ID ke dashboard.

### Endpoint Penting
- `/products/get` — list products
- `/product/create` — create product
- `/orders/get` — orders
- `/order/fulfill` — ship order

### Cost
- ✅ API gratis
- Commission: 1-4% + payment processing 0,9-2%

---

## 🎯 Cheat Sheet — Redirect URI untuk Semua Marketplace

```
Shopee:      https://yourdomain.com/api/marketplace/shopee/oauth/callback
Tokopedia:   https://yourdomain.com/api/marketplace/tokopedia/oauth/callback
TikTok Shop: https://yourdomain.com/api/marketplace/tiktokshop/oauth/callback
Lazada:      https://yourdomain.com/api/marketplace/lazada/oauth/callback
```

Untuk testing lokal pakai VPS Cloudflare Tunnel URL Anda.

---

## 🔧 Setelah Semua Connected

Begitu credentials masuk ke `.env` VPS:

1. **Test koneksi**: Dashboard → Marketplace tab → "Test All Connections"
2. **Sync produk awal**: AI agent auto-pull semua produk existing dari tiap marketplace
3. **Unified inventory**: Stok di-sync cross-marketplace (kalau Shopee terjual, otomatis kurangi stok Tokopedia)
4. **Auto-respond chat**: AI agent reply pertanyaan buyer (response time <5 menit)
5. **Order processing**: Auto-print resi, auto-update tracking, auto-mark shipped
6. **Daily reports**: AI kirim summary ke Telegram tiap pagi (sales, pending orders, low stock)

---

## ⚠️ Troubleshooting

### Shopee: "Sign Mismatch"
- HMAC-SHA256 signature harus pakai `partner_key + path + timestamp + access_token + shop_id`
- Cek urutan parameter dan encoding URL

### Tokopedia: "Invalid FS ID"
- FS ID berbeda per shop, ambil dari endpoint `/v1/shop/fs/{fs_id}/shop-info`
- Pastikan Power Merchant subscription aktif

### TikTok Shop: "App Not Authorized"
- Auth code expired dalam 10 menit, harus exchange cepat
- Region harus match (ID vs global), beda app key

### Lazada: "Country Mismatch"
- Setiap negara butuh authorize terpisah (ID, MY, TH, SG, PH, VN)
- Pakai parameter `force_auth=true` untuk re-authorize

---

## 📞 Support

Kalau butuh bantuan registrasi, kirim ke Telegram bot `@adzkia35_super_leader_bot`:
```
/marketplace shopee   — Generate registration package Shopee
/marketplace tokopedia — Generate registration package Tokopedia
/marketplace tiktokshop — Generate registration package TikTok Shop
/marketplace lazada   — Generate registration package Lazada
```

Bot kasih semua form values siap copy-paste + walk-through real-time.

---

**Versi:** 1.0  
**Update terakhir:** 2026-05-23  
**Author:** AI Business Agents v7.5
