BuyAction
BuyAction is an Action subtype (via TradeAction) for the act of purchasing a product or service. It adds 1 property: seller (who you are buying from). It inherits price, priceCurrency, and priceSpecification from TradeAction. Use it as a potentialAction on a Product to indicate the product can be purchased, with a target URL pointing to the purchase page.
BuyAction is less commonly implemented than SearchAction or direct Offer markup. Most ecommerce sites use offers on Product instead. BuyAction is useful when you need to express the purchase as an action with a specific target URL, separate from the product's static offer data.
Full example of schema.org/BuyAction json-ld markup
The markup is verified as valid with Rich Results Test from Google.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "XooTee Classic",
"@id": "https://xoocode.com/shop/xootee-classic#product",
"potentialAction": {
"@type": "BuyAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://xoocode.com/shop/xootee-classic/checkout"
},
"seller": {
"@id": "https://xoocode.com/shop/dunmore-1290",
"@type": "LocalBusiness",
"name": "Xoo Code Shop Dunmore"
},
"price": "495.00",
"priceCurrency": "DKK"
}
}
</script>Minimal valid version
The smallest markup that still produces a valid BuyAction entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "XooTee Classic",
"potentialAction": {
"@type": "BuyAction",
"target": "https://xoocode.com/shop/xootee-classic/checkout",
"seller": { "@type": "Organization", "name": "Xoo Code Shop Dunmore" }
}
}
</script>Google rich results this unlocks
Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.
- Google docsProduct snippet (indirect)
Common BuyAction mistakes
Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.
- 01
Using BuyAction instead of Offer for product pricing
WrongBuyAction as the only pricing information on a ProductRightUse offers with Offer for pricing; BuyAction as a supplementary potentialAction if neededGoogle reads Product.offers for pricing in rich results, not BuyAction. Use Offer for the price and availability. BuyAction is for expressing the purchase path as an action, not as a replacement for offers.
Schema properties in this example
About the example data
A purchase action for the XooTee Classic, targeting the checkout page at the Xoo Code Shop.
Comments
Loading comments...