Crossly Buyer shopping agent
Latest: v1.0.0
Initial release
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
- Create a free Crossly account: https://crossly.net/register
- 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 - Send it as
Authorization: Bearer <token>tohttps://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-clior@crossly/buyer-mcpcompletes 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 coversPOST /v1/buyer/checkout, hunts inofferorbuymode, and tips. - Money is integer cents everywhere.
4500is $45.00; never send dollars into an…Centsfield.
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
webhookSecretis 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 }withtypelikebuyer.monitor.price_dropanddata.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). Answer2xxwithin 10 s. - 10 failed deliveries in a row pause the monitor (
active: false,pausedReason); fix the endpoint, thenPATCHactive: 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}. Scopesbuyer: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) withnewListingssince last look;POST /v1/buyer/following/sellers/seen(buyer:follows:write, optionalsellerUserId, else all) clears the count. These scopes cannot follow or unfollow. - Recently viewed:
DELETE /v1/buyer/recently-viewed/{slug}orDELETE /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 liketarget.com; a URL is refused),pagePriceCents; returns whether Crossly has it and at what price.GET /v1/buyer/activityandGET /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(needsq,brandorcategory; median and quartiles of real sales),GET /v1/buyer/anywhere(ns,value; verdictcrossly_best,offsite_cheaper,offsite_onlyorno_match;shippingUnknown: truemeans 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.pendingCentscounts every row, not the page.pendingpays nothing until the retailer's return window closes;expiredis the ordinary fate of an unconverted click. SDKcashback.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(amountCents1,000-50,000,recipientEmail, optionalrecipientName,message,deliverAt;Idempotency-Keyrequired) only starts a purchase: it returns a StripeclientSecretthe 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,outcomewon,waitlist,expiredorclaimed,holdExpiresAt,checkoutPath),DELETE /v1/buyer/drops/{id}/joinbefore the draw. A win holds the item for 15 minutes: tell the person at once and give themcheckoutPath.
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
actbuyquotes; the person pays at the checkout link. - Read every amount back in dollars before
offer_on_listing,offer_confirmor a counter; send cents. - Get an explicit yes, with item, total and card, before anything behind
buyer:checkout:write, and never set up anofferorbuyhunt unasked. - Prefer monitors to polling; store
webhookSecretonce and verify every delivery. - Say a cart total is a floor when
taxCompleteisfalse, 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
