
Monkey Bike Rental
วันนี้: 08:00 - 07:59 น.
Bike rental 24 Hr. 200bath/day
4
AI Orders
0
AI Agents
1
Menu Items
Menu
Bike-rental
฿200
How AI Agents Order (AICP v1)
REST / JSON · RFC 9421- 1
Read the platform discovery document
GET https://pugmod.com/.well-known/pugmod.json - 2
Discover this store (no auth)
GET https://pugmod.com/api/v1/commerce/store/34b14c74-833e-4b7a-98b6-82b2ae7a34c4/capabilities · /menu · /order-schema - 3
Register once and persist the keyMerchant approval
POST https://pugmod.com/api/v1/commerce/store/34b14c74-833e-4b7a-98b6-82b2ae7a34c4/agents/register - 4
Wait for approval (APPROVED / EXPIRED / REVOKED)
GET https://pugmod.com/api/v1/commerce/store/34b14c74-833e-4b7a-98b6-82b2ae7a34c4/agents/me - 5
Place an idempotent order
POST https://pugmod.com/api/v1/commerce/store/34b14c74-833e-4b7a-98b6-82b2ae7a34c4/orders - 6
AICP Integration Guide
Machine-readable source of truth: https://pugmod.com/.well-known/pugmod.json (endpoints, signature profile, webhook keys). The examples below follow it.
กฎสำหรับ AI Agent (Agent rules)
- Register once. เก็บ api_key ไว้ถาวร ห้ามเรียก /agents/register ซ้ำ แม้ได้ 403 agent_pending_approval / agent_key_expired ให้เช็ก GET /agents/me แทน
- Keys expire daily. key หมดอายุเที่ยงคืน (Asia/Bangkok) ร้านกด "ต่ออายุ" แล้วใช้ key เดิมต่อได้ทันที REVOKED = ร้านเพิกถอน หยุดใช้
- Idempotency-Key on every POST. UUID v4 ใหม่ทุกคำสั่ง (8–128 ตัว A-Z a-z 0-9 . _ : -) ส่งซ้ำด้วย key เดิมได้ผลเดิม ไม่ตัดสต็อกซ้ำ
- Server prices win. ใช้ item id จาก /menu ราคาและยอดรวมคำนวณที่เซิร์ฟเวอร์เสมอ ค่าที่ agent ส่งมาไม่ถูกใช้
- Delivery needs the buyer. agent สร้างออเดอร์จัดส่งเองไม่ได้: เรียก /orders/prepare แล้วส่ง continue_url ให้ผู้ซื้อ login และยืนยัน (อายุ ≤ 1 ชม.)
- Signatures (recommended). ผูก signing_jwk (ES256/Ed25519) แล้วทุกคำขอต้องเซ็น RFC 9421: @method @authority @path (+@query, content-digest, content-type, idempotency-key)
- Rate limits. GET /orders/<id> 60/นาที, /agents/me 30/นาที ใช้ webhook แทนการ poll ถี่ ๆ
1Register (one time)
Optional: signing_jwk + webhook_urlOptional fields: signing_jwk (public JWK; sign this request with it) and webhook_url (must echo the signed webhook.verification challenge).
curl -X POST https://pugmod.com/api/v1/commerce/store/34b14c74-833e-4b7a-98b6-82b2ae7a34c4/agents/register \
-H "Content-Type: application/json" \
-d '{ "agent_name": "MyAssistantAI", "scopes": ["order:create", "order:read"] }'
# 201 → { "agent_id": "...", "api_key": "pgm_...", "approval_status": "PENDING", ... }
# Save api_key now. It is shown only once.Powered by Pugmod AI Commerce Engine