{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agentic-commerce",
    "name": "Agentic Commerce - Buy IRL Items With USDC",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/purch-agent/agentic-commerce",
    "canonicalUrl": "https://clawhub.ai/purch-agent/agentic-commerce",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agentic-commerce",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agentic-commerce",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "scripts/buy_and_sign.ts",
      "scripts/sign_transaction.py",
      "scripts/shop.ts",
      "scripts/buy.ts",
      "scripts/search.ts",
      "scripts/search.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agentic-commerce"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/agentic-commerce",
    "agentPageUrl": "https://openagent3.xyz/skills/agentic-commerce/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agentic-commerce/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agentic-commerce/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Purch Public API",
        "body": "Base URL: https://api.purch.xyz"
      },
      {
        "title": "Rate Limits",
        "body": "60 requests/minute per IP. Headers in every response:\n\nX-RateLimit-Limit: Max requests per window\nX-RateLimit-Remaining: Requests left\nX-RateLimit-Reset: Seconds until reset"
      },
      {
        "title": "GET /search - Structured Product Search",
        "body": "Query products with filters.\n\ncurl \"https://api.purch.xyz/search?q=headphones&priceMax=100\"\n\nParameters:\n\nParamTypeRequiredDescriptionqstringYesSearch querypriceMinnumberNoMinimum pricepriceMaxnumberNoMaximum pricebrandstringNoFilter by brandpagenumberNoPage number (default: 1)\n\nResponse:\n\n{\n  \"products\": [\n    {\n      \"id\": \"B0CXYZ1234\",\n      \"title\": \"Sony WH-1000XM5\",\n      \"price\": 348.00,\n      \"currency\": \"USD\",\n      \"rating\": 4.8,\n      \"reviewCount\": 15420,\n      \"imageUrl\": \"https://...\",\n      \"productUrl\": \"https://amazon.com/dp/B0CXYZ1234\",\n      \"source\": \"amazon\"\n    }\n  ],\n  \"totalResults\": 20,\n  \"page\": 1,\n  \"hasMore\": true\n}"
      },
      {
        "title": "POST /shop - AI Shopping Assistant",
        "body": "Natural language product search. Returns 20+ products from both Amazon and Shopify.\n\ncurl -X POST \"https://api.purch.xyz/shop\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"message\": \"comfortable running shoes under $100\"}'\n\nRequest Body:\n\n{\n  \"message\": \"comfortable running shoes under $100\",\n  \"context\": {\n    \"priceRange\": { \"min\": 0, \"max\": 100 },\n    \"preferences\": [\"comfortable\", \"breathable\"]\n  }\n}\n\nResponse:\n\n{\n  \"reply\": \"Found 22 running shoes. Top pick: Nike Revolution 6 at $65...\",\n  \"products\": [\n    {\n      \"asin\": \"B09XYZ123\",\n      \"title\": \"Nike Revolution 6\",\n      \"price\": 65.00,\n      \"currency\": \"USD\",\n      \"rating\": 4.5,\n      \"reviewCount\": 8420,\n      \"imageUrl\": \"https://...\",\n      \"productUrl\": \"https://amazon.com/dp/B09XYZ123\",\n      \"source\": \"amazon\"\n    },\n    {\n      \"asin\": \"gid://shopify/p/abc123\",\n      \"title\": \"Allbirds Tree Runners\",\n      \"price\": 98.00,\n      \"source\": \"shopify\",\n      \"productUrl\": \"https://allbirds.com/products/tree-runners\",\n      \"vendor\": \"Allbirds\"\n    }\n  ]\n}"
      },
      {
        "title": "POST /buy - Create Purchase Order",
        "body": "Create an order and get a transaction to sign. Chain is auto-detected from wallet format:\n\nSolana wallet (base58): 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\nBase/EVM wallet (0x): 0x1234567890abcdef1234567890abcdef12345678\n\nAmazon Products (Solana):\n\ncurl -X POST \"https://api.purch.xyz/buy\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"asin\": \"B0CXYZ1234\",\n    \"email\": \"buyer@example.com\",\n    \"walletAddress\": \"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\",\n    \"shippingAddress\": {\n      \"name\": \"John Doe\",\n      \"line1\": \"123 Main St\",\n      \"line2\": \"Apt 4B\",\n      \"city\": \"New York\",\n      \"state\": \"NY\",\n      \"postalCode\": \"10001\",\n      \"country\": \"US\",\n      \"phone\": \"+1-555-123-4567\"\n    }\n  }'\n\nAmazon Products (Base):\n\ncurl -X POST \"https://api.purch.xyz/buy\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"asin\": \"B0CXYZ1234\",\n    \"email\": \"buyer@example.com\",\n    \"walletAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n    \"shippingAddress\": {\n      \"name\": \"John Doe\",\n      \"line1\": \"123 Main St\",\n      \"city\": \"New York\",\n      \"state\": \"NY\",\n      \"postalCode\": \"10001\",\n      \"country\": \"US\"\n    }\n  }'\n\nShopify Products - Use productUrl AND variantId:\n\ncurl -X POST \"https://api.purch.xyz/buy\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"productUrl\": \"https://store.com/products/item-name\",\n    \"variantId\": \"41913945718867\",\n    \"email\": \"buyer@example.com\",\n    \"walletAddress\": \"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\",\n    \"shippingAddress\": {\n      \"name\": \"John Doe\",\n      \"line1\": \"123 Main St\",\n      \"city\": \"New York\",\n      \"state\": \"NY\",\n      \"postalCode\": \"10001\",\n      \"country\": \"US\"\n    }\n  }'\n\nResponse:\n\n{\n  \"orderId\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"status\": \"awaiting-payment\",\n  \"serializedTransaction\": \"NwbtPCP62oXk5fmSrgT...\",\n  \"product\": {\n    \"title\": \"Sony WH-1000XM5\",\n    \"imageUrl\": \"https://...\",\n    \"price\": { \"amount\": \"348.00\", \"currency\": \"usdc\" }\n  },\n  \"totalPrice\": { \"amount\": \"348.00\", \"currency\": \"usdc\" },\n  \"checkoutUrl\": \"https://www.crossmint.com/checkout/550e8400...\"\n}"
      },
      {
        "title": "CLI Scripts",
        "body": "This skill includes ready-to-use CLI scripts for all endpoints. Available in Python and TypeScript/Bun.\n\nDependencies (Solana):\n\n# Python\npip install solana solders base58\n\n# TypeScript/Bun\nbun add @solana/web3.js bs58\n\nDependencies (Base/EVM):\n\n# TypeScript/Bun\nbun add viem"
      },
      {
        "title": "Search Products",
        "body": "# Python\npython scripts/search.py \"wireless headphones\" --price-max 100\npython scripts/search.py \"running shoes\" --brand Nike --page 2\n\n# TypeScript\nbun run scripts/search.ts \"wireless headphones\" --price-max 100"
      },
      {
        "title": "AI Shopping Assistant",
        "body": "# Python\npython scripts/shop.py \"comfortable running shoes under $100\"\n\n# TypeScript\nbun run scripts/shop.ts \"wireless headphones with good noise cancellation\""
      },
      {
        "title": "Create Order (without signing)",
        "body": "# Amazon by ASIN\npython scripts/buy.py --asin B0CXYZ1234 --email buyer@example.com \\\n  --wallet 7xKXtg... --address \"John Doe,123 Main St,New York,NY,10001,US\"\n\n# Shopify product\nbun run scripts/buy.ts --url \"https://store.com/products/item\" --variant 41913945718867 \\\n  --email buyer@example.com --wallet 7xKXtg... --address \"John Doe,123 Main St,NYC,NY,10001,US\"\n\nAddress format: Name,Line1,City,State,PostalCode,Country[,Line2][,Phone]"
      },
      {
        "title": "Create Order AND Sign Transaction (Solana)",
        "body": "End-to-end purchase flow - creates order and signs/submits the Solana transaction:\n\n# Python\npython scripts/buy_and_sign.py --asin B0CXYZ1234 --email buyer@example.com \\\n  --wallet 7xKXtg... --private-key 5abc123... \\\n  --address \"John Doe,123 Main St,New York,NY,10001,US\"\n\n# TypeScript\nbun run scripts/buy_and_sign.ts --url \"https://store.com/products/item\" --variant 41913945718867 \\\n  --email buyer@example.com --wallet 7xKXtg... --private-key 5abc123... \\\n  --address \"John Doe,123 Main St,NYC,NY,10001,US\""
      },
      {
        "title": "Create Order AND Sign Transaction (Base)",
        "body": "End-to-end purchase flow using Base/EVM wallet:\n\nbun run scripts/buy_and_sign_base.ts --asin B0CXYZ1234 --email buyer@example.com \\\n  --wallet 0x1234567890abcdef1234567890abcdef12345678 \\\n  --private-key 0xabc123... \\\n  --address \"John Doe,123 Main St,New York,NY,10001,US\""
      },
      {
        "title": "Sign Transaction Only (Solana)",
        "body": "If you already have a serializedTransaction from the /buy endpoint:\n\n# Python\npython scripts/sign_transaction.py \"<serialized_tx>\" \"<private_key_base58>\"\n\n# TypeScript\nbun run scripts/sign_transaction.ts \"<serialized_tx>\" \"<private_key_base58>\""
      },
      {
        "title": "Sign Transaction Only (Base)",
        "body": "bun run scripts/sign_transaction_base.ts \"<serialized_tx_hex>\" \"<private_key_hex>\"\n\nOutput (Solana):\n\n✅ Transaction successful!\n   Signature: 5UfgJ3vN...\n   Explorer:  https://solscan.io/tx/5UfgJ3vN...\n\nOutput (Base):\n\n✅ Transaction successful!\n   Hash:     0x1234...\n   Explorer: https://basescan.org/tx/0x1234..."
      },
      {
        "title": "Signing Transactions Programmatically",
        "body": "For custom integrations without using the bundled scripts:"
      },
      {
        "title": "JavaScript/TypeScript",
        "body": "import { Connection, Transaction, clusterApiUrl } from \"@solana/web3.js\";\nimport bs58 from \"bs58\";\n\nasync function signAndSendTransaction(\n  serializedTransaction: string,\n  wallet: { signTransaction: (tx: Transaction) => Promise<Transaction> }\n) {\n  // Decode the base58 transaction\n  const transactionBuffer = bs58.decode(serializedTransaction);\n  const transaction = Transaction.from(transactionBuffer);\n\n  // Sign with user's wallet (e.g., Phantom, Solflare)\n  const signedTransaction = await wallet.signTransaction(transaction);\n\n  // Send to Solana network\n  const connection = new Connection(clusterApiUrl(\"mainnet-beta\"));\n  const signature = await connection.sendRawTransaction(\n    signedTransaction.serialize()\n  );\n\n  // Confirm transaction\n  await connection.confirmTransaction(signature, \"confirmed\");\n\n  return signature;\n}"
      },
      {
        "title": "React with Wallet Adapter",
        "body": "import { useWallet, useConnection } from \"@solana/wallet-adapter-react\";\nimport { Transaction } from \"@solana/web3.js\";\nimport bs58 from \"bs58\";\n\nfunction CheckoutButton({ serializedTransaction }: { serializedTransaction: string }) {\n  const { signTransaction, publicKey } = useWallet();\n  const { connection } = useConnection();\n\n  const handlePayment = async () => {\n    if (!signTransaction || !publicKey) {\n      throw new Error(\"Wallet not connected\");\n    }\n\n    // Decode and sign\n    const tx = Transaction.from(bs58.decode(serializedTransaction));\n    const signed = await signTransaction(tx);\n\n    // Send and confirm\n    const sig = await connection.sendRawTransaction(signed.serialize());\n    await connection.confirmTransaction(sig, \"confirmed\");\n\n    console.log(\"Payment complete:\", sig);\n  };\n\n  return <button onClick={handlePayment}>Pay with USDC</button>;\n}"
      },
      {
        "title": "Python (with solana-py)",
        "body": "import base58\nfrom solana.rpc.api import Client\nfrom solana.transaction import Transaction\nfrom solders.keypair import Keypair\n\ndef sign_and_send(serialized_tx: str, keypair: Keypair) -> str:\n    # Decode base58 transaction\n    tx_bytes = base58.b58decode(serialized_tx)\n    transaction = Transaction.deserialize(tx_bytes)\n\n    # Sign\n    transaction.sign(keypair)\n\n    # Send\n    client = Client(\"https://api.mainnet-beta.solana.com\")\n    result = client.send_transaction(transaction)\n\n    return result.value  # transaction signature"
      },
      {
        "title": "Signing Base/EVM Transactions",
        "body": "For Base chain orders, the serializedTransaction is an EVM transaction that needs to be signed with an EVM wallet."
      },
      {
        "title": "TypeScript with viem",
        "body": "import { createWalletClient, http, parseTransaction } from \"viem\";\nimport { base } from \"viem/chains\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nasync function signAndSendBaseTransaction(\n  serializedTransaction: string,\n  privateKey: `0x${string}`\n) {\n  const account = privateKeyToAccount(privateKey);\n\n  const client = createWalletClient({\n    account,\n    chain: base,\n    transport: http(),\n  });\n\n  // Parse and send the serialized transaction\n  const tx = parseTransaction(serializedTransaction as `0x${string}`);\n  const hash = await client.sendTransaction(tx);\n\n  console.log(\"Transaction hash:\", hash);\n  console.log(\"Explorer: https://basescan.org/tx/\" + hash);\n\n  return hash;\n}"
      },
      {
        "title": "React with wagmi",
        "body": "import { useSendTransaction } from \"wagmi\";\nimport { parseTransaction } from \"viem\";\n\nfunction CheckoutButton({ serializedTransaction }: { serializedTransaction: string }) {\n  const { sendTransaction } = useSendTransaction();\n\n  const handlePayment = async () => {\n    const tx = parseTransaction(serializedTransaction as `0x${string}`);\n    sendTransaction(tx);\n  };\n\n  return <button onClick={handlePayment}>Pay with USDC on Base</button>;\n}"
      },
      {
        "title": "Complete Checkout Flow (Solana)",
        "body": "// 1. Search for products\nconst searchResponse = await fetch(\"https://api.purch.xyz/shop\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({ message: \"wireless headphones under $100\" })\n});\nconst { products, reply } = await searchResponse.json();\n\n// 2. User selects a product, create order (Solana wallet)\nconst orderResponse = await fetch(\"https://api.purch.xyz/buy\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\n    asin: products[0].asin,\n    email: \"buyer@example.com\",\n    walletAddress: wallet.publicKey.toBase58(), // Solana address\n    shippingAddress: {\n      name: \"John Doe\",\n      line1: \"123 Main St\",\n      city: \"New York\",\n      state: \"NY\",\n      postalCode: \"10001\",\n      country: \"US\"\n    }\n  })\n});\nconst { orderId, serializedTransaction, checkoutUrl } = await orderResponse.json();\n\n// 3. Sign and send Solana transaction\nconst tx = Transaction.from(bs58.decode(serializedTransaction));\nconst signed = await wallet.signTransaction(tx);\nconst signature = await connection.sendRawTransaction(signed.serialize());\nawait connection.confirmTransaction(signature, \"confirmed\");\n\nconsole.log(`Order ${orderId} paid. Tx: ${signature}`);"
      },
      {
        "title": "Complete Checkout Flow (Base)",
        "body": "import { parseTransaction } from \"viem\";\n\n// 1. Search for products\nconst searchResponse = await fetch(\"https://api.purch.xyz/shop\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({ message: \"wireless headphones under $100\" })\n});\nconst { products } = await searchResponse.json();\n\n// 2. User selects a product, create order (EVM wallet)\nconst orderResponse = await fetch(\"https://api.purch.xyz/buy\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\n    asin: products[0].asin,\n    email: \"buyer@example.com\",\n    walletAddress: \"0x1234...\", // Base/EVM address - chain auto-detected\n    shippingAddress: {\n      name: \"John Doe\",\n      line1: \"123 Main St\",\n      city: \"New York\",\n      state: \"NY\",\n      postalCode: \"10001\",\n      country: \"US\"\n    }\n  })\n});\nconst { orderId, serializedTransaction } = await orderResponse.json();\n\n// 3. Sign and send Base transaction\nconst tx = parseTransaction(serializedTransaction as `0x${string}`);\nconst hash = await walletClient.sendTransaction(tx);\n\nconsole.log(`Order ${orderId} paid. Tx: ${hash}`);"
      },
      {
        "title": "Fallback: Browser Checkout",
        "body": "If wallet signing fails or isn't available, redirect to checkoutUrl for browser-based payment:\n\nif (!wallet.connected) {\n  window.open(checkoutUrl, \"_blank\");\n}"
      },
      {
        "title": "Error Handling",
        "body": "All endpoints return errors as:\n\n{\n  \"code\": \"VALIDATION_ERROR\",\n  \"message\": \"Invalid email format\",\n  \"details\": { \"field\": \"email\" }\n}\n\nCommon error codes:\n\nVALIDATION_ERROR (400) - Invalid request parameters\nNOT_FOUND (404) - Product not found\nRATE_LIMITED (429) - Too many requests\nINTERNAL_ERROR (500) - Server error"
      }
    ],
    "body": "Purch Public API\n\nBase URL: https://api.purch.xyz\n\nRate Limits\n\n60 requests/minute per IP. Headers in every response:\n\nX-RateLimit-Limit: Max requests per window\nX-RateLimit-Remaining: Requests left\nX-RateLimit-Reset: Seconds until reset\nEndpoints\nGET /search - Structured Product Search\n\nQuery products with filters.\n\ncurl \"https://api.purch.xyz/search?q=headphones&priceMax=100\"\n\n\nParameters:\n\nParam\tType\tRequired\tDescription\nq\tstring\tYes\tSearch query\npriceMin\tnumber\tNo\tMinimum price\npriceMax\tnumber\tNo\tMaximum price\nbrand\tstring\tNo\tFilter by brand\npage\tnumber\tNo\tPage number (default: 1)\n\nResponse:\n\n{\n  \"products\": [\n    {\n      \"id\": \"B0CXYZ1234\",\n      \"title\": \"Sony WH-1000XM5\",\n      \"price\": 348.00,\n      \"currency\": \"USD\",\n      \"rating\": 4.8,\n      \"reviewCount\": 15420,\n      \"imageUrl\": \"https://...\",\n      \"productUrl\": \"https://amazon.com/dp/B0CXYZ1234\",\n      \"source\": \"amazon\"\n    }\n  ],\n  \"totalResults\": 20,\n  \"page\": 1,\n  \"hasMore\": true\n}\n\nPOST /shop - AI Shopping Assistant\n\nNatural language product search. Returns 20+ products from both Amazon and Shopify.\n\ncurl -X POST \"https://api.purch.xyz/shop\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"message\": \"comfortable running shoes under $100\"}'\n\n\nRequest Body:\n\n{\n  \"message\": \"comfortable running shoes under $100\",\n  \"context\": {\n    \"priceRange\": { \"min\": 0, \"max\": 100 },\n    \"preferences\": [\"comfortable\", \"breathable\"]\n  }\n}\n\n\nResponse:\n\n{\n  \"reply\": \"Found 22 running shoes. Top pick: Nike Revolution 6 at $65...\",\n  \"products\": [\n    {\n      \"asin\": \"B09XYZ123\",\n      \"title\": \"Nike Revolution 6\",\n      \"price\": 65.00,\n      \"currency\": \"USD\",\n      \"rating\": 4.5,\n      \"reviewCount\": 8420,\n      \"imageUrl\": \"https://...\",\n      \"productUrl\": \"https://amazon.com/dp/B09XYZ123\",\n      \"source\": \"amazon\"\n    },\n    {\n      \"asin\": \"gid://shopify/p/abc123\",\n      \"title\": \"Allbirds Tree Runners\",\n      \"price\": 98.00,\n      \"source\": \"shopify\",\n      \"productUrl\": \"https://allbirds.com/products/tree-runners\",\n      \"vendor\": \"Allbirds\"\n    }\n  ]\n}\n\nPOST /buy - Create Purchase Order\n\nCreate an order and get a transaction to sign. Chain is auto-detected from wallet format:\n\nSolana wallet (base58): 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\nBase/EVM wallet (0x): 0x1234567890abcdef1234567890abcdef12345678\n\nAmazon Products (Solana):\n\ncurl -X POST \"https://api.purch.xyz/buy\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"asin\": \"B0CXYZ1234\",\n    \"email\": \"buyer@example.com\",\n    \"walletAddress\": \"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\",\n    \"shippingAddress\": {\n      \"name\": \"John Doe\",\n      \"line1\": \"123 Main St\",\n      \"line2\": \"Apt 4B\",\n      \"city\": \"New York\",\n      \"state\": \"NY\",\n      \"postalCode\": \"10001\",\n      \"country\": \"US\",\n      \"phone\": \"+1-555-123-4567\"\n    }\n  }'\n\n\nAmazon Products (Base):\n\ncurl -X POST \"https://api.purch.xyz/buy\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"asin\": \"B0CXYZ1234\",\n    \"email\": \"buyer@example.com\",\n    \"walletAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n    \"shippingAddress\": {\n      \"name\": \"John Doe\",\n      \"line1\": \"123 Main St\",\n      \"city\": \"New York\",\n      \"state\": \"NY\",\n      \"postalCode\": \"10001\",\n      \"country\": \"US\"\n    }\n  }'\n\n\nShopify Products - Use productUrl AND variantId:\n\ncurl -X POST \"https://api.purch.xyz/buy\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"productUrl\": \"https://store.com/products/item-name\",\n    \"variantId\": \"41913945718867\",\n    \"email\": \"buyer@example.com\",\n    \"walletAddress\": \"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\",\n    \"shippingAddress\": {\n      \"name\": \"John Doe\",\n      \"line1\": \"123 Main St\",\n      \"city\": \"New York\",\n      \"state\": \"NY\",\n      \"postalCode\": \"10001\",\n      \"country\": \"US\"\n    }\n  }'\n\n\nResponse:\n\n{\n  \"orderId\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"status\": \"awaiting-payment\",\n  \"serializedTransaction\": \"NwbtPCP62oXk5fmSrgT...\",\n  \"product\": {\n    \"title\": \"Sony WH-1000XM5\",\n    \"imageUrl\": \"https://...\",\n    \"price\": { \"amount\": \"348.00\", \"currency\": \"usdc\" }\n  },\n  \"totalPrice\": { \"amount\": \"348.00\", \"currency\": \"usdc\" },\n  \"checkoutUrl\": \"https://www.crossmint.com/checkout/550e8400...\"\n}\n\nCLI Scripts\n\nThis skill includes ready-to-use CLI scripts for all endpoints. Available in Python and TypeScript/Bun.\n\nDependencies (Solana):\n\n# Python\npip install solana solders base58\n\n# TypeScript/Bun\nbun add @solana/web3.js bs58\n\n\nDependencies (Base/EVM):\n\n# TypeScript/Bun\nbun add viem\n\nSearch Products\n# Python\npython scripts/search.py \"wireless headphones\" --price-max 100\npython scripts/search.py \"running shoes\" --brand Nike --page 2\n\n# TypeScript\nbun run scripts/search.ts \"wireless headphones\" --price-max 100\n\nAI Shopping Assistant\n# Python\npython scripts/shop.py \"comfortable running shoes under $100\"\n\n# TypeScript\nbun run scripts/shop.ts \"wireless headphones with good noise cancellation\"\n\nCreate Order (without signing)\n# Amazon by ASIN\npython scripts/buy.py --asin B0CXYZ1234 --email buyer@example.com \\\n  --wallet 7xKXtg... --address \"John Doe,123 Main St,New York,NY,10001,US\"\n\n# Shopify product\nbun run scripts/buy.ts --url \"https://store.com/products/item\" --variant 41913945718867 \\\n  --email buyer@example.com --wallet 7xKXtg... --address \"John Doe,123 Main St,NYC,NY,10001,US\"\n\n\nAddress format: Name,Line1,City,State,PostalCode,Country[,Line2][,Phone]\n\nCreate Order AND Sign Transaction (Solana)\n\nEnd-to-end purchase flow - creates order and signs/submits the Solana transaction:\n\n# Python\npython scripts/buy_and_sign.py --asin B0CXYZ1234 --email buyer@example.com \\\n  --wallet 7xKXtg... --private-key 5abc123... \\\n  --address \"John Doe,123 Main St,New York,NY,10001,US\"\n\n# TypeScript\nbun run scripts/buy_and_sign.ts --url \"https://store.com/products/item\" --variant 41913945718867 \\\n  --email buyer@example.com --wallet 7xKXtg... --private-key 5abc123... \\\n  --address \"John Doe,123 Main St,NYC,NY,10001,US\"\n\nCreate Order AND Sign Transaction (Base)\n\nEnd-to-end purchase flow using Base/EVM wallet:\n\nbun run scripts/buy_and_sign_base.ts --asin B0CXYZ1234 --email buyer@example.com \\\n  --wallet 0x1234567890abcdef1234567890abcdef12345678 \\\n  --private-key 0xabc123... \\\n  --address \"John Doe,123 Main St,New York,NY,10001,US\"\n\nSign Transaction Only (Solana)\n\nIf you already have a serializedTransaction from the /buy endpoint:\n\n# Python\npython scripts/sign_transaction.py \"<serialized_tx>\" \"<private_key_base58>\"\n\n# TypeScript\nbun run scripts/sign_transaction.ts \"<serialized_tx>\" \"<private_key_base58>\"\n\nSign Transaction Only (Base)\nbun run scripts/sign_transaction_base.ts \"<serialized_tx_hex>\" \"<private_key_hex>\"\n\n\nOutput (Solana):\n\n✅ Transaction successful!\n   Signature: 5UfgJ3vN...\n   Explorer:  https://solscan.io/tx/5UfgJ3vN...\n\n\nOutput (Base):\n\n✅ Transaction successful!\n   Hash:     0x1234...\n   Explorer: https://basescan.org/tx/0x1234...\n\nSigning Transactions Programmatically\n\nFor custom integrations without using the bundled scripts:\n\nJavaScript/TypeScript\nimport { Connection, Transaction, clusterApiUrl } from \"@solana/web3.js\";\nimport bs58 from \"bs58\";\n\nasync function signAndSendTransaction(\n  serializedTransaction: string,\n  wallet: { signTransaction: (tx: Transaction) => Promise<Transaction> }\n) {\n  // Decode the base58 transaction\n  const transactionBuffer = bs58.decode(serializedTransaction);\n  const transaction = Transaction.from(transactionBuffer);\n\n  // Sign with user's wallet (e.g., Phantom, Solflare)\n  const signedTransaction = await wallet.signTransaction(transaction);\n\n  // Send to Solana network\n  const connection = new Connection(clusterApiUrl(\"mainnet-beta\"));\n  const signature = await connection.sendRawTransaction(\n    signedTransaction.serialize()\n  );\n\n  // Confirm transaction\n  await connection.confirmTransaction(signature, \"confirmed\");\n\n  return signature;\n}\n\nReact with Wallet Adapter\nimport { useWallet, useConnection } from \"@solana/wallet-adapter-react\";\nimport { Transaction } from \"@solana/web3.js\";\nimport bs58 from \"bs58\";\n\nfunction CheckoutButton({ serializedTransaction }: { serializedTransaction: string }) {\n  const { signTransaction, publicKey } = useWallet();\n  const { connection } = useConnection();\n\n  const handlePayment = async () => {\n    if (!signTransaction || !publicKey) {\n      throw new Error(\"Wallet not connected\");\n    }\n\n    // Decode and sign\n    const tx = Transaction.from(bs58.decode(serializedTransaction));\n    const signed = await signTransaction(tx);\n\n    // Send and confirm\n    const sig = await connection.sendRawTransaction(signed.serialize());\n    await connection.confirmTransaction(sig, \"confirmed\");\n\n    console.log(\"Payment complete:\", sig);\n  };\n\n  return <button onClick={handlePayment}>Pay with USDC</button>;\n}\n\nPython (with solana-py)\nimport base58\nfrom solana.rpc.api import Client\nfrom solana.transaction import Transaction\nfrom solders.keypair import Keypair\n\ndef sign_and_send(serialized_tx: str, keypair: Keypair) -> str:\n    # Decode base58 transaction\n    tx_bytes = base58.b58decode(serialized_tx)\n    transaction = Transaction.deserialize(tx_bytes)\n\n    # Sign\n    transaction.sign(keypair)\n\n    # Send\n    client = Client(\"https://api.mainnet-beta.solana.com\")\n    result = client.send_transaction(transaction)\n\n    return result.value  # transaction signature\n\nSigning Base/EVM Transactions\n\nFor Base chain orders, the serializedTransaction is an EVM transaction that needs to be signed with an EVM wallet.\n\nTypeScript with viem\nimport { createWalletClient, http, parseTransaction } from \"viem\";\nimport { base } from \"viem/chains\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nasync function signAndSendBaseTransaction(\n  serializedTransaction: string,\n  privateKey: `0x${string}`\n) {\n  const account = privateKeyToAccount(privateKey);\n\n  const client = createWalletClient({\n    account,\n    chain: base,\n    transport: http(),\n  });\n\n  // Parse and send the serialized transaction\n  const tx = parseTransaction(serializedTransaction as `0x${string}`);\n  const hash = await client.sendTransaction(tx);\n\n  console.log(\"Transaction hash:\", hash);\n  console.log(\"Explorer: https://basescan.org/tx/\" + hash);\n\n  return hash;\n}\n\nReact with wagmi\nimport { useSendTransaction } from \"wagmi\";\nimport { parseTransaction } from \"viem\";\n\nfunction CheckoutButton({ serializedTransaction }: { serializedTransaction: string }) {\n  const { sendTransaction } = useSendTransaction();\n\n  const handlePayment = async () => {\n    const tx = parseTransaction(serializedTransaction as `0x${string}`);\n    sendTransaction(tx);\n  };\n\n  return <button onClick={handlePayment}>Pay with USDC on Base</button>;\n}\n\nComplete Checkout Flow (Solana)\n// 1. Search for products\nconst searchResponse = await fetch(\"https://api.purch.xyz/shop\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({ message: \"wireless headphones under $100\" })\n});\nconst { products, reply } = await searchResponse.json();\n\n// 2. User selects a product, create order (Solana wallet)\nconst orderResponse = await fetch(\"https://api.purch.xyz/buy\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\n    asin: products[0].asin,\n    email: \"buyer@example.com\",\n    walletAddress: wallet.publicKey.toBase58(), // Solana address\n    shippingAddress: {\n      name: \"John Doe\",\n      line1: \"123 Main St\",\n      city: \"New York\",\n      state: \"NY\",\n      postalCode: \"10001\",\n      country: \"US\"\n    }\n  })\n});\nconst { orderId, serializedTransaction, checkoutUrl } = await orderResponse.json();\n\n// 3. Sign and send Solana transaction\nconst tx = Transaction.from(bs58.decode(serializedTransaction));\nconst signed = await wallet.signTransaction(tx);\nconst signature = await connection.sendRawTransaction(signed.serialize());\nawait connection.confirmTransaction(signature, \"confirmed\");\n\nconsole.log(`Order ${orderId} paid. Tx: ${signature}`);\n\nComplete Checkout Flow (Base)\nimport { parseTransaction } from \"viem\";\n\n// 1. Search for products\nconst searchResponse = await fetch(\"https://api.purch.xyz/shop\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({ message: \"wireless headphones under $100\" })\n});\nconst { products } = await searchResponse.json();\n\n// 2. User selects a product, create order (EVM wallet)\nconst orderResponse = await fetch(\"https://api.purch.xyz/buy\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\n    asin: products[0].asin,\n    email: \"buyer@example.com\",\n    walletAddress: \"0x1234...\", // Base/EVM address - chain auto-detected\n    shippingAddress: {\n      name: \"John Doe\",\n      line1: \"123 Main St\",\n      city: \"New York\",\n      state: \"NY\",\n      postalCode: \"10001\",\n      country: \"US\"\n    }\n  })\n});\nconst { orderId, serializedTransaction } = await orderResponse.json();\n\n// 3. Sign and send Base transaction\nconst tx = parseTransaction(serializedTransaction as `0x${string}`);\nconst hash = await walletClient.sendTransaction(tx);\n\nconsole.log(`Order ${orderId} paid. Tx: ${hash}`);\n\nFallback: Browser Checkout\n\nIf wallet signing fails or isn't available, redirect to checkoutUrl for browser-based payment:\n\nif (!wallet.connected) {\n  window.open(checkoutUrl, \"_blank\");\n}\n\nError Handling\n\nAll endpoints return errors as:\n\n{\n  \"code\": \"VALIDATION_ERROR\",\n  \"message\": \"Invalid email format\",\n  \"details\": { \"field\": \"email\" }\n}\n\n\nCommon error codes:\n\nVALIDATION_ERROR (400) - Invalid request parameters\nNOT_FOUND (404) - Product not found\nRATE_LIMITED (429) - Too many requests\nINTERNAL_ERROR (500) - Server error"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/purch-agent/agentic-commerce",
    "publisherUrl": "https://clawhub.ai/purch-agent/agentic-commerce",
    "owner": "purch-agent",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agentic-commerce",
    "downloadUrl": "https://openagent3.xyz/downloads/agentic-commerce",
    "agentUrl": "https://openagent3.xyz/skills/agentic-commerce/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agentic-commerce/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agentic-commerce/agent.md"
  }
}