Skip to main content

productById

Overview

Fetch a single product by its unique ID.

Query

query FindProductById($findProductByIdId: ID!) {
findProductById(id: $findProductByIdId) {
success
message
data {
_id
title
slug
description
app
tags
status
publishedAt
images { _id fileUrl }
collections {
_id
app
title
slug
description
operation
image { _id fileUrl }
}
seo { title description keywords image canonicalUrl }
pricing { compareAtPrice originalPrice price }
variantsCount
dimensions { height width unit }
weight { weight unit }
variants {
_id
product
options {
_id
option { name }
label
type
sortOrder
createdAt
updatedAt
}
images { _id fileUrl }
pricing { originalPrice price compareAtPrice }
quantity
weight { unit weight }
}
options {
_id
product
valuesCount
values { _id label type sortOrder createdAt updatedAt }
name
createdAt
updatedAt
}
}
}
}

Variables

{
"findProductByIdId": "<PRODUCT_ID>"
}

Examples

curl -X POST \
https://subdomain.com\
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{
"query": "query FindProductById($findProductByIdId: ID!) { findProductById(id: $findProductByIdId) { success message data { _id title slug } } }",
"variables": { "findProductByIdId": "<PRODUCT_ID>" }
}
EOF

Notes

  • Replace <TOKEN> and <PRODUCT_ID> with valid values.
  • Add/remove fields inside data to match UI needs; the full query above shows most available fields.