Skip to main content

Product

By using this api, you can manage your products.

Models

Product

type Product {
id: ID!
attributes: [ProductAttributeValue!]
baseUnit: ProductBaseUnitModel
brand: SimpleProductBrand
brandId: String
categories: [SimpleCategory!]
categoryIds: [String!]
description: String
dynamicPriceListIds: [String!]
googleTaxonomyId: String
groupVariantsByVariantTypeId: String
hiddenSalesChannelIds: [String!]
maxQuantityPerCart: Float
metaData: HTMLMetaData
name: String!
productOptionSetId: String
productVariantTypes: [ProductVariantType!]
productVolumeDiscountId: String
salesChannelIds: [String!]
shortDescription: String
tagIds: [String!]
tags: [SimpleProductTag!]
totalStock: Float
translations: [ProductTranslation!]
type: ProductTypeEnum!
variants: [Variant!]!
vendorId: String
weight: Float
}

Fields

idID!required

List of product attributes.

Base unit of the product.

Brand of the product.

brandIdString

Brand id of the product.

List of categories of the product.

categoryIds[String!]

List category identifiers of the product.

descriptionString

Description of the product.

dynamicPriceListIds[String!]
googleTaxonomyIdString
groupVariantsByVariantTypeIdString

This is the variant type id that can be used to group variants by a specific variant type id.

hiddenSalesChannelIds[String!]

List of hidden sales channel ids of the product.

maxQuantityPerCartFloat

Max purchasable quantity of the product for per cart.

metaDataHTMLMetaData

HTML Metadata identifier of the product.

nameString!required

Unique identifier of the product.

productOptionSetIdString

Option set id of the product.

productVariantTypes[ProductVariantType!]

Variant types of the product.

productVolumeDiscountIdString

Volume discount id of the product.

salesChannelIds[String!]

List of sales channel ids of the product.

shortDescriptionString

Short description of the product.

tagIds[String!]

List of product tag identifiers.

List of product tags.

totalStockFloat

Translations for the product.

typeProductTypeEnum!required

Type of the product.

variants[Variant!]!required

List of product variants.

vendorIdString

Vendor id of the product.

weightFloat

Weight of the product.

ProductBrand

type ProductBrand {
id: ID!
description: String
imageId: String
metaData: HTMLMetaData
name: String!
orderType: CategoryProductsOrderTypeEnum
salesChannelIds: [String!]
translations: [ProductBrandTranslation!]
}

Fields

idID!required
descriptionString

The description of the product's brand.

imageIdString

The image information of the product's brand.

metaDataHTMLMetaData

It is the metadata information of the product brand.

nameString!required

The name of the product's brand.

salesChannelIds[String!]

It is the information of which sales channel the product brand is in.

It is the translation information of the product brand.

ProductTag

type ProductTag {
id: ID!
name: String!
translations: [ProductTagTranslation!]
}

Fields

idID!required
nameString!required

The name of the product's tag.

The name of the product's tag.

ProductCategory

type Category {
id: ID!
categoryPath: [String!]
categoryPathItems: [CategoryPathItem!]
conditions: [CategoryCondition!]
description: String
imageId: String
isAutomated: Boolean
metaData: HTMLMetaData
name: String!
orderType: CategoryProductsOrderTypeEnum
parentId: String
salesChannelIds: [String!]
salesChannels: [CategorySalesChannel!]
shouldMatchAllConditions: Boolean
translations: [CategoryTranslation!]
}

Fields

idID!required
categoryPath[String!]

It is the id list information where the ids of all the superclasses of the category are found.

categoryPathItems[CategoryPathItem!]

It is the id list information where the ids of all the superclasses of the category are found.

descriptionString

It is the description of the category of the product.

imageIdString

It is the id where the picture of the category is kept in the system.

isAutomatedBoolean
metaDataHTMLMetaData

It is the metadata information of the product category.

nameString!required

It is the name of the category in which the product is located.

parentIdString

It is the id of the superclass category of the category.

salesChannelIds[String!]

It is the information of which sales channel the product category is in.

List of hidden sales channels of the category.

shouldMatchAllConditionsBoolean

It is the translation information of the product category.

ProductVariantType

type VariantType {
id: ID!
name: String!
selectionType: VariantSelectionTypeEnum!
translations: [VariantTypeTranslation!]
values: [VariantValue!]!
}

Fields

idID!required
nameString!required

Product variant type name information. For example: Size, Color, Number etc..It can be a maximum of 100 characters.

selectionTypeVariantSelectionTypeEnum!required

Product variant type selection type. It can be choice or color.

It is the translation information of the product variant types.

values[VariantValue!]!required

Variant values used in Variant type. For example, variant type: Size. Variant values can be thought of as S, M, L, XL. It is unique according to the value name.Values array size must have at least one element.

ProductTranslation

type ProductTranslation {
description: String
locale: String!
name: String
}

Fields

descriptionString

It is the description information of the translation.

localeString!required

It is the name information of the translation.

nameString

It is the information in which language the translation is saved.

ProductAttribute

type ProductAttribute {
id: ID!
description: String
name: String!
options: [ProductAttributeOption!]
tableTemplate: ProductAttributeTableTemplate
translations: [ProductAttributeTranslation!]
type: ProductAttributeTypeEnum!
}

Fields

idID!required
descriptionString

Description of the attribute

nameString!required

Name of the attribute

Options of the attribute

Table template description for product attribute

Translations for the attribute

Type of the attribute

Queries

List Products

Use this query to list products. Sort applies to following fields: createdAt updatedAt name

listProduct(
attributeId: ProductAttributeFilterInput
barcodeList: StringFilterInput
brandId: StringFilterInput
categoryIds: CategoryFilterInput
id: StringFilterInput
includeDeleted: Boolean
name: StringFilterInput
pagination: PaginationInput
salesChannelIds: StringFilterInput
sku: StringFilterInput
sort: String
tagIds: StringFilterInput
variantStockLocationId: StringFilterInput
variantTypeId: StringFilterInput
vendorId: StringFilterInput
): ProductPaginationResponse!

Arguments

List of barcode for the product.

includeDeletedBoolean
paginationPaginationInput

With the pagination feature in the data returned as a response, you can filter the data and display the part you want.

salesChannelIdsStringFilterInput

SKU of the product.

sortString
variantStockLocationIdStringFilterInput
variantTypeIdStringFilterInput

Return Type

ProductPaginationResponseProductPaginationResponse

Search Products

Result(s) containing searched products.

searchProducts(
input: SearchInput!
): ProductSearchResponse!

Arguments

inputSearchInput!required

Input data for product search

Return Type

ProductSearchResponseProductSearchResponse

Mutations

Save Product

Use this mutation to create or update a product with provided input values.

saveProduct(
input: ProductInput!
): Product!

Arguments

inputProductInput!required

Return Type

ProductProduct

Delete Product List

Use this mutation to delete products with specific product ids.

deleteProductList(
idList: [String!]!
): Boolean!

Arguments

idList[String!]!required

Return Type

BooleanBoolean

The Boolean scalar type represents true or false.

Update Product Sales Channel Status

Response indicating the status of operation.

updateProductSalesChannelStatus(
input: [UpdateProductSalesChannelStatusInput!]!
salesChannelId: String
): Boolean!

Arguments

Input to update sales channels list of the product.

salesChannelIdString

Id of the sales channel to update its sales channels.

Return Type

BooleanBoolean

The Boolean scalar type represents true or false.

Bulk Update Products

Response indicating the status of operation.

bulkUpdateProducts(
input: [BulkUpdateProductsInput!]!
): String!

Arguments

Input for bulk update products.

Return Type

StringString

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Save Variant Prices

Response indicating the status of operation.

saveVariantPrices(
input: SaveVariantPricesInput!
): Boolean!

Arguments

Input to update sales channels list of the product.

Return Type

BooleanBoolean

The Boolean scalar type represents true or false.

Examples

Retrieves a list of products

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listProduct { data { id name createdAt } } }"}'

Response

{
"data": {
"listProduct": {
"data": [
{
"id": "a8befae6-2cb9-487a-bd7f-5e0bfff3676b",
"name": "Product name",
"createdAt": 1634019877744
}
]
}
}
}

Updates Specified Variant Prices

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"mutation { saveVariantPrices(input: { priceListId: '35d9ecd5-c8a2-4a95-a388-4ee86791bb05', variantPriceInputs: [{ productId: 'a8befae6-2cb9-487a-bd7f-5e0bfff3676b', variantId: 'c1e7e564-4034-469d-ae55-a5aa14a297b3', price: { buyPrice: 15, sellPrice: 30 } }] }) { } }"}'

Response

{
"data": {
"saveVariantPrices": true
}
}

REST Endpoints

Upload Image

POST https://api.myikas.com/api/v1/admin/product/upload/image

Using this REST endpoint, you can add images to variants, categories and brands. However, when using this api, only one of the productImage, categoryImage and brandImage inputs can be sent.

Body Parameters

Product Image Input

type productImage {
variantIds: string[],
order: number,
isMain?: boolean == false,
url?: string,
base64?: string
}

Fields

variantIds[string!]!required

Id list of the variant to upload the image. If more than one variant id is entered, the uploaded image will be added to all variants.

ordernumber

Order of the uploading image.

isMainboolean

Whether the uploading image is the main image or not.

Url of the uploading image.If this value is entered, it is not necessary to enter base64.

base64string

Base64 string of the uploading image.If this value is entered, it is not necessary to enter url.

Category Image Input

type categoryImage {
categoryIds: string[],
url?: string,
base64?: string
}

Fields

categoryIds[string!]!required

Id list of the category to upload the image. If more than one category id is entered, the uploaded image will be added to all categories.

Url of the uploading image.If this value is entered, it is not necessary to enter base64.

base64string

Base64 string of the uploading image.If this value is entered, it is not necessary to enter url.

Brand Image Input

type categoryImage {
categoryIds: string[],
url?: string,
base64?: string
}

Fields

categoryIds[string!]!required

Id list of the category to upload the image. If more than one category id is entered, the uploaded image will be added to all categories.

Url of the uploading image.If this value is entered, it is not necessary to enter base64.

base64string

Base64 string of the uploading image.If this value is entered, it is not necessary to enter url.

Response

Endpoint returns OK response with status code 200 when upload is successful.

Example

curl --request POST \
--url 'https://api.myikas.com/api/v1/admin/product/upload/image' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw productId=<your_product_id> \
--data-raw variantId=<your_variant_id> \
--data-raw order=<order_of_image> \
--data-raw isMain=<true | false>