Skip to content

Trendyol guide

@lonca/trendyol ships full coverage of Trendyol’s published API surface. The repo’s sdks/trendyol/README.md keeps the most up-to-date per-resource cheat sheet; this guide hits the highlights and points you at the most useful sections.

ResourceWhat it covers
brandsList all brands; resolve brand IDs by name.
categoriesCategory tree + per-category attributes.
suppliersSeller-info read (rate-limited to 1 req/hour).
productsRead + create + update merchant products (incl. lightweight stock/price filter).
inventoryStock/price update + status polling.
ordersOrder list, status transitions, package management.
claimsCustomer returns — list + accept/reject.
questionsProduct questions on storefront — answer / reject.
financeSettlements + other financial transactions.
invoicesE-invoice flows.
labelsShared cargo labels / barcodes.
testOrdersSandbox test order creation.
locationsCountry/city/district lookup.
exportCenterExport Center (İhracat Merkezi) — cross-border catalog + packages.
videosProduct-page video upload + status.
webhooksCRUD over webhook configurations + parseWebhookEvent() helper.
import { createTrendyolClient } from '@lonca/trendyol';
const client = createTrendyolClient({
sellerId: 12345,
apiKey: process.env.TY_API_KEY!,
apiSecret: process.env.TY_API_SECRET!,
env: 'prod',
integratorName: 'MyCompany',
});
const page = await client.brands.list({ limit: 50 });
for (const b of page.items) {
console.log(b.id, b.name);
}

All list endpoints return CursorPage<T> with items + nextCursor. Use paginate() — re-exported from @lonca/trendyol, so you don’t need a direct @lonca/core dependency — to iterate every page:

import { paginate } from '@lonca/trendyol';
for await (const brand of paginate((cursor) => client.brands.list({ limit: 50, cursor }))) {
console.log(brand.id, brand.name);
}

Trendyol’s webhook model is body-discriminated — a single endpoint receives every event, with type in the JSON body.

import express from 'express';
import { parseWebhookEvent } from '@lonca/trendyol';
const app = express();
app.use(express.json());
app.post('/ty/webhook', (req, res) => {
const { packages, pageInfo } = parseWebhookEvent(req.body);
for (const p of packages) {
console.log(p.id, p.status);
}
res.status(200).end();
});

Unofficial. Lonca is an independent, community-maintained project — not affiliated with, endorsed by, or supported by Trendyol, Hepsiburada, or any other marketplace. All marketplace names and trademarks belong to their respective owners.