trendyol-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and authenticate Trendyol seller order package webhooks. Use when setting up a Trendyol webhook endpoint, verifying the x-api-key header, debugging…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Trendyol Webhooks
Trendyol (the Turkish marketplace) sends a webhook to your seller endpoint when an order package
changes status. Webhooks are not signed. When you create the webhook with
authenticationType API_KEY, Trendyol sends the webhook's apiKey as plain text in the
x-api-key header on every request, and your endpoint authenticates the request by comparing the
whole header value with the key you stored.
Choose API key authentication (authenticationType API_KEY) when you create the Trendyol webhook.
Trendyol also offers BASIC_AUTHENTICATION, which Hookdeck's Trendyol source does not cover; this
skill covers only API_KEY.
When to Use This Skill
- How do I receive Trendyol order package webhooks?
- How do I verify the
x-api-keyheader on a Trendyol webhook? - Does Trendyol sign webhook payloads? (No: use the shared API key)
- How do I handle
CREATED,SHIPPED,DELIVERED,CANCELLEDorRETURNEDpackages? - Why does my Trendyol webhook endpoint return 401, or why does Trendyol keep re-sending requests?
Verification (core)
const crypto = require('crypto');
// Hash both sides: equal-length buffers, so timingSafeEqual never throws.
function safeEqual(a, b) {
const ha = crypto.createHash('sha256').update(String(a)).digest();
const hb = crypto.createHash('sha256').update(String(b)).digest();
return crypto.timingSafeEqual(ha, hb);
}
function verifyTrendyolRequest(headers, secret = process.env.TRENDYOL_WEBHOOK_SECRET) {
if (!secret) return false; // never accept when unconfigured
const received = headers['x-api-key']; // the apiKey, sent as plain text
return typeof received === 'string' && received !== '' && safeEqual(received, secret);
}
- Header:
x-api-key: <apiKey>. Compare the whole value withTRENDYOL_WEBHOOK_SECRET; there is no prefix, HMAC or timestamp. Look the header up case-insensitively (Node lowercases it already). - Return
401for a missing or wrong key,400for a body that isn't a JSON object with acontentarray,200once handled. - Read the body raw (
express.raw({ type: '*/*' })) and authenticate before parsing it. - In Python use
hmac.compare_digeston bytes (a.encode(),b.encode()); passingstrraisesTypeErroron non-ASCII input. - A static shared credential authenticates the sender, not the body, and gives no replay
protection (no signature, no timestamp). Serve the endpoint over HTTPS and rotate the
apiKey(update the webhook) if it leaks.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Event Types
Trendyol sends the full order package whatever the status. The body is a page of packages,
{ "content": [ ... ] }; loop over content[] and dispatch on each package's status. The
subscription list is upper case (AT_COLLECTION_POINT), but the body uses the getShipmentPackages
spelling: the example has "status": "Delivered", and the getShipmentPackages docs write
AtCollectionPoint, UnDelivered and UnPacked. Remove underscores and upper-case both sides
before comparing, as the example handlers do; upper-casing alone misses AtCollectionPoint.
| Status | Meaning |
|---|---|
CREATED |
Package is ready to ship |
PICKING |
Seller reports it has started picking or preparing the package |
INVOICED |
Seller reports the invoice is issued |
SHIPPED |
Package is in transit with the carrier |
DELIVERED |
Package reached the customer (final) |
UNDELIVERED |
Package couldn't be delivered to the customer |
CANCELLED |
Package cancelled, including unsupplied ones |
RETURNED |
Undelivered package is back with the seller (final) |
UNSUPPLIED |
Seller cancelled items it can't supply |
AWAITING |
Order awaits payment approval; use for stock updates only |
UNPACKED |
Package was split |
AT_COLLECTION_POINT |
Package waits at a pickup point for the customer |
VERIFIED |
Order awaits payment approval, documented with AWAITING |
Requests are POST with a JSON body. Delivery is at least once, so the same package can arrive
more than once. If your endpoint fails, Trendyol re-sends every 5 minutes until it succeeds and
eventually deactivates the webhook, so handlers must be idempotent: upsert by shipmentPackageId
and skip a body whose lastModifiedDate isn't newer than the one you stored.
Environment Variables
TRENDYOL_WEBHOOK_SECRET=your-webhook-api-key # the apiKey set when creating the webhook
Local Development
Trendyol can't reach localhost. Tunnel with the Hookdeck CLI (no account required):
npx hookdeck-cli listen 3000 trendyol --path /webhooks/trendyol
Use the printed URL as the webhook URL. Trendyol rejects URLs containing "Trendyol", "Dolap" or "Localhost", so if you expose a handler directly rather than through a tunnel or Hookdec
Установить trendyol-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл trendyol-webhooks?
Receive and authenticate Trendyol seller order package webhooks. Use when setting up a Trendyol webhook endpoint, verifying the x-api-key header, debugging 401s, or handling package statuses like CREATED, SHIPPED, DELIVERED, CANCELLED and RETURNED.
Как установить скилл trendyol-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл trendyol-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic