Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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-key header on a Trendyol webhook?
  • Does Trendyol sign webhook payloads? (No: use the shared API key)
  • How do I handle CREATED, SHIPPED, DELIVERED, CANCELLED or RETURNED packages?
  • 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 with TRENDYOL_WEBHOOK_SECRET; there is no prefix, HMAC or timestamp. Look the header up case-insensitively (Node lowercases it already).
  • Return 401 for a missing or wrong key, 400 for a body that isn't a JSON object with a content array, 200 once handled.
  • Read the body raw (express.raw({ type: '*/*' })) and authenticate before parsing it.
  • In Python use hmac.compare_digest on bytes (a.encode(), b.encode()); passing str raises TypeError on 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

Полный SKILL.md на GitHub

Установить trendyol-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/trendyol/route.tsexamples/nextjs/lib/verify-trendyol.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить trendyol-webhooks с