Command Palette

Search for a command to run...

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

shipstation-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify ShipStation webhooks. Use when setting up ShipStation webhook handlers, securing endpoints that have no signature (secret token in the…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

ShipStation Webhooks

When to Use This Skill

  • How do I receive ShipStation webhooks?
  • How do I secure a ShipStation webhook endpoint when there is no signature?
  • How do I fetch the resource_url from a ShipStation webhook payload?
  • How do I handle ORDER_NOTIFY, SHIP_NOTIFY, or ITEM_SHIP_NOTIFY events?
  • Why does my ShipStation webhook only contain a resource_url and resource_type?

How ShipStation V1 Webhooks Work

This skill targets the ShipStation V1 API (ssapi.shipstation.com), the source you connect to Hookdeck.

Two things make V1 different from most webhook providers:

  1. Thin payloads. ShipStation does not send the resource data. It POSTs a small JSON body with a URL you must fetch back:

    { "resource_url": "https://ssapi.shipstation.com/orders?...", "resource_type": "ORDER_NOTIFY" }
    

    You GET resource_url with HTTP Basic auth (your API key : API secret) to get the actual orders/shipments. This authenticated fetch-back is the primary trust signal.

  2. No documented signature. ShipStation's V1 docs describe no HMAC, signing secret or signature header for webhooks, so there is nothing to verify cryptographically. Protect the endpoint by putting an unguessable secret token in the target URL (https://you.com/webhooks/shipstation?token=…) and comparing it timing-safe on every request, over HTTPS. Combined with the authed fetch-back, this is the trust model.

Verification (core)

The V1 docs describe no signature. Verify the shared secret token from the query string (timing-safe), then fetch the real resource with Basic auth. Pass only ShipStation hosts to the fetch (SSRF guard).

const crypto = require('crypto');

// 1. Timing-safe compare of the ?token= query param against your secret
function verifyToken(provided, expected) {
  if (!provided || !expected) return false;
  const a = Buffer.from(provided);
  const b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

// Only fetch ShipStation V1 API hosts: ssapi.shipstation.com, or a numbered ssapiN variant
const SHIPSTATION_HOST_RE = /^ssapi\d*\.shipstation\.com$/;

// 2. Fetch the thin payload's resource_url with Basic auth (API key : API secret)
async function fetchResource(resourceUrl, key, secret) {
  if (!SHIPSTATION_HOST_RE.test(new URL(resourceUrl).hostname)) {
    throw new Error('Refusing to fetch non-ShipStation host'); // SSRF guard
  }
  const auth = Buffer.from(`${key}:${secret}`).toString('base64');
  const res = await fetch(resourceUrl, { headers: { Authorization: `Basic ${auth}` } });
  if (res.status === 429) throw new Error(`Rate limited; reset ${res.headers.get('X-Rate-Limit-Reset')}s`);
  if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
  return res.json();
}

For complete handlers with route wiring, event dispatch, and tests, see:

Common Event Types

resource_type on the webhook body is one of the six V1 events you subscribed to:

Event (resource_type) Triggered When
ORDER_NOTIFY A new order is imported
ITEM_ORDER_NOTIFY A new order is imported (with item-level detail)
SHIP_NOTIFY An outbound shipping label is created for an order
ITEM_SHIP_NOTIFY An outbound label is created (with item-level detail)
FULFILLMENT_SHIPPED A fulfillment provider ships a delegated order
FULFILLMENT_REJECTED A fulfillment provider rejects a delegated order

For the full list, see references/overview.md and the ShipStation Webhooks docs.

Environment Variables

SHIPSTATION_WEBHOOK_SECRET=an_unguessable_random_string   # token embedded in the target URL (?token=)
SHIPSTATION_API_KEY=your_api_key                          # for Basic auth when fetching resource_url
SHIPSTATION_API_SECRET=your_api_secret                    # for Basic auth when fetching resource_url

Get the API key/secret from ShipStation → Settings → Account → API Settings. See references/setup.md to subscribe (POST /webhooks/subscribe or the UI).

Local Development

# Start tunnel (no account needed)
npx hookdeck-cli listen 3000 shipstation --path /webhooks/shipstation

Reference Materials

ShipStation API v2 and ShipStation API (formerly ShipEngine)

ShipStation's newer APIs s

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

Установить shipstation-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/shipstation/route.tsexamples/nextjs/app/webhooks/shipstation/verify.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл shipstation-webhooks?

Receive and verify ShipStation webhooks. Use when setting up ShipStation webhook handlers, securing endpoints that have no signature (secret token in the URL), fetching the thin resource_url payload with Basic auth, or handling ORDER_NOTIFY, ITEM_ORDER_NOTIFY, SHIP_NOTIFY, ITEM_SHIP_NOTIFY, FULFILLMENT_SHIPPED, and FULFILLMENT_REJECTED events.

Как установить скилл shipstation-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл shipstation-webhooks запускает скрипты?

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

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

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