# StableCoffee Order Placement

> StableCoffee Order Placement is a paid API for AI agents from stablecoffee.dev, paid per call via x402, $50/call, status unknown (last checked 2026-09-14).

Places a coffee order at a Williamsburg, Manhattan, or San Francisco store via x402 USDC payment on Base, returning a job ID and poll URL to track fulfillment.

## Facts

- Endpoint: POST https://stablecoffee.dev/api/coffee/%7BsessionId%7D/order
- Price: $50/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/stablecoffee-order-placement-5820727a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QRek8bHdSVtTjOXPW3ZjZ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability stablecoffee-order-placement-5820727a -d '<json body>'
```

Example prompt: Order me a cortado from the Williamsburg StableCoffee store — session abc123, store store_wburg_01, item cortado_sm — my name is Jamie Lee, phone 917-555-0192, email jamie@example.com, and the expected total is 6.50.

## When to prefer this

Use this endpoint when the agent has already completed a StableCoffee discovery and quote flow (has a valid session_id, store_id, and item_id) and is ready to finalize the purchase. It is the correct endpoint for committing a coffee order with USDC payment on Base via the x402 protocol. Prefer this over generic food-delivery APIs when the user explicitly wants to pay with crypto or the workflow is part of an autonomous agent pipeline in Williamsburg, Manhattan, or San Francisco.

## Known failure modes

- Missing required buyer fields (name, phone, email) returns a 400 validation error
- Invalid or expired session_id causes order rejection
- expected_total mismatch with server-computed price may cause a 402 or rejection
- store_id or item_id not found in the store catalogue returns a 404-style error
- Payment failure via x402 (insufficient USDC balance or wrong chain) blocks order creation
- Malformed email format fails schema validation before submission

## How this service works

Williamsburg, Manhattan, and San Francisco coffee delivery for your Agent — discover, quote, and order via x402 USDC on Base.

## Output

Returns a JSON object confirming the order was accepted, including: success (true), a unique jobId, status set to 'pending', a pollUrl (URI) to check order progress, the order type ('coffee.place'), and the sessionId. The agent should poll the provided URL to track fulfillment status.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "item_id": {
   "type": "string",
   "minLength": 1
  },
  "store_id": {
   "type": "string",
   "minLength": 1
  },
  "buyer_name": {
   "type": "string",
   "minLength": 2
  },
  "session_id": {
   "type": "string",
   "minLength": 1
  },
  "buyer_email": {
   "type": "string",
   "format": "email",
   "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
  },
  "buyer_phone": {
   "type": "string",
   "minLength": 7
  },
  "delivery_notes": {
   "type": "string"
  },
  "expected_total": {
   "type": "string",
   "pattern": "^\\d+\\.\\d{2}$"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "type": "coffee.place",
  "jobId": "clxyz123",
  "status": "pending",
  "pollUrl": "http://localhost:3000/api/jobs/clxyz123",
  "success": true,
  "sessionId": "clsession123"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/stablecoffee-order-placement-5820727a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from stablecoffee.dev](https://www.zero.xyz/host/stablecoffee.dev/llms.txt)
