Skip to content
↑↓ navigate↵ openEsc close

Get started

Quickstart

Create an API key, check it, and list your orders.

1. No Pro plan? Start with a free developer account

A developer account is free, needs no Pro plan, and comes with a sample store, products, stock, and orders. Its keys run in sandbox mode (60 requests per minute). Every step below works the same.

2. Create an API key

  1. Sign in to TheComNet as an owner or admin of the tenant.
  2. Open Pengaturan → Integrasi and create a key.
  3. Give it a name, pick the scopes it needs (for this guide: orders:read), and optionally an expiry date.
  4. Copy the key. It looks like tcn_live_AbC123xY_… and is shown only once.
shell
export THECOMNET_API_KEY="tcn_live_..."

3. Check the key

GET /v1/developer/token-info works with any key and returns the tenant and scopes it carries.

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. List orders

GET /v1/orders needs orders:read. It returns orders from every connected store, newest first, one page at a time.

curl
curl "https://api.comnethub.app/v1/orders?limit=20&status=processing" \
  -H "Authorization: Bearer $THECOMNET_API_KEY"
Response 200 (shortened)
{
  "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. From code

Node.js 18+ (built-in fetch, ES module) and Python with 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);

Next: read Authentication for scopes and key lifecycle, then subscribe to webhooks instead of polling.