customerProductDetail
Requires a customer (portal or buyer app) session.
Returns one active product with its variants, units of measure, images, attributes and the signed-in customer's prices and stock.
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 CustomerProductDetail($productId: ID!) {
customerProductDetail(productId: $productId) {
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 CustomerProductDetail($productId: ID!) {\n customerProductDetail(productId: $productId) {\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"
}
}
EOF
Variables:
{
"productId": "id"
}
Response:
{
"data": {
"customerProductDetail": {
"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"
}
]
}
}
}
customerProductDetail(
addressId: ID
productId: ID!
): CustomerProductDetail!
Arguments
customerProductDetail.addressId ● ID scalar
Kept for compatibility; it does not change which prices or discounts apply.
customerProductDetail.productId ● ID! non-null scalar
The ID of the product.
Type
CustomerProductDetail object
A product as a buyer sees it on its page.