Skip to main content

Function: productService()

productService(client): object

Defined in: service/ProductService.ts:151

Service class for Product-related GraphQL operations

Parameters​

client​

GraphQLClient

Returns​

addSurchargesToProduct()​

addSurchargesToProduct(input): Promise<ConfirmationResponse>

Adds surcharges to a product *

Parameters​

input​

AddSurchargesToProductInput

Surcharges input data *

Returns​

Promise<ConfirmationResponse>

Promise<boolean> Success status

baseProductCategoryMoveAbove()​

baseProductCategoryMoveAbove(variables): Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveAbove operation

Parameters​

variables​

BaseProductCategoryMoveAboveVariables

Returns​

Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveAboveByUuids()​

baseProductCategoryMoveAboveByUuids(variables): Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveAboveByUuids operation

Parameters​

variables​

BaseProductCategoryMoveAboveByUuidsVariables

Returns​

Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveBelow()​

baseProductCategoryMoveBelow(variables): Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveBelow operation

Parameters​

variables​

BaseProductCategoryMoveBelowVariables

Returns​

Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveBelowByUuids()​

baseProductCategoryMoveBelowByUuids(variables): Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveBelowByUuids operation

Parameters​

variables​

BaseProductCategoryMoveBelowByUuidsVariables

Returns​

Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveToBottom()​

baseProductCategoryMoveToBottom(variables): Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveToBottom operation

Parameters​

variables​

BaseProductCategoryMoveToBottomVariables

Returns​

Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveToBottomByUuids()​

baseProductCategoryMoveToBottomByUuids(variables): Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveToBottomByUuids operation

Parameters​

variables​

BaseProductCategoryMoveToBottomByUuidsVariables

Returns​

Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveToTop()​

baseProductCategoryMoveToTop(variables): Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveToTop operation

Parameters​

variables​

BaseProductCategoryMoveToTopVariables

Returns​

Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveToTopByUuids()​

baseProductCategoryMoveToTopByUuids(variables): Promise&lt;BaseProductCategoryRelationship[]>

baseProductCategoryMoveToTopByUuids operation

Parameters​

variables​

BaseProductCategoryMoveToTopByUuidsVariables

Returns​

Promise&lt;BaseProductCategoryRelationship[]>

createProduct()​

createProduct(input): Promise&lt;Product>

Creates a new product *

Parameters​

input​

CreateProductInput

Product creation input data *

Returns​

Promise&lt;Product>

Promise<Product> The created product

getAttributeResultByProductId()​

getAttributeResultByProductId(productId, input): Promise&lt;AttributeResultResponse>

Fetches attribute results for a product *

Parameters​

productId​

number

Product ID *

input​

AttributeResultSearchInput

Attribute result search input *

Returns​

Promise&lt;AttributeResultResponse>

Promise<AttributeResultResponse> The attribute result response

getAttributesByProductId()​

getAttributesByProductId(productId, input): Promise&lt;AttributeResponse>

Fetches attributes for a product *

Parameters​

productId​

number

Product ID *

input​

AttributeSearchInput

Attribute search input *

Returns​

Promise&lt;AttributeResponse>

Promise<AttributeResponse> The attributes response

getBaseProducts()​

getBaseProducts(variables): Promise&lt;BaseProductsResponse>

Search both products and clusters in a single result set.

Parameters​

variables​

BaseProductsVariables

Returns​

Promise&lt;BaseProductsResponse>

getProduct()​

getProduct(variables, fetchOptions?): Promise&lt;Product>

Fetches a single product by ID, slug, or SKU *

Parameters​

variables​

ProductQueryVariables

input variables for aproduct to fetch

    • productId: int - Product ID to fetch
    • slug: string - Product slug to fetch
    • sku: string - Product SKU to fetch
    • language: string - Language for localized content
    • applyOrderlists: boolean - Whether to apply orderlist logic
    • orderlistIds: number[] - Array of orderlist IDs to apply
    • priceCalculateProductInput: PriceCalculateProductInput - Price calculation input
    • userBulkPriceProductInput: UserBulkPriceProductInput - User bulk price input
    • attributeResultSearchInput: AttributeResultSearchInput - Attribute search input
    • imageSearchFilters: MediaImageProductSearchInput - Image search filters
    • mediaVideoSearchInput: MediaVideoProductSearchInput - Video search input
    • mediaDocumentSearchInput: MediaDocumentProductSearchInput - Document search input
    • imageVariantFilters: TransformationsInput - Image transformation filters
fetchOptions?​

GraphQLFetchOptions

Returns​

Promise&lt;Product>

Promise<Product> The product data

getProducts()​

getProducts(variables): Promise&lt;ProductsResponse>

Fetches a list of products with search criteria *

Parameters​

variables​

ProductsQueryVariables

    • input: ProductSearchInput - Product search input parameters
    • language: string - Language for localized content
    • priceCalculateProductInput: PriceCalculateProductInput - Price calculation input
    • imageSearchFilters: MediaImageProductSearchInput - Image search filters
    • imageVariantFilters: TransformationsInput - Image transformation filters
    • filterAvailableAttributeInput: FilterAvailableAttributeInput - Filter available attributes input

Returns​

Promise&lt;ProductsResponse>

Promise<ProductsResponse> The products response data

getProductSearchBatchMetrics()​

getProductSearchBatchMetrics(): Promise&lt;BatchMetricsTenantResponse>

Current batch metrics for the current tenant

Returns​

Promise&lt;BatchMetricsTenantResponse>

getProductSearchBatchMetricsFailedJobs()​

getProductSearchBatchMetricsFailedJobs(variables): Promise&lt;BatchMetricsFailedJobsResponse>

Failed batch jobs for the current tenant

Parameters​

variables​

ProductSearchBatchMetricsFailedJobsVariables

Returns​

Promise&lt;BatchMetricsFailedJobsResponse>

getProductSearchBatchMetricsHourly()​

getProductSearchBatchMetricsHourly(): Promise&lt;BatchMetricsTenantHourlyResponse>

Hourly batch metrics for the current tenant (last 48 hours)

Returns​

Promise&lt;BatchMetricsTenantHourlyResponse>

getProductSearchBatchMetricsQueueStatus()​

getProductSearchBatchMetricsQueueStatus(): Promise&lt;BatchMetricsQueueStatusResponse>

Aggregate status of all batch-related queues

Returns​

Promise&lt;BatchMetricsQueueStatusResponse>

getProductSearchByCategory()​

getProductSearchByCategory(variables): Promise&lt;ProductSearchByCategoryResponse>

Search for products across multiple categories. Each category is searched separately with the same filters applied. Results are grouped by category ID for dataloader patterns.

Parameters​

variables​

ProductSearchByCategoryVariables

Returns​

Promise&lt;ProductSearchByCategoryResponse>

getProductSearchReindexLock()​

getProductSearchReindexLock(): Promise&lt;ReindexLockResponse>

Check if a reindex is currently running for the current tenant

Returns​

Promise&lt;ReindexLockResponse>

getProductSearchReindexStatus()​

getProductSearchReindexStatus(variables): Promise&lt;ReindexStatusResponse>

Get the progress of a reindex by its ID

Parameters​

variables​

ProductSearchReindexStatusVariables

Returns​

Promise&lt;ReindexStatusResponse>

getProductSearchSolr()​

getProductSearchSolr(variables): Promise&lt;ProductSearchResponse>

Search for products using Solr (parallel implementation for testing and migration)

Parameters​

variables​

ProductSearchSolrVariables

Returns​

Promise&lt;ProductSearchResponse>

getProductsRaw()​

getProductsRaw(variables): Promise&lt;ProductsRawResponse>

Search products with filtering, sorting and pagination, returning raw records without orderlist enrichment.

Parameters​

variables​

ProductsRawVariables

Returns​

Promise&lt;ProductsRawResponse>

getProductSurcharges()​

getProductSurcharges(productId): Promise&lt;SurchargeProductResponse>

Fetches surcharges for a product *

Parameters​

productId​

number

Product ID *

Returns​

Promise&lt;SurchargeProductResponse>

Promise<SurchargesResponse> The surcharges response

importProductsCsv()​

importProductsCsv(input): Promise&lt;CsvImportResponse>

Imports products from CSV *

Parameters​

input​

ProductCsvInput

CSV import input data *

Returns​

Promise&lt;CsvImportResponse>

Promise<CsvImportResponse> The import response

productAddToCategory()​

productAddToCategory(variables): Promise&lt;ProductCategoryRelationship>

productAddToCategory operation

Parameters​

variables​

ProductAddToCategoryVariables

Returns​

Promise&lt;ProductCategoryRelationship>

productAssignToCluster()​

productAssignToCluster(variables): Promise&lt;Product>

Attach an existing product to a cluster.

Parameters​

variables​

ProductAssignToClusterVariables

Returns​

Promise&lt;Product>

productCategoryMoveAbove()​

productCategoryMoveAbove(variables): Promise&lt;ProductCategoryRelationship[]>

productCategoryMoveAbove operation

Parameters​

variables​

ProductCategoryMoveAboveVariables

Returns​

Promise&lt;ProductCategoryRelationship[]>

productCategoryMoveBelow()​

productCategoryMoveBelow(variables): Promise&lt;ProductCategoryRelationship[]>

productCategoryMoveBelow operation

Parameters​

variables​

ProductCategoryMoveBelowVariables

Returns​

Promise&lt;ProductCategoryRelationship[]>

productCategoryMoveToBottom()​

productCategoryMoveToBottom(variables): Promise&lt;ProductCategoryRelationship[]>

productCategoryMoveToBottom operation

Parameters​

variables​

ProductCategoryMoveToBottomVariables

Returns​

Promise&lt;ProductCategoryRelationship[]>

productCategoryMoveToTop()​

productCategoryMoveToTop(variables): Promise&lt;ProductCategoryRelationship[]>

productCategoryMoveToTop operation

Parameters​

variables​

ProductCategoryMoveToTopVariables

Returns​

Promise&lt;ProductCategoryRelationship[]>

productClusterMoveAbove()​

productClusterMoveAbove(variables): Promise&lt;BaseProductClusterRelationship[]>

Reorder a product within its cluster so it appears immediately before another product.

Parameters​

variables​

ProductClusterMoveAboveVariables

Returns​

Promise&lt;BaseProductClusterRelationship[]>

productClusterMoveBelow()​

productClusterMoveBelow(variables): Promise&lt;BaseProductClusterRelationship[]>

Reorder a product within its cluster so it appears immediately after another product.

Parameters​

variables​

ProductClusterMoveBelowVariables

Returns​

Promise&lt;BaseProductClusterRelationship[]>

productClusterOptionMoveAbove()​

productClusterOptionMoveAbove(variables): Promise&lt;ProductClusterOptionRelationship[]>

Reorder a product within its cluster option so it appears immediately before another product.

Parameters​

variables​

ProductClusterOptionMoveAboveVariables

Returns​

Promise&lt;ProductClusterOptionRelationship[]>

productClusterOptionMoveBelow()​

productClusterOptionMoveBelow(variables): Promise&lt;ProductClusterOptionRelationship[]>

Reorder a product within its cluster option so it appears immediately after another product.

Parameters​

variables​

ProductClusterOptionMoveBelowVariables

Returns​

Promise&lt;ProductClusterOptionRelationship[]>

productRemoveFromCategory()​

productRemoveFromCategory(variables): Promise&lt;boolean>

productRemoveFromCategory operation

Parameters​

variables​

ProductRemoveFromCategoryVariables

Returns​

Promise&lt;boolean>

productsBulkAddToCategory()​

productsBulkAddToCategory(variables): Promise&lt;ProductCategoryRelationship[]>

productsBulkAddToCategory operation

Parameters​

variables​

ProductsBulkAddToCategoryVariables

Returns​

Promise&lt;ProductCategoryRelationship[]>

productsBulkRemoveFromCategory()​

productsBulkRemoveFromCategory(variables): Promise&lt;boolean>

productsBulkRemoveFromCategory operation

Parameters​

variables​

ProductsBulkRemoveFromCategoryVariables

Returns​

Promise&lt;boolean>

productSearchCategoriesIndex()​

productSearchCategoriesIndex(variables): Promise&lt;IndexEntitiesResponse>

Queue one or more categories for indexing

Parameters​

variables​

ProductSearchCategoriesIndexVariables

Returns​

Promise&lt;IndexEntitiesResponse>

productSearchClustersIndex()​

productSearchClustersIndex(variables): Promise&lt;IndexEntitiesResponse>

Queue one or more clusters for indexing

Parameters​

variables​

ProductSearchClustersIndexVariables

Returns​

Promise&lt;IndexEntitiesResponse>

productSearchFullReindexCancel()​

productSearchFullReindexCancel(variables): Promise&lt;CancelReindexResponse>

Cancel a running reindex by its ID

Parameters​

variables​

ProductSearchFullReindexCancelVariables

Returns​

Promise&lt;CancelReindexResponse>

productSearchFullReindexStart()​

productSearchFullReindexStart(variables): Promise&lt;StartReindexResponse>

Start a full reindex for the current tenant

Parameters​

variables​

ProductSearchFullReindexStartVariables

Returns​

Promise&lt;StartReindexResponse>

productSearchProductsIndex()​

productSearchProductsIndex(variables): Promise&lt;IndexEntitiesResponse>

Queue one or more products for indexing

Parameters​

variables​

ProductSearchProductsIndexVariables

Returns​

Promise&lt;IndexEntitiesResponse>

productSearchReindexLockForceRelease()​

productSearchReindexLockForceRelease(): Promise&lt;ForceReleaseLockResponse>

Force release a reindex lock for the current tenant (admin operation)

Returns​

Promise&lt;ForceReleaseLockResponse>

productSetDefaultCategory()​

productSetDefaultCategory(variables): Promise&lt;Product>

productSetDefaultCategory operation

Parameters​

variables​

ProductSetDefaultCategoryVariables

Returns​

Promise&lt;Product>

productUnassignFromCluster()​

productUnassignFromCluster(variables): Promise&lt;Product>

Detach a product from its current cluster.

Parameters​

variables​

ProductUnassignFromClusterVariables

Returns​

Promise&lt;Product>

updateProduct()​

updateProduct(variables): Promise&lt;Product>

Updates an existing product *

Parameters​

variables​

ProductUpdateVariables

ProductUpdateVariables update input data

    • productId: number - ID of the product to update
    • input: UpdateProductInput - The fields to update for the product

Returns​

Promise&lt;Product>

Promise<Product> The updated product