Token导航 LogoToken导航TokenDH.com
研究检索敏感数据unknown未标认证来源可访问许可证需确认审计未展示

knot-transaction-link结交易链接

Agent Skill

knot-transaction-link 用于查找、检索和筛选相关信息,适合在 Local Agent 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

188

周安装

8

下载量

66
Local Agent

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:knot-transaction-link(结交易链接)
来源仓库:https://docs.knotapi.com
仓库路径:knot-transaction-link
安装命令:
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。当前暂无明确安装命令,请以来源页面说明为准。

简介

knot-transaction-link 用于查找、检索和筛选相关信息。

  • 适合在 Local Agent 中根据关键词、任务场景或来源线索快速定位候选结果时使用。
  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Local Agent,接入前应确认版本、权限和运行环境要求。

SKILL.md

Integrate Transaction Data

Implement the full flow to link merchant accounts and retrieve SKU-level transaction data from Knot's API, from session creation through transaction syncing.

Before Starting: Load API Context

Option A: Knot MCP (preferred)

If the knot-docs MCP server is available, use ToolSearch with query +knot-docs to load the tools, then fetch these pages:

  1. mcp__knot-docs__get_page_docs with page transaction-link/quickstart — Full quickstart guide
  2. mcp__knot-docs__get_page_docs with page api-reference/products/transaction-link/sync — Sync Transactions endpoint
  3. mcp__knot-docs__get_page_docs with page webhooks — Webhook verification and retry behavior

If the knot-docs MCP is not installed, ask the user to run the following command in their terminal:

npx add-mcp https://docs.knotapi.com/mcp --name knot-docs

Option B: No MCP available

If the MCP server cannot be installed or used, skip the MCP calls. The workflow below contains everything needed to build the integration.

Workflow

Step 1: API Authentication

All Knot API requests use Basic Auth: Authorization: Basic base64(client_id:secret).

Check the user's codebase for existing Knot credentials (environment variables, config files, .env). If credentials are already available, use them. If not, ask the user to provide their client_id and secret so you can base64-encode them and proceed. Point them to the Knot Dashboard at https://dashboard.knotapi.com/developers/keys where each environment (development and production) has its own credentials.

Step 2: Webhook Endpoint

Ask the user: Do you have an existing webhook URL configured in the Knot Dashboard at https://dashboard.knotapi.com/webhooks? If they have already integrated other Knot products (e.g. CardSwitcher, SubscriptionManager), they likely already have a webhook configured. If no webhook exists, build a new POST endpoint and provide the URL to the user so they can configure it in the Knot Dashboard at https://dashboard.knotapi.com/webhooks for the appropriate environment.

The webhook endpoint must handle these events:

AUTHENTICATED — merchant account successfully linked:

{
  "event": "AUTHENTICATED",
  "external_user_id": "user-123",
  "merchant": { "id": 19, "name": "DoorDash" },
  "session_id": "fb5aa994-ed1c-4c3e-b29a-b2a53222e584",
  "task_id": 25605,
  "timestamp": 1710864923198,
  "data": {
    "card_id": "",
    "metadata": {}
  }
}

NEW_TRANSACTIONS_AVAILABLE — new transactions ready to sync:

{
  "event": "NEW_TRANSACTIONS_AVAILABLE",
  "external_user_id": "user-123",
  "merchant": { "id": 19, "name": "DoorDash" },
  "timestamp": 1710864923198
}

UPDATED_TRANSACTIONS_AVAILABLE — existing transactions changed:

{
  "event": "UPDATED_TRANSACTIONS_AVAILABLE",
  "external_user_id": "user-123",
  "merchant": { "id": 19, "name": "DoorDash" },
  "updated": [
    { "id": "txn-id-1" },
    { "id": "txn-id-2" }
  ],
  "timestamp": 1710864923198
}

ACCOUNT_LOGIN_REQUIRED — connection lost, user needs to re-authenticate:

{
  "event": "ACCOUNT_LOGIN_REQUIRED",
  "external_user_id": "user-123",
  "merchant": { "id": 19, "name": "DoorDash" },
  "timestamp": 1710864923198
}

Route by event field:

  • AUTHENTICATED -> mark merchant account as connected, store the connection
  • NEW_TRANSACTIONS_AVAILABLE -> enqueue sync job for (external_user_id, merchant.id)
  • UPDATED_TRANSACTIONS_AVAILABLE -> enqueue update job for each updated[].id
  • ACCOUNT_LOGIN_REQUIRED -> mark merchant account as disconnected, prompt user to reconnect
  • MERCHANT_STATUS_UPDATE -> update local merchant availability (see Step 3)

Return 200 immediately. Knot times out after 10 seconds and retries up to 2 times on non-200 responses.

Step 3: List Available Merchants

Call GET /merchant/list?type=transaction_link&platform={platform} to retrieve merchants available for linking. The platform parameter (ios, android, or web) should always be included so the response only contains merchants supported on that platform. When platform is provided, the response also includes a min_sdk_version field for each merchant. Only display merchants whose min_sdk_version is at or below the SDK version the app is running.

Call this endpoint once per platform at launch to populate the initial merchant list, then periodically (e.g. once per day) to stay current. For real-time updates, handle the MERCHANT_STATUS_UPDATE webhook, which fires when a merchant becomes available or unavailable. This event is emitted independently per product type and platform, so filter by both type and platform to determine which merchant is available for which product and platform.

Merchant IDs are static across all environments.

Step 4: Create a Session

For each merchant the user wants to link, call POST /session/create:

{
  "type": "transaction_link",
  "external_user_id": "user-123"
}

The response contains a session string. Pass this to the SDK in the next step.

Step 5: Initialize the SDK

Initialize the Knot SDK with the session from the previous step and the merchant_id the user selected. Specifying a merchant_id is required for this product. See the knot-sdk skill for platform-specific SDK installation and initialization.

Step 6: Handle Authentication

When the user successfully authenticates through the SDK, Knot sends the AUTHENTICATED webhook. Store the merchant account connection with status connected. You can also call GET /accounts/get?external_user_id={id} to retrieve all linked merchant accounts and their connection status.

Step 7: Sync Transactions with Cursor Pagination

When the NEW_TRANSACTIONS_AVAILABLE webhook is received, call POST /transactions/sync in a loop using the external_user_id and merchant.id from the webhook payload. Pass the cursor from the previous response to get the next page. Continue until next_cursor is null.

cursor = load_stored_cursor(external_user_id, merchant_id)  // null on first sync

loop:
  response = POST /transactions/sync {
    merchant_id,
    external_user_id,
    cursor,
    limit: 5
  }

  store_transactions(response.transactions)
  cursor = response.next_cursor
  // Important: persist cursor after each page to avoid re-scanning already-fetched transactions
  persist_cursor(external_user_id, merchant_id, cursor)

  break if cursor is null

Cursor behavior:

  • cursor is an opaque string returned by the API that tells it where to resume
  • On the first-ever sync, send cursor: null to start from the beginning
  • On subsequent syncs (triggered by future NEW_TRANSACTIONS_AVAILABLE webhooks), send the last stored cursor to retrieve only new transactions since the previous sync
  • limit range: 1-100 (default to 5)
  • When next_cursor is null in the response, all available transactions have been returned

Persist the cursor: Store the cursor keyed by (external_user_id, merchant_id) after each page. This ensures:

  • If the sync job crashes mid-pagination, it resumes from the last completed page rather than re-fetching everything
  • On the next NEW_TRANSACTIONS_AVAILABLE webhook, the sync starts where it left off and only retrieves new transactions

Step 8: Handle Transaction Updates

When UPDATED_TRANSACTIONS_AVAILABLE is received, call GET /transactions/{id} for each transaction ID in the updated array. Upsert the updated transaction into storage keyed on its id, overwriting the previous version.

for each updated[].id:
  txn = GET /transactions/{id}
  upsert txn into storage (keyed on txn.id)

Step 9: Handle Disconnections

When ACCOUNT_LOGIN_REQUIRED is received, the merchant account connection has been lost (e.g. the user changed their password). Mark the account as disconnected and display a reconnect prompt in your app. To reconnect, create a new session (Step 4) and re-initialize the SDK (Step 5).

Step 10: Store Transactions

Store all fields from each transaction object. See the Transaction Object Schema below for the full schema with every field, its type, and whether it can be null. The implementation must handle nullable fields.

Deduplication: Use the transaction id as the dedup key via upsert.

Schema recommendation:

-- Adapt types/syntax to your database (e.g. JSON column type, timestamp handling)
CREATE TABLE knot_transactions (
  id TEXT PRIMARY KEY,                    -- Knot's transaction ID, dedup key
  user_id TEXT NOT NULL REFERENCES users(id),  -- FK to your users table
  merchant_id INTEGER NOT NULL,
  external_id TEXT,                       -- Merchant-provided order identifier (nullable)
  datetime TIMESTAMP NOT NULL,
  order_status TEXT NOT NULL,
  url TEXT,
  price_total TEXT NOT NULL,
  price_sub_total TEXT,
  price_currency TEXT,
  products JSON,                          -- Array of product objects; use JSON/JSONB or normalize
  payment_methods JSON,                   -- Array of payment method objects
  shipping JSON,                          -- Shipping object (nullable)
  created_at TIMESTAMP DEFAULT now(),
  updated_at TIMESTAMP DEFAULT now()
);

CREATE INDEX idx_knot_txn_user_merchant
  ON knot_transactions (user_id, merchant_id);

CREATE TABLE knot_sync_cursors (
  user_id TEXT NOT NULL REFERENCES users(id),
  merchant_id INTEGER NOT NULL,
  cursor TEXT,                            -- Last cursor from /transactions/sync
  updated_at TIMESTAMP DEFAULT now()
);

CREATE TABLE knot_merchant_accounts (
  user_id TEXT NOT NULL REFERENCES users(id),
  merchant_id INTEGER NOT NULL,
  connection_status TEXT NOT NULL DEFAULT 'connected',  -- connected or disconnected
  created_at TIMESTAMP DEFAULT now(),
  updated_at TIMESTAMP DEFAULT now()
);

The upsert (used for both new syncs and updates):

INSERT INTO knot_transactions (id, user_id, merchant_id, external_id, datetime, order_status, url, price_total, price_sub_total, price_currency, products, payment_methods, shipping, updated_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, now())
ON CONFLICT (id) DO UPDATE SET
  order_status = EXCLUDED.order_status,
  price_total = EXCLUDED.price_total,
  price_sub_total = EXCLUDED.price_sub_total,
  products = EXCLUDED.products,
  payment_methods = EXCLUDED.payment_methods,
  shipping = EXCLUDED.shipping,
  updated_at = now();

Step 11: Testing

In the development environment, use POST /development/accounts/link (base URL: https://development.knotapi.com) to link a merchant account and generate sample transactions without the client-side SDK. This triggers the same webhook flow as a real user.

Generate new transactions:

POST https://development.knotapi.com/development/accounts/link
{
  "external_user_id": "test-user-1",
  "merchant_id": 19,
  "transactions": {
    "new": true,
    "updated": false
  }
}

This will:

  1. Link the merchant account and emit an AUTHENTICATED webhook
  2. Generate 205 sample transactions within a few seconds
  3. Emit a NEW_TRANSACTIONS_AVAILABLE webhook, triggering the sync flow

Generate new + updated transactions:

POST https://development.knotapi.com/development/accounts/link
{
  "external_user_id": "test-user-1",
  "merchant_id": 19,
  "transactions": {
    "new": true,
    "updated": true
  }
}

Same as above, but also updates a few of the newly-generated transactions and emits an UPDATED_TRANSACTIONS_AVAILABLE webhook with their IDs shortly after. new: true is required to use updated: true.

Tips:

  • Use merchant_id: 19 (DoorDash) for testing
  • If testing multiple times consecutively, use a different external_user_id each time
  • Ensure a webhook URL is configured in the Knot Dashboard at https://dashboard.knotapi.com/developers/webhooks for the development environment before calling this endpoint
  • Auth: same Basic Auth as all other API calls, using your development environment credentials

Pitfalls

  • Session type: Use "transaction_link" (not "transactions_link") when calling Create Session.
  • Merchant ID required in SDK: You must pass a specific merchant_id when initializing the SDK for this product.
  • Webhook timeout: Return 200 immediately. Process all work asynchronously.
  • Always loop: Do not assume a single-page response. Loop until next_cursor is null.
  • Always upsert: Never INSERT without ON CONFLICT. Duplicates will occur.
  • Persist cursor per-page: Do not wait until the full sync completes. Persist after each page so crash recovery works.
  • Handle nulls: Many transaction fields are nullable. Check the schema below for which fields can be null.

Transaction Object Schema

Store all fields from each transaction. Fields marked nullable may be null -- the implementation must handle this.

Top-level fields

FieldTypeNullableDescription
idstring (UUID)NoUnique transaction identifier. Dedup key.
external_idstringYesMerchant-provided order identifier
datetimestring (ISO 8601)NoTransaction timestamp in UTC
order_statusenumNoCurrent order lifecycle state
urlstringYesDirect link to order in merchant account
priceobjectNoPrice breakdown (see below)
productsarrayNoSKU-level items (see below)
payment_methodsarrayNoPayment methods used (see below)
shippingobjectYesDelivery details (see below). Null for digital/in-store orders.

Note: The merchant object ({id, name}) is returned in the /transactions/sync response wrapper, not inside each transaction object.

order_status enum: ORDERED, BILLED, SHIPPED, DELIVERED, PICKED_UP, COMPLETED, REFUNDED, CANCELLED, FAILED, RETURNED, UNRECOGNIZED

price object

FieldTypeNullableDescription
sub_totalstringYesSum of item prices before adjustments
totalstringNoFinal amount after all adjustments
currencystringYesISO 4217 currency code (e.g. "USD")
adjustmentsarrayNoModifications to subtotal (tax, fees, discounts)

adjustments[].type enum: DISCOUNT, TAX, TIP, FEE, REFUND, UNRECOGNIZED

Each adjustment has: type (enum, not null), label (string, nullable), amount (string, not null -- positive increases total, negative decreases).

products[]

FieldTypeNullableDescription
external_idstringYesMerchant-provided product identifier
namestringNoProduct name
descriptionstringYesAdditional product details
urlstringYesLink to product page on merchant site
image_urlstringYesLink to product image
quantityintegerYesNumber of units
eligibilityarray of stringsNoSpecial spending categories (e.g. "FSA/HSA")
priceobjectYes{sub_total, total, unit_price} -- all nullable strings
sellerobjectYes{name, url} -- both nullable strings

payment_methods[]

FieldTypeNullableDescription
typeenumNoPayment method category
brandstringYesCard network or store card name
last_fourstringYesLast four digits of card number
transaction_amountstringYesAmount charged to this payment method
namestringYesCustomer-provided label (e.g. "Work Card")
external_idstringYesMerchant-provided payment method identifier

type enum: CARD, APPLE_PAY, GOOGLE_PAY, AMAZON_PAY, PAYPAL, CASH_APP, VENMO, AFFIRM, KLARNA, GIFT_CARD, CASH, BANK_ACCOUNT, LOYALTY_POINTS, UNRECOGNIZED

shipping object

Nullable at the top level. When present: location (nullable object) -> address (nullable object with line1, line2, city, region, postal_code all nullable strings, country not null), first_name (nullable), last_name (nullable).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Local Agent

71.48%
按下载量换算47

安全审计

暂无安全审计结果可展示。

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills