Skip to main content

Class: ProductService

Defined in: service/ProductService.ts:210

Backwards-compatible class form. New code should call productService(client).

Constructors

Constructor

new ProductService(client): ProductService

Defined in: service/ProductService.ts:212

Parameters

client

GraphQLClient

Returns

ProductService

Methods

addSurchargesToProduct()

addSurchargesToProduct(input): Promise<ConfirmationResponse>

Defined in: service/ProductService.ts:257

Adds surcharges to a product

Parameters

input

AddSurchargesToProductInput

Surcharges input data

Returns

Promise<ConfirmationResponse>


createProduct()

createProduct(input): Promise<Product>

Defined in: service/ProductService.ts:240

Creates a new product

Parameters

input

CreateProductInput

Product creation input data

Returns

Promise<Product>


getAttributeResultByProductId()

getAttributeResultByProductId(productId, input): Promise<AttributeResultResponse>

Defined in: service/ProductService.ts:274

Fetches attribute results for a product

Parameters

productId

number

Product ID

input

AttributeResultSearchInput

Attribute result search input

Returns

Promise<AttributeResultResponse>


getAttributesByProductId()

getAttributesByProductId(productId, input): Promise<AttributeResponse>

Defined in: service/ProductService.ts:268

Fetches attributes for a product

Parameters

productId

number

Product ID

input

AttributeSearchInput

Attribute search input

Returns

Promise<AttributeResponse>


getProduct()

getProduct(variables, fetchOptions?): Promise<Product>

Defined in: service/ProductService.ts:230

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<Product>


getProducts()

getProducts(variables): Promise<ProductsResponse>

Defined in: service/ProductService.ts:235

Fetches a list of products with search criteria

Parameters

variables

ProductsQueryVariables

Product search input parameters

Returns

Promise<ProductsResponse>


getProductSurcharges()

getProductSurcharges(productId): Promise<SurchargeProductResponse>

Defined in: service/ProductService.ts:262

Fetches surcharges for a product

Parameters

productId

number

Product ID

Returns

Promise<SurchargeProductResponse>


importProductsCsv()

importProductsCsv(input): Promise<CsvImportResponse>

Defined in: service/ProductService.ts:252

Imports products from CSV

Parameters

input

ProductCsvInput

CSV import input data

Returns

Promise<CsvImportResponse>


updateProduct()

updateProduct(variables): Promise<Product>

Defined in: service/ProductService.ts:247

Updates an existing product

Parameters

variables

ProductUpdateVariables

Product update input data

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

Returns

Promise<Product>