MR.Coffee
AI-Powered Shopdrinksยังไม่เช็คอิน

MR.Coffee

AI Coffee 40 Bath

0

AI Orders

0

AI Agents

2

Menu Items

Menu

Matcha

เครื่องดื่ม

Sold Out

฿45

Espresso

เครื่องดื่ม

฿45

Latte

เครื่องดื่ม

฿45

Americano

Drinks

Sold Out

฿40

How AI Agents Order (AICP V1)

REST / JSON
1

Discover Store Capabilities (Layer 1)

GET https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/capabilities
2

Fetch the Active Contract (Layer 2)

GET https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/order-schema?intent=order
3

Register AI Agent & Get API Key

POST https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/agents/register
4

Browse Catalog & Keep Stable Item IDs

GET https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/menu
5

Validate Answers & Place an Idempotent Order

POST https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/orders
6

Create Payment Action (When Advertised)

POST https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/orders/<order_id>/payment
7

Track Live Order Status

GET https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/track/<order_id>

Complete AICP Integration Guide

Follow these verified commands in sequence. Ensure your AI agent registers once, discovers store capabilities, and uses the correct payload format to avoid rate limits.

⚠️ Essential Rules to Prevent 404 & 429 Errors:

  • Do not send dummy “answers” for standard menu orders: For food/drink items (intent: order), send only items. Sending fake answers when no contract is configured causes 404 schema_not_found.
  • For Bookings & Rentals: You must discover an open slot via GET /availability and include its slot_id.
  • Idempotency-Key header is mandatory: Provide a unique UUID v4 header (Idempotency-Key: <UUID>) for all POST orders.
  • Rate Limits: Registration is capped at 5 req/hour; transaction dispatch is capped at 60 req/min.

1Register AI Agent (Get API Key)

One-time per agent
curl -X POST https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/agents/register \
  -H "Content-Type: application/json" \
  -d '{
    "agent_name": "MyAssistantAI",
    "scopes": ["order:create", "order:read"]
  }'

# Response:
# {
#   "success": true,
#   "agent_id": "...",
#   "api_key": "pgm_live_...",
#   "note": "Save this key now. It is never displayed again."
# }

2Discover Capabilities & Catalog

Public (No Auth Required)
# Check supported workflows (menu ordering, booking, payments, etc.)
curl "https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/capabilities"

# Fetch active menu items & stable UUIDs
curl "https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/menu"

3APlace Menu Item Order (Intent: “order”)

Food & Catalog

For ordering dishes, drinks, or goods. Use real item IDs from /menu. Do not send answers unless an order contract is configured.

curl -X POST https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/orders \
  -H "Authorization: Bearer pgm_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen || python3 -c 'import uuid; print(uuid.uuid4())')" \
  -d '{
    "intent": "order",
    "items": [
      {
        "id": "b55f0287-2c63-4690-a170-47a965925183",
        "quantity": 1
      }
    ],
    "notes": "Please prepare without spicy"
  }'

4Payment & Live Tracking

Post-Transaction
# A. Create Payment Intent (PromptPay QR or Cash on delivery)
curl -X POST https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/orders/<ORDER_ID>/payment \
  -H "Authorization: Bearer pgm_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider": "promptpay"}'

# B. Track Live Status
curl -H "Authorization: Bearer pgm_YOUR_API_KEY" \
  "https://pugmod.com/api/v1/commerce/store/6367b260-da9f-4e8d-8f3b-e201c59c7a23/track/<ORDER_ID>"

Powered by Pugmod AI Commerce Engine