Skip to Content
StoreOSv0.27.1
Storefront GraphQL APIReferenceQueries

Product By Id

QUERYproductById(id: String!): StorefrontProduct

Arguments

id*String!

Returns

  1. productById
_id*ID!
title*String!
handle?String
status?ProductStatus

Product status

Value inPUBLISHEDDRAFT
type?ProductType

Product type

Value inPHYSICALVIRTUALDOWNLOADABLE
gallery?
thumbnail?
shortDescription?String
longDescription?String
informationSections?
technicalSpecs?
price?Float
buyingPrice?Float
comparingPrice?Float
isInStock?Boolean
trackInventory?Boolean
lowStockThreshold?Float
allowBackorder?Boolean
variants?
variantConfigs?
collections?
vendors?
tenant?String
createdAt?DateTime

A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.

updatedAt?DateTime

A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.

Example Request
query ProductById($id: String!) {  productById(id: $id) {    _id    title    handle    status    type    gallery {      fileAssetId      provider      key      external      alt    }    thumbnail {      fileAssetId      provider      key      external      alt    }    shortDescription    longDescription    price  }}
Variables
{  "id": "string"}
Example Response
{  "data": {    "productById": {      "_id": "1",      "title": "string",      "handle": "string",      "status": "PUBLISHED",      "type": "PHYSICAL",      "gallery": [        {          "fileAssetId": "1",          "provider": "CLOUDINARY",          "key": "string",          "external": "string",          "alt": "string"        }      ],      "thumbnail": {        "fileAssetId": "1",        "provider": "CLOUDINARY",        "key": "string",        "external": "string",        "alt": "string"      },      "shortDescription": "string",      "longDescription": "string",      "price": 10.5    }  }}