Mulai
Quickstart
Buat API key, periksa key tersebut, lalu tampilkan daftar pesanan Anda.
1. Belum punya Pro? Mulai dengan akun developer gratis
Akun developer gratis, tidak butuh paket Pro, dan sudah berisi toko contoh, produk, stok, dan pesanan. Key-nya berjalan dalam sandbox mode (60 request per menit). Semua langkah di bawah berlaku sama.
2. Buat API key
- Masuk ke TheComNet sebagai owner atau admin tenant.
- Buka Pengaturan → Integrasi lalu buat key.
- Beri nama, pilih scope yang dibutuhkan (untuk panduan ini:
orders:read), dan bila perlu tanggal kedaluwarsa. - Salin key-nya. Bentuknya seperti
tcn_live_AbC123xY_…dan hanya ditampilkan satu kali.
shell
export THECOMNET_API_KEY="tcn_live_..."3. Periksa key
GET /v1/developer/token-info bisa dipanggil dengan key apa pun dan mengembalikan tenant serta scope yang dibawa key tersebut.
curl
curl "https://api.comnethub.app/v1/developer/token-info" \
-H "Authorization: Bearer $THECOMNET_API_KEY"Response 200
{
"tenantId": "0192f0c4-8d1e-7a4b-9c3e-5f6a7b8c9d0e",
"keyId": "0192f0c5-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"keyName": "ERP sync",
"scopes": [
"orders:read"
]
}4. Tampilkan daftar pesanan
GET /v1/orders membutuhkan orders:read. Endpoint ini mengembalikan pesanan dari semua toko yang terhubung, terbaru lebih dulu, satu halaman per panggilan.
curl
curl "https://api.comnethub.app/v1/orders?limit=20&status=processing" \
-H "Authorization: Bearer $THECOMNET_API_KEY"Response 200 (dipersingkat)
{
"items": [
{
"id": "0192f0c6-3b4c-7d5e-9f60-718293a4b5c6",
"storeId": "0192f0c2-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
"marketplace": "tiktok",
"externalOrderId": "578123456789012345",
"status": "processing",
"placedAt": "2026-11-04T07:12:09.000Z",
"currency": "IDR",
"total": "189000.00",
"itemCount": 2
}
],
"pageInfo": {
"nextCursor": "eyJ0IjoiMjAyNi0xMS0wNFQwNzoxMjowOS4wMDBaIn0",
"hasMore": true
}
}5. Dari kode
Node.js 18+ (fetch bawaan, ES module) dan Python dengan requests:
const BASE = 'https://api.comnethub.app';
const headers = { Authorization: `Bearer ${process.env.THECOMNET_API_KEY}` };
async function get(path) {
const res = await fetch(BASE + path, { headers });
if (!res.ok) {
const problem = await res.json();
throw new Error(`${res.status} ${problem.code}: ${problem.detail ?? problem.title}`);
}
return res.json();
}
const me = await get('/v1/developer/token-info');
console.log('tenant', me.tenantId, 'scopes', me.scopes);
// Walk every page of orders placed in the last 7 days.
const from = new Date(Date.now() - 7 * 864e5).toISOString();
let cursor;
do {
const qs = new URLSearchParams({ from, limit: '100', ...(cursor ? { cursor } : {}) });
const page = await get(`/v1/orders?${qs}`);
for (const o of page.items) console.log(o.externalOrderId, o.status, o.total, o.currency);
cursor = page.pageInfo.hasMore ? page.pageInfo.nextCursor : undefined;
} while (cursor);Selanjutnya: baca Autentikasi untuk scope dan siklus hidup key, lalu berlangganan webhook alih-alih polling.