DEV Community

Marc Newstead
Marc Newstead

Posted on

Building for AI Agents: What Developers Need to Know About Agentic Commerce

Building for AI Agents: What Developers Need to Know About Agentic Commerce

If you're building ecommerce platforms, here's something that should be on your radar: AI agents are starting to make purchases on behalf of users. Not just recommending products or chatting—actually completing transactions autonomously.

This isn't some distant future scenario. ChatGPT can browse the web. Google's experimenting with Shopping Graph agents. Perplexity is testing checkout flows. The AI shopping agents paradigm is already here, and it breaks a lot of assumptions we've baked into our ecommerce stacks.

What Does This Mean for Your Codebase?

Traditional ecommerce development optimises for human behaviour: visual hierarchy, persuasive copy, A/B tested CTAs. But AI agents don't care about your hero banner or that cleverly worded urgency message. They parse structured data, evaluate explicit attributes, and move on fast if information is missing or ambiguous.

The implications:

  • Your product data model needs to be machine-first, not just human-friendly
  • API responses become the primary product interface
  • Schema.org markup goes from "nice to have" to critical infrastructure

Structured Data Is Now a First-Class Concern

You probably already emit some JSON-LD for SEO. Time to treat it like a proper API contract.

{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "Wireless Headphones",
  "brand": {"@type": "Brand", "name": "AudioCo"},
  "offers": {
    "@type": "Offer",
    "price": "79.99",
    "priceCurrency": "GBP",
    "availability": "https://schema.org/InStock",
    "shippingDetails": {
      "@type": "OfferShippingDetails",
      "deliveryTime": {
        "@type": "ShippingDeliveryTime",
        "businessDays": {"@type": "OpeningHoursSpecification", "dayOfWeek": "http://schema.org/Monday"}
      }
    }
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.5",
    "reviewCount": "287"
  }
}
Enter fullscreen mode Exit fullscreen mode

Agents will prioritise vendors who provide complete, unambiguous data. Missing fields mean you're invisible to the agent, even if your product is perfect for the user's needs.

What to prioritise:

  • Full Schema.org Product markup (not just the bare minimum)
  • Explicit shipping costs, lead times, return policies
  • Structured specification data (dimensions, compatibility, materials)
  • Machine-readable availability and stock levels

APIs Over HTML

Some agents will scrape your HTML. Better ones will prefer proper APIs. If you're not exposing product catalogues via REST or GraphQL endpoints, now's the time.

Consider:

  • Dedicated agent endpoints with richer data than your public-facing site might display
  • Rate limiting strategies that don't punish legitimate agent traffic
  • API keys or authentication for verified agents (think partnerships with OpenAI, Google, etc.)
// Example: Agent-optimised product endpoint
app.get('/api/v1/products/:id/agent', authenticateAgent, (req, res) => {
  const product = getProductById(req.params.id);
  res.json({
    ...product,
    structured_specs: product.specifications, // Fully normalised
    compatibility: product.compatibleWith, // Explicit relationships
    environmental_impact: product.sustainability, // Emerging agent priorities
    agent_metadata: {
      last_updated: product.updatedAt,
      data_confidence: 'high'
    }
  });
});
Enter fullscreen mode Exit fullscreen mode

Rethinking Affiliate Tracking

Traditional affiliate tracking relies on cookies and click-through attribution. Agents don't click banners. They evaluate options programmatically and transact directly.

You'll need:

  • Server-side attribution models that accept agent-provided referral tokens
  • API-native commission tracking (think affiliate IDs passed in headers or request params)
  • New integration points with agent platforms themselves

This is still emerging territory. Businesses focused on AI automation and software development are already exploring agent partnership models that look more like B2B integrations than traditional affiliate marketing.

What to Build Right Now

  1. Audit your product data completeness. Run your catalogue through a schema validator. Fix missing fields.
  2. Expose a proper product API. Even a read-only REST endpoint is a start.
  3. Monitor agent traffic. Check your logs for non-browser user agents. Understand how they're interacting with your site.
  4. Test with existing agents. Ask ChatGPT or Perplexity to find and compare your products. See what they surface (or don't).

The Bottom Line

Agents are becoming a meaningful traffic source, and they behave fundamentally differently from human users. The good news? This is solvable with better data architecture and thoughtful API design—skills developers already have.

The platforms that win in agentic commerce will be the ones that treat machine readability as a feature, not an afterthought.

Top comments (0)