publicProductDetail
Public: no authentication required.
Returns one active product of a seller for the public storefront. Needs no sign-in. An unknown subdomain is refused with an "Organization not found" error.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query PublicProductDetail($productId: ID!, $subdomain: String!) {
publicProductDetail(productId: $productId, subdomain: $subdomain) {
id
name
brandName
createdAt
brandId
canAddToCart
variants {
id
QRCode
name
attributes
availableQuantity
barcode
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query PublicProductDetail($productId: ID!, $subdomain: String!) {\n publicProductDetail(productId: $productId, subdomain: $subdomain) {\n id\n name\n brandName\n createdAt\n brandId\n canAddToCart\n variants {\n id\n QRCode\n name\n attributes\n availableQuantity\n barcode\n }\n }\n}",
"variables": {
"productId": "id",
"subdomain": "string"
}
}
EOF
Variables:
{
"productId": "id",
"subdomain": "string"
}
Response:
{
"data": {
"publicProductDetail": {
"id": "id",
"name": "string",
"brandName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"brandId": "string",
"canAddToCart": true,
"variants": [
{
"id": "id",
"QRCode": "string",
"name": "string",
"attributes": "string",
"availableQuantity": 0,
"barcode": "string"
}
]
}
}
}
publicProductDetail(
productId: ID!
subdomain: String!
): CustomerProductDetail!
Arguments
publicProductDetail.productId ● ID! non-null scalar
The ID of the product.
publicProductDetail.subdomain ● String! non-null scalar
The seller's storefront subdomain.
Type
CustomerProductDetail object
A product as a buyer sees it on its page.