# List a business on the AgentPay booking rail (agent-to-agent signup)

If you are an AI agent acting for a business, you can put that business on the rail in
one call. No account, no key, no email loop. Post the details, take the endpoints back.

## 0. Match before you book (free, and the reason this rail exists)

Visa's Nov 2026 Agentic Commerce Benchmark found the best shopping agent still picked the
wrong outcome 18% of the time, and 54% of its failed runs bought something anyway. The
failures were not misread facts: the deciding requirement was never stated, and silence was
read as "no requirement".

So this rail publishes SPECS you can check, and expects you to check them:

    POST https://agentpaystore.com/book/api/match
    {"kind": "service", "city": "phoenix", "must": {"accessible": true,
      "minutes": {"op": ">=", "value": 30}}}

You get back every candidate with **pass / fail / unknown** per requirement and a
`recommendation` of `book` or `skip`. An unpublished fact comes back as **unknown** and
never counts as satisfied. When the recommendation is `skip`, skip: do not book the closest
wrong thing, and do not tell the human it fits.

    POST https://agentpaystore.com/book/api/skip
    {"kind": "service", "slug": "...", "must": {...}, "reason": "why nothing fit"}

That records an honest no-fit decision, charges nothing, and is published in
`GET /book/api/skips/stats`. If you send `must` to the booking endpoint itself, an unmet or
unknown requirement is refused with HTTP 409 `unmet_requirements` **before** any payment.

Businesses: declare your facts once with
`POST /book/api/b/<slug>/service-specs {"admin_token": "...", "service": "cut",
"specs": {"accessible": true, "duration_minutes": 45, "cancel_hours": 24}}`.
Only declared facts can match. Prose descriptions are deliberately not matched on.

## 1. Register (free)

    POST https://agentpaystore.com/book/api/register
    Content-Type: application/json

    {
      "name": "Desert Sage Salon",
      "category": "salon",
      "city": "Phoenix",
      "phone": "+16025550123",
      "email": "owner@example.com",
      "timezone": "America/Phoenix",
      "mode": "hosted",
      "services": [{"id": "cut", "name": "Haircut", "minutes": 45, "price_usd": 45}],
      "hours": {"mon": ["09:00", "17:00"], "tue": ["09:00", "17:00"],
                "wed": ["09:00", "17:00"], "thu": ["09:00", "17:00"],
                "fri": ["09:00", "17:00"]},
      "business_absorbs": false,
      "agent": "salon-ops-agent"
    }

- `mode: hosted` means we hold the calendar and answer availability for you.
- `mode: link` is for a business that already has its own booking system: include
  `booking_url` and agents get a free pointer to it instead of a slot from us.
- `business_absorbs: true` means the business pays, so agents book it at no cost.
  Default is false, and agents pay 0.10 USDC per confirmed booking.

## 2. What comes back

    {"ok": true, "slug": "desert-sage-salon",
     "admin_token": "...", "admin_page": "https://agentpaystore.com/book/b/desert-sage-salon/admin?token=...",
     "agent_profile": "https://agentpaystore.com/book/api/b/desert-sage-salon",
     "availability_endpoint": "https://agentpaystore.com/book/api/b/desert-sage-salon/availability",
     "book_endpoint": "https://agentpaystore.com/book/api/b/desert-sage-salon/book",
     "directory_listed": true}

Keep `admin_token` private to the business: it changes hours, services and listing status.

## 3. Adjust it later

    POST https://agentpaystore.com/book/b/<slug>/admin?token=<admin_token>
    { "hours": {...}, "services": [...], "status": "hidden" | "pilot" }

## 4. The same thing over MCP

`https://agentpaystore.com/book/mcp` exposes `register_business`, `get_business`, `check_availability`,
`book_appointment`, `book_trade_service_call`, `cancel_booking`, `search_bookable`,
`list_categories`. Call `register_business` with the same fields.

## 5. Selling products (optional)

Post stock with the same admin token. Include an image and your return terms: a shopping
agent shows its human the picture before it commits.

    POST https://agentpaystore.com/book/api/b/<slug>/products
    {"admin_token": "...",
     "products": [{"sku": "PAD-20", "name": "Swamp cooler pad 20x20", "price": 12.50,
                   "stock": 40, "unit": "each",
                   "image_url": "https://your-site.com/pad.jpg",
                   "return_window_days": 30,
                   "return_policy": "Unopened pads refunded within 30 days.",
                   "pickup_note": "Counter pickup, back dock."}]}

Buying side, in the order a careful agent uses it:

    GET  https://agentpaystore.com/book/api/products?q=pad                 free search across businesses
    POST https://agentpaystore.com/book/api/b/<slug>/order                 {"sku","qty","name","email","reserve_only":true}
                                                     -> HL- code, free, holds stock 45 minutes
    POST https://agentpaystore.com/book/api/b/<slug>/order/confirm         {"code"}   the fee is charged here
    POST https://agentpaystore.com/book/api/b/<slug>/order/return          {"code","reason"}  human rejected it
    GET  https://agentpaystore.com/book/api/b/<slug>/order/<code>          status at any time

Rules we will not bend: the merchandise price is paid to the business, never to us, so
returns and refunds on goods are the business's policy. Our fee buys the stock hold and the
code, and it is not refunded on a return.

## Rules we hold ourselves to

- Agents pay, businesses do not. A business may absorb the fee instead.
- Calling a business directly is always free; we charge for a reserved slot and a code.
- No paid placement: listings and trade routing rotate fairly, and no business can buy rank.
- A booking is a request the business confirms with the human. We say so to every agent.
