customerProductBySku
Requires a customer (portal or buyer app) session.
Finds the active product that has a variant with the given SKU and returns it with that variant.
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 CustomerProductBySku($sku: String!) {
customerProductBySku(sku: $sku) {
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 CustomerProductBySku($sku: String!) {\n customerProductBySku(sku: $sku) {\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": {
"sku": "string"
}
}
EOF
Variables:
{
"sku": "string"
}
Response:
{
"data": {
"customerProductBySku": {
"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"
}
]
}
}
}
customerProductBySku(
sku: String!
): CustomerProductDetail!
Arguments
customerProductBySku.sku ● String! non-null scalar
The SKU to look up.
Type
CustomerProductDetail object
A product as a buyer sees it on its page.