Skip to content

loncadev/lonca

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Lonca

CI npm version License: MIT Node pnpm

Open-source SDKs and tooling for Turkish e-commerce marketplaces.

Type-safe TypeScript SDKs, curated OpenAPI specs, and integration utilities for Trendyol, Hepsiburada, n11, Amazon TR, Pazarama, Çiçeksepeti, and more.

Warning

🚧 Alpha — APIs are not stable. Do not use in production. Minor versions may contain breaking changes until 1.0.0.

Table of contents

Vision

Three-stage roadmap:

  1. SDK + OpenAPI Spec Collection — Type-safe TypeScript SDKs and curated OpenAPI specs for Turkish marketplaces (current stage)
  2. API Drift Detection — A monitoring layer that proactively detects breaking changes in marketplace APIs
  3. Unified Marketplace API Gateway — A Plaid-style abstraction that puts every marketplace behind a single API

Why?

Turkish e-commerce marketplace APIs are fragmented, under-documented, and constantly shifting. Every e-commerce developer ends up rewriting the same integration code from scratch. Existing solutions are either closed-source vendor-locked (IdeaSoft, T-Soft) or simply don't support Turkish marketplaces (Zapier, Make, n8n).

Lonca aims to fill this gap with a community-maintained open standard.

Packages

Package Description Status
@lonca/core Shared types, error hierarchy, retry / logger / rate-limiter npm
@lonca/trendyol Trendyol Marketplace SDK — full surface (14 resources, ~70 methods, webhook helper) npm
@lonca/hepsiburada Hepsiburada Marketplace API SDK Planned

Need an SDK for another marketplace? Open a marketplace request.

Quick start

Trendyol (live)

pnpm add @lonca/trendyol @lonca/core
import { createTrendyolClient } from '@lonca/trendyol';
import { paginate } from '@lonca/core';

const client = createTrendyolClient({
  sellerId: 12345,
  apiKey: process.env.TRENDYOL_API_KEY!,
  apiSecret: process.env.TRENDYOL_API_SECRET!,
  env: 'prod', // or 'stage'
});

// Iterate every product page-by-page.
for await (const product of paginate((p) => client.products.list(p))) {
  for (const variant of product.variants) {
    console.log(variant.barcode, product.title);
  }
}

See sdks/trendyol/README.md for the full surface (brands · categories · suppliers · products read+write+lifecycle · inventory · orders read+write+split+cargo+ops+returns · claims · webhooks + parseWebhookEvent · questions · invoices · finance · labels · testOrders · locations) and end-to-end walkthroughs for product creation, webhook handling, returns/claims, and settlement reconciliation.

Shared primitives

pnpm add @lonca/core
import { money, paginate, retry, RateLimitError, TokenBucketRateLimiter } from '@lonca/core';

const price = money(12550, 'TRY'); // 125.50 TRY (integer minor units)
const limiter = new TokenBucketRateLimiter({ capacity: 50, intervalMs: 60_000 });

await retry(
  async () => {
    await limiter.acquire();
    // ...call a marketplace API
  },
  { maxAttempts: 5 },
);

See packages/core/README.md for the full surface.

Development

Requirements:

  • Node.js >= 22 (active LTS) — pinned to 24 via .nvmrc
  • pnpm >= 10 (Corepack recommended)
git clone https://github.com/loncadev/lonca.git
cd lonca
pnpm install

Common commands:

pnpm typecheck      # TypeScript
pnpm lint           # ESLint
pnpm format         # Prettier (write)
pnpm test           # Vitest
pnpm build          # Build all packages via Turborepo
pnpm dev            # Parallel watch across packages

Work on a single package:

pnpm --filter @lonca/core test

Contributing

Pull requests are welcome. Start with CONTRIBUTING.md and our Code of Conduct. For larger changes, open a Discussion first.

Security

Do not file public issues for security vulnerabilities. Follow the disclosure process in SECURITY.md.

License

MIT — see LICENSE.

About

OSS SDK collection for Turkish e-commerce marketplaces (Trendyol, Hepsiburada, n11, and more)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors