> For the complete documentation index, see [llms.txt](https://docs.spurtcommerce.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.spurtcommerce.com/api-reference/store/product-discovery/product-comparison.md).

# Product Comparison

Compare products and retrieve related product suggestions.

## Get related products for a product slug.

> Get related products for a product slug.\
> \
> \*\*Authentication:\*\* Public or token-aware middleware; handler has CheckTokenMiddleware.\
> \
> \*\*Feature area:\*\* Product discovery\
> \
> \*\*Implementation source:\*\* \`src/api/store/controllers/StoreProductRelatedController.ts\`\
> \
> \*\*Request example provenance:\*\* Use query parameter \`productId\` with the product slug; response fields are based on source success example.\
> \
> \*\*Response example provenance:\*\* Use query parameter \`productId\` with the product slug; response fields are based on source success example.\
> \
> \> Example is based on the linked repository source. Replace example identifiers and credentials with values from your tenant.

```json
{"openapi":"3.0.3","info":{"title":"SpurtCommerce Store API","version":"6.0.0"},"tags":[{"name":"Product comparison","description":"Compare products and retrieve related product suggestions."}],"servers":[{"url":"https://api.example.com","description":"Replace with your SpurtCommerce API host. Paths include the /api prefix."}],"paths":{"/api/list/related-product-list":{"get":{"operationId":"getApiListRelatedProductList","summary":"Get related products for a product slug.","description":"Get related products for a product slug.\n\n**Authentication:** Public or token-aware middleware; handler has CheckTokenMiddleware.\n\n**Feature area:** Product discovery\n\n**Implementation source:** `src/api/store/controllers/StoreProductRelatedController.ts`\n\n**Request example provenance:** Use query parameter `productId` with the product slug; response fields are based on source success example.\n\n**Response example provenance:** Use query parameter `productId` with the product slug; response fields are based on source success example.\n\n> Example is based on the linked repository source. Replace example identifiers and credentials with values from your tenant.","tags":["Product comparison"],"parameters":[{"name":"productId","in":"query","required":false,"schema":{"type":"string"},"description":"Query parameter productId."},{"name":"count","in":"query","required":false,"schema":{"type":"boolean"},"description":"Query parameter count."}],"responses":{"200":{"description":"Successful response. Use query parameter `productId` with the product slug; response fields are based on source success example.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"data":{"type":"object","properties":{"productId":{"type":"integer"},"skuId":{"type":"integer"},"name":{"type":"string"},"price":{"type":"string"},"productSlug":{"type":"string"},"quantity":{"type":"integer"},"rating":{"type":"number"},"categoryLevels":{"type":"array","items":{}}},"additionalProperties":true}},"additionalProperties":true}}}},"400":{"description":"Error response example. Use query parameter `productId` with the product slug; response fields are based on source success example.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer"},"message":{"type":"string"}},"additionalProperties":true}}}}}}}}}
```

## Compare products by product identifiers.

> Compare products by product identifiers.\
> \
> \*\*Authentication:\*\* Public storefront request; controller docs mention Authorization header.\
> \
> \*\*Feature area:\*\* Product discovery\
> \
> \*\*Implementation source:\*\* \`src/api/store/controllers/ProductController.ts\`\
> \
> \*\*Request example provenance:\*\* The source annotation calls these request parameters but the implementation binds query params; use query string in the request example.\
> \
> \*\*Response example provenance:\*\* The source annotation calls these request parameters but the implementation binds query params; use query string in the request example.\
> \
> \> Example is based on the linked repository source. Replace example identifiers and credentials with values from your tenant.

```json
{"openapi":"3.0.3","info":{"title":"SpurtCommerce Store API","version":"6.0.0"},"tags":[{"name":"Product comparison","description":"Compare products and retrieve related product suggestions."}],"servers":[{"url":"https://api.example.com","description":"Replace with your SpurtCommerce API host. Paths include the /api prefix."}],"paths":{"/api/product-store/product-compare":{"get":{"operationId":"getApiProductStoreProductCompare","summary":"Compare products by product identifiers.","description":"Compare products by product identifiers.\n\n**Authentication:** Public storefront request; controller docs mention Authorization header.\n\n**Feature area:** Product discovery\n\n**Implementation source:** `src/api/store/controllers/ProductController.ts`\n\n**Request example provenance:** The source annotation calls these request parameters but the implementation binds query params; use query string in the request example.\n\n**Response example provenance:** The source annotation calls these request parameters but the implementation binds query params; use query string in the request example.\n\n> Example is based on the linked repository source. Replace example identifiers and credentials with values from your tenant.","tags":["Product comparison"],"parameters":[{"name":"productId","in":"query","required":false,"schema":{"type":"string"},"description":"Query parameter productId."},{"name":"data","in":"query","required":false,"schema":{"type":"string"},"description":"Query parameter data."}],"responses":{"200":{"description":"Successful response. The source annotation calls these request parameters but the implementation binds query params; use query string in the request example.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"string"},"data":{"type":"object","properties":{"createdBy":{"type":"string"},"productId":{"type":"integer"}},"additionalProperties":true}},"additionalProperties":true}}}}}}}}}
```
