360 Secure SkillHub
360 安全技能中心

Crossly Buyer shopping agent

该 Skill 说明如何基于 Crossly Buyer API 和买家 MCP 服务器构建购物代理:通过多轮对话搜索商品、收藏与购物车操作、监控降价和新上架、发起与回应议价、维护愿望清单,并在需要付款时把用户引导至结账报价入口。它强调金额以分为单位、付款前需明确确认,且不完成实际购买或支付。

分类:生活
crossly
热度 9.19
最近更新 2026-11-30 11:08:22

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add crossly/crossly-buyer-shopping-agent
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
crossly-buyer-shopping-agent
description
Build an AI shopping agent on the Crossly Buyer API. Drive the Crossly shopping agent conversations (POST /v1/buyer/agent/sessions, turns, react, act; buyer:agent:write plus each action's own scope), watch searches with monitors (POST /v1/buyer/monitors, new_listing, price_drop, back_in_stock, signed webhook or poll), hunts and market watches, make and answer offers (POST /v1/buyer/offers, awaitingBuyer, redeemable, POST /v1/buyer/offers/{id}/respond), keep wishlists, read followed sellers, clear recently viewed, Scout cashback, gift cards and drops, and run the @crossly/buyer-mcp server (CROSSLY_BUYER_TOKEN; talk_to_shopping_agent, act_on_agent_option, offer_on_listing, quote_my_cart). Use when an agent shops for a person on Crossly, or when deciding what it may do without asking.

Build a Crossly shopping agent

A shopping agent finds things, watches for them, negotiates and fills a cart, and leaves paying to the person. This skill covers the agent-shaped parts of the Buyer API. Auth, the SDK client, catalog search, cart quotes, orders, unattended checkout and the error and rate-limit rules are in crossly-buyer-api; read that first. Everything here uses a buyer OAuth token with buyer:* scopes (no PAT exists for buyers).

Setup

  1. Create a free Crossly account: https://crossly.net/register
  2. Buyer calls need an OAuth access token with buyer:* scopes from Crossly sign-in (https://crossly.net/atlas/oauth2/authorize, PKCE). Guide: https://crossly.net/shop/docs/authentication
  3. Send it as Authorization: Bearer <token> to https://crossly.net/api/v1/buyer/*. Full docs: https://crossly.net/docs

Confirm before spending, and never claim a purchase

  • Nothing in @crossly/buyer-sdk, @crossly/buyer-cli or @crossly/buyer-mcp completes a purchase. An agent built on them must never tell the person it bought something.
  • Offers, carts, quotes, wishlists, monitors and alerts spend nothing. Do them on request; still read the amount back before sending an offer, because a seller can accept it at once and the person then has 48 hours to pay that price.
  • Anything that charges a card needs buyer:checkout:write, the key switched on, and its limits (see crossly-buyer-api). Before calling one, show the person the item, the delivered total and the card, and get an explicit yes. That covers POST /v1/buyer/checkout, hunts in offer or buy mode, and tips.
  • Money is integer cents everywhere. 4500 is $45.00; never send dollars into an …Cents field.

The Crossly shopping agent (buyer:agent:write)

Crossly runs its own shopping agent over real, buyable listings. Your agent can hold a conversation with it instead of writing search logic.

Endpoint SDK (crossly.agent.) Does
GET /v1/buyer/agent/sessions sessions() Conversations, newest first (id, title, turnCount)
POST /v1/buyer/agent/sessions start() New conversation; returns its id and empty brief
GET /v1/buyer/agent/sessions/{id} get(id) The brief, a summary, and every turn with its options re-read live (sold ones show as unavailable)
DELETE /v1/buyer/agent/sessions/{id} remove(id) Deletes it and what it remembered
POST /v1/buyer/agent/sessions/{id}/turns say(id, text, { imageBase64 }) What the person wants or a critique ("cheaper", "more like #2", "no logos"). Returns reply, the updated brief, and numbered options[] (n, slug, title, priceCents, facts, reason), sometimes an action
POST /v1/buyer/agent/sessions/{id}/react react(id, { slug, reaction }) like or dislike (null clears); later searches lean toward likes and drop dislikes
POST /v1/buyer/agent/sessions/{id}/act act(id, { type, slug?, amountCents? }) Act on an option, below

imageBase64 (a photo, ideally downscaled to about 1024 px) finds look-alikes; text may then be empty. Refer to options by number in later turns.

act types and the extra scope each needs (buyer:agent:write alone is not enough; the same check applies when the person asks for the action in words):

type Extra scope Effect
save buyer:wishlist:write Saves the option
cart buyer:cart:write Adds it to the cart
alert buyer:monitors:write Alert for the current search (no slug needed)
registry buyer:wishlist:write Adds it to the gift registry
price none Is it a good price, from real recent sales
offer buyer:offers:write Prepares an offer; without amountCents it suggests one from recent sales
offer_confirm buyer:offers:write Sends it, with amountCents. Only after the person agreed to that amount
buy none Returns a delivered-total quote only (quote.totalCents, cardLabel, checkoutPath) and completeWith. It never charges

To finish a buy, send the person to the quote's checkoutPath, or, only with their spending controls on and their yes, call POST /v1/buyer/checkout as described in crossly-buyer-api.

import { createBuyerClient } from '@crossly/buyer-sdk';
const crossly = createBuyerClient({ token: process.env.CROSSLY_BUYER_TOKEN! });

const s = await crossly.agent.start();
const turn = await crossly.agent.say(s.id, 'cream knit sweater, size M, under $60');
await crossly.agent.react(s.id, { slug: turn.options[1].slug, reaction: 'like' });
const prep = await crossly.agent.act(s.id, { type: 'offer', slug: turn.options[0].slug }); // suggested amount
// ...read prep back to the person, then:
await crossly.agent.act(s.id, { type: 'offer_confirm', slug: turn.options[0].slug, amountCents: 4200 });

Watching: monitors, hunts, market watches

Monitors are saved searches Crossly checks on its own timer: use them instead of polling. Each account holds up to 200.

Endpoint Scope
POST /v1/buyer/monitors buyer:monitors:write
GET /v1/buyer/monitors, GET /v1/buyer/monitors/{id}/matches buyer:monitors:read
PATCH /v1/buyer/monitors/{id} (active, name), DELETE /v1/buyer/monitors/{id} buyer:monitors:write

Body: name and kind required; kind = new_listing (a matching listing goes live), price_drop (a matching listing gets cheaper; the event has previousPriceCents) or back_in_stock (requires query.slug). query accepts only slug, q, brand, category, condition, seller, minPriceCents, maxPriceCents. delivery = webhook (default, needs a public webhookUrl; private and loopback addresses are refused) or poll (read /matches).

curl -X POST https://crossly.net/api/v1/buyer/monitors \
  -H "Authorization: Bearer $CROSSLY_BUYER_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Levi 501s under $60", "kind": "new_listing",
        "query": { "q": "levis 501", "maxPriceCents": 6000 },
        "delivery": "webhook", "webhookUrl": "https://yourapp.example/hooks/crossly" }'
  • The response's webhookSecret is shown once; store it.
  • The first sweep seeds and fires nothing, so a new monitor does not deliver the back catalogue.
  • Deliveries are { id, type, created, data } with type like buyer.monitor.price_drop and data.monitorId, kind, triggerPriceCents, listing. Headers: Crossly-Signature (t=…,v1=…, verify as in crossly-webhooks, 300 s tolerance, raw body), Crossly-Event, Crossly-Delivery-Id (dedupe; delivery is at least once). Answer 2xx within 10 s.
  • 10 failed deliveries in a row pause the monitor (active: false, pausedReason); fix the endpoint, then PATCH active: true.

Hunts (POST /v1/buyer/hunts, GET /v1/buyer/hunts, PATCH /v1/buyer/hunts/{id} with status active, paused or cancelled; buyer:monitors:*): maxPriceCents (min 100) and mode required; mode = notify, offer or buy; filters (a search) or listingSlug (one listing, sale price applied); maxBuys 1-10, days 1-90, paymentMethodId. offer and buy hunts also need buyer:checkout:write, and the budget is checked against the key's spending controls: they spend without asking again, so set one up only on the person's explicit instruction.

Market watches (POST /v1/buyer/market/watches, GET /v1/buyer/market/watches, DELETE /v1/buyer/market/watches/{id}; buyer:monitors:*): alert on a market variant at or below a price. Body variantId (uuid) required, condition, gradeKey, thresholdCents (null = any drop).

Offers

Endpoint Scope Notes
POST /v1/buyer/offers buyer:offers:write listingSlug, amountCents (min 100, below the asking price; at or above is refused: buy it instead), message (500 chars). Refused on your own listing. SDK crossly.offers.make(body, { idempotencyKey }). A retry without a key is a second offer
GET /v1/buyer/offers buyer:offers:read Last 100, newest first; filter awaitingBuyer=true. awaitingBuyer: true = a seller counter waiting on you; redeemable: true = accepted, waiting for the person to pay on Crossly; also status, expiresAt, isBundle, listedTotalCents, parentOfferId
POST /v1/buyer/offers/{id}/respond buyer:offers:write Only when awaitingBuyer: true. action = accept (opens a 48-hour window to pay; charges nothing), decline, or counter with counterCents (min 100, below the seller's price; becomes a new offer)
DELETE /v1/buyer/offers/{id} buyer:offers:write Withdraw a pending offer; an accepted one cannot be withdrawn

GET /v1/buyer/badges (buyer:profile:read) gives offersAwaitingYou, offersToPay, ordersToReview, unreadMessages: a cheap "anything need me?" check.

Lists, follows and history

  • Wishlists: GET /v1/buyer/wishlists, POST /v1/buyer/wishlists (name, 120 chars), GET /v1/buyer/wishlists/{id}/items, POST /v1/buyer/wishlists/{id}/items (listingSlug), DELETE /v1/buyer/wishlists/{id}/items/{slug}, PATCH /v1/buyer/wishlists/{id} (name, isPublic), POST /v1/buyer/wishlists/{id}/share (makes it public, returns the link), DELETE /v1/buyer/wishlists/{id}. Scopes buyer:wishlist:read / buyer:wishlist:write. SDK: wishlists.list(), items(id), create(body), addItem(id, body).
  • Followed sellers: GET /v1/buyer/following/sellers (buyer:follows:read) with newListings since last look; POST /v1/buyer/following/sellers/seen (buyer:follows:write, optional sellerUserId, else all) clears the count. These scopes cannot follow or unfollow.
  • Recently viewed: DELETE /v1/buyer/recently-viewed/{slug} or DELETE /v1/buyer/recently-viewed (buyer:history:write). The API cannot read the list.
  • Comparison signal: POST /v1/buyer/activity (buyer:activity:write): namespace (gtin, style_code, lego_set, tcgplayer, discogs, asin), value, retailHost (a domain like target.com; a URL is refused), pagePriceCents; returns whether Crossly has it and at what price. GET /v1/buyer/activity and GET /v1/buyer/preferences (buyer:activity:read) read it back; links to the person drop after 180 days.
  • Price sense (buyer:catalog:read): GET /v1/buyer/price-guide (needs q, brand or category; median and quartiles of real sales), GET /v1/buyer/anywhere (ns, value; verdict crossly_best, offsite_cheaper, offsite_only or no_match; shippingUnknown: true means say "before postage").

Cashback, gift cards, drops

  • Scout cashback: GET /v1/buyer/cashback (buyer:cashback:read, separate from orders on purpose); status = pending, confirmed, rejected, paid, expired; meta.pendingCents counts every row, not the page. pending pays nothing until the retailer's return window closes; expired is the ordinary fate of an unconverted click. SDK cashback.list({ status }).
  • Gift cards: GET /v1/buyer/gift-cards, GET /v1/buyer/gift-cards/credit (buyer:giftcards:read; meta.giftCreditCents, meta.nextExpiresAt). POST /v1/buyer/gift-cards/redeem (buyer:giftcards:write, code; 404 invalid_code, 409 already_redeemed, not_paid, void, expired). POST /v1/buyer/gift-cards (amountCents 1,000-50,000, recipientEmail, optional recipientName, message, deliverAt; Idempotency-Key required) only starts a purchase: it returns a Stripe clientSecret the person confirms. Cards expire after 5 years.
  • Drops: POST /v1/buyer/drops/{id}/join (buyer:cart:write; one entry per account, repeating returns the same entry), GET /v1/buyer/drops/{id}/me (buyer:cart:read: inLine, place, drawRank, outcome won, waitlist, expired or claimed, holdExpiresAt, checkoutPath), DELETE /v1/buyer/drops/{id}/join before the draw. A win holds the item for 15 minutes: tell the person at once and give them checkoutPath.

The buyer MCP server

@crossly/buyer-mcp (0.2.0, 114 tools) is a stdio server over the same API. It reads CROSSLY_BUYER_TOKEN (a buyer OAuth token; a crossly_pat_… is refused at startup) and optional CROSSLY_API_BASE_URL, so it can run next to the seller @crossly/mcp (which reads CROSSLY_PAT).

{
  "mcpServers": {
    "crossly-buyer": {
      "command": "npx",
      "args": ["-y", "@crossly/buyer-mcp"],
      "env": { "CROSSLY_BUYER_TOKEN": "<buyer OAuth access token>" }
    }
  }
}

Shopping tools: get_my_shopping_profile, list_my_purchases, get_my_cashback, get_my_cart, add_to_my_cart, remove_from_my_cart, quote_my_cart, list_my_wishlists, get_my_wishlist_items, create_my_wishlist, add_to_my_wishlist, offer_on_listing (listingSlug, amountCents, message), list_my_saved_cards, set_my_default_card, report_shopping_activity, list_my_shopping_activity, get_my_shopping_preferences, browse_store_listings. Agent tools: list_shopping_agent_sessions, start_shopping_agent, get_shopping_agent_session, delete_shopping_agent_session, talk_to_shopping_agent (sessionId, text up to 600 chars, imageBase64), react_to_agent_option (like, dislike, none), act_on_agent_option. The rest cover vault, wholesale, loyalty, home, companies and passports.

The server has no tools for monitors, offer lists or responses, checkout, gift cards or drops; call those endpoints over HTTP. Scopes are enforced by the API, and a refused call comes back as the API's error.

Rules

  • Propose, don't pay: offers, carts, quotes and act buy quotes; the person pays at the checkout link.
  • Read every amount back in dollars before offer_on_listing, offer_confirm or a counter; send cents.
  • Get an explicit yes, with item, total and card, before anything behind buyer:checkout:write, and never set up an offer or buy hunt unasked.
  • Prefer monitors to polling; store webhookSecret once and verify every delivery.
  • Say a cart total is a floor when taxComplete is false, and never say you bought something.

Docs: https://crossly.net/shop/docs/monitors · https://crossly.net/shop/docs/webhook-signatures · https://crossly.net/shop/docs/mcp · https://crossly.net/shop/docs/sdk · https://crossly.net/shop/docs/scopes · https://crossly.net/shop/docs/checkout-controls