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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CategoriesResource(
transport,limiter?):CategoriesResource
Defined in: sdks/trendyol/src/resources/categories.ts:119
Parameters
Section titled “Parameters”transport
Section titled “transport”TrendyolTransport
limiter?
Section titled “limiter?”TokenBucketRateLimiter
Returns
Section titled “Returns”CategoriesResource
Methods
Section titled “Methods”getAttributes()
Section titled “getAttributes()”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.
Parameters
Section titled “Parameters”categoryId
Section titled “categoryId”string | number
Trendyol numeric category ID; accepts string or number.
Returns
Section titled “Returns”Promise<CategoryAttribute[]>
getAttributeValues()
Section titled “getAttributeValues()”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.
Parameters
Section titled “Parameters”categoryId
Section titled “categoryId”string | number
Trendyol numeric category ID; accepts string or number.
attributeId
Section titled “attributeId”string | number
Attribute ID returned by getAttributes.
params?
Section titled “params?”Cursor pagination (max page size 1000; default 100).
Returns
Section titled “Returns”Promise<CursorPage<CategoryAttributeValue>>
Example
Section titled “Example”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()
Section titled “getByBarcodes()”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.
Parameters
Section titled “Parameters”barcodes
Section titled “barcodes”string[]
1–N barcodes to look up.
Returns
Section titled “Returns”Promise<BarcodeCategoryLookup>
Throws
Section titled “Throws”when barcodes is empty.
list()
Section titled “list()”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.
Returns
Section titled “Returns”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.