Developers
There are three ways to plug into Bargy: expose an MCP server, push your catalog over REST, or use Bargy's MCP servers from your own agent.
1 · Connect your MCP server
Register your MCP URL (streamable HTTP) at /merchants. Bargy will:
- call
initializeandtools/list; - pick your catalog tool (names or descriptions containing
list_products,catalog,products,services,search…) and call it with empty or default arguments; - read
structuredContentor JSON text, find the first array of objects withname/title, and mapid/sku,price(number or{amount,currency}),url,image,description,categoryandtype(service|product); - pick an order tool (
place_order,create_order,book,checkout…). When a deal closes, Bargy calls it with whichever of these arguments your schema declares:product_id, quantity, customer_name, customer_email, customer_phone, discount_code, agreed_price, total, notes, reference.
Catalogs are re-indexed every day. You can also advertise your server on your homepage with <link rel="mcp" href="https://…/mcp">, and Bargy will find it from your website URL.
// Minimal catalog tool output Bargy understands
{ "products": [ { "id": "sku-1", "name": "Trail shoe", "price": { "amount": 139, "currency": "USD" },
"url": "https://shop.example/p/sku-1", "type": "product" } ] }
2 · Push your catalog & codes (REST)
Find your API key in Dashboard → Settings & connect.
curl -X POST https://bargy.ai/api/me/products \
-H "Authorization: Bearer bk_YOUR_KEY" -H "content-type: application/json" \
-d '{"items":[{"sku":"deep-clean","name":"Deep clean (3 bed)","kind":"service","price":289,
"url":"https://you.example/book","min_discount":10,"max_discount":25}]}'
curl -X POST https://bargy.ai/api/me/codes \
-H "Authorization: Bearer bk_YOUR_KEY" -H "content-type: application/json" \
-d '{"text":"SAVE10,10\nSAVE20,20\nVIP-ONCE-1,25,single"}'
Items are upserted by sku/external_id. A price of null means "on quote", and Bargy negotiates a percentage off your quote.
Webhook fulfillment
With fulfillment set to webhook, Bargy POSTs a deal.created event for each deal:
{ "type": "deal.created",
"deal": { "id": "deal_…", "quantity": 1, "currency": "USD", "list_price": 289, "unit_price": 231.2,
"total": 231.2, "discount_pct": 20, "code": "SAVE20", "customer_name": "…", "customer_email": "…", "notes": "…" },
"item": { "id": "itm_…", "external_id": "deep-clean", "name": "Deep clean (3 bed)", "url": "…" } }
3 · Use Bargy from any agent
Marketplace MCP
Tools: search_deals, get_item, negotiate, accept_deal, get_deal_status. No auth. Includes ChatGPT Apps SDK widget metadata.
Per-merchant generated MCP layer
The same tools, scoped to one merchant (search_catalog instead of search_deals). Directory: /api/merchants.
Negotiation rules
- Each item has a private range: an instant discount (where Bargy opens) and a maximum (never exceeded or revealed).
- Without leverage, auto-negotiation closes about 75% of the way from instant to maximum. Quantity (2+, 5+), being ready to buy now, and a lower competitor price each move it closer, and full leverage reaches the maximum.
- Manual offers are countered with shrinking concessions over 4 rounds, ending in a final offer. Offers at or below what the merchant will accept are taken immediately.
- When a deal closes, Bargy gives out the smallest discount code that covers the agreed discount without going above the merchant's maximum, and the deal price rounds to that code's tier. If no code fits, the merchant is asked to honour the agreed price.
Public REST
GET /api/search?q=headphones&max_price=250&kind=product
GET /api/items/:id
POST /api/negotiate {"item_id":"itm_…","auto":true,"quantity":2,"buy_now":true}
POST /api/negotiate {"negotiation_id":"neg_…","offer_price":110}
POST /api/deals {"negotiation_id":"neg_…","customer_name":"…","customer_email":"…"}
GET /api/deals/:id?t=TOKEN