Skip to content

CategoriesResource

Defined in: sdks/trendyol/src/resources/categories.ts:116

Trendyol category-tree and category-attribute endpoints.

Rate limits (per Trendyol service limits):

  • Category list: 50 req/min
  • Category attributes: 50 req/min
  • Category attribute values: 50 req/min (same service tier)

All three counters live on the same Trendyol service, so we share one limiter across the endpoints.

new CategoriesResource(transport, limiter?): CategoriesResource

Defined in: sdks/trendyol/src/resources/categories.ts:119

TrendyolTransport

TokenBucketRateLimiter

CategoriesResource

getAttributes(categoryId): Promise<CategoryAttribute[]>

Defined in: sdks/trendyol/src/resources/categories.ts:155

Fetch the attributes (required and optional) for a single category.

Call this before createProduct V2 so you know which attributes are mandatory — the API rejects products that omit any required attribute.

string | number

Trendyol numeric category ID; accepts string or number.

Promise<CategoryAttribute[]>


getAttributeValues(categoryId, attributeId, params?): Promise<CursorPage<CategoryAttributeValue>>

Defined in: sdks/trendyol/src/resources/categories.ts:198

Fetch the allowed values for a single category attribute (paginated).

getCategoryAttributes returns attribute metadata + flags but typically omits the value catalog. Use this method to fetch the catalog for an attribute when allowCustom is false and you need to map your data onto Trendyol’s accepted values.

string | number

Trendyol numeric category ID; accepts string or number.

string | number

Attribute ID returned by getAttributes.

CursorPaginationParams = {}

Cursor pagination (max page size 1000; default 100).

Promise<CursorPage<CategoryAttributeValue>>

import { paginate } from '@lonca/core';
for await (const value of paginate((p) =>
client.categories.getAttributeValues(catId, attrId, p),
)) {
console.log(value.id, value.name);
}

getByBarcodes(barcodes): Promise<BarcodeCategoryLookup>

Defined in: sdks/trendyol/src/resources/categories.ts:238

Look up category info for a list of barcodes (Trendyol Export Center / AutoFT endpoint).

Requires Export Center enrollment. Sellers who have not joined Trendyol’s “İhracat Merkezi” program will get an auth error on this endpoint even though their regular Marketplace credentials are valid.

string[]

1–N barcodes to look up.

Promise<BarcodeCategoryLookup>

when barcodes is empty.


list(): Promise<Category[]>

Defined in: sdks/trendyol/src/resources/categories.ts:137

Fetch the full Trendyol category tree.

Trendyol returns the entire tree in one response — there is no pagination. Cache the result aggressively in your application; the tree changes rarely.

Promise<Category[]>

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.