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
attributes
[ProductAttributeValue!]List of product attributes.
baseUnit
ProductBaseUnitModelBase unit of the product.
brand
SimpleProductBrandBrand of the product.
brandId
StringBrand id of the product.
categories
[SimpleCategory!]List of categories of the product.
categoryIds
[String!]List category identifiers of the product.
description
StringDescription of the product.
dynamicPriceListIds
[String!]googleTaxonomyId
StringgroupVariantsByVariantTypeId
StringThis 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.
maxQuantityPerCart
FloatMax purchasable quantity of the product for per cart.
metaData
HTMLMetaDataHTML Metadata identifier of the product.
Unique identifier of the product.
productOptionSetId
StringOption set id of the product.
productVariantTypes
[ProductVariantType!]Variant types of the product.
productVolumeDiscountId
StringVolume discount id of the product.
salesChannelIds
[String!]List of sales channel ids of the product.
shortDescription
StringShort description of the product.
tagIds
[String!]List of product tag identifiers.
List of product tags.
totalStock
Floattranslations
[ProductTranslation!]Translations for the product.
Type of the product.
List of product variants.
vendorId
StringVendor id of the product.
weight
FloatWeight of the product.
ProductBrand
type ProductBrand {
id: ID!
description: String
imageId: String
metaData: HTMLMetaData
name: String!
orderType: CategoryProductsOrderTypeEnum
salesChannelIds: [String!]
translations: [ProductBrandTranslation!]
}
Fields
description
StringThe description of the product's brand.
imageId
StringThe image information of the product's brand.
metaData
HTMLMetaDataIt is the metadata information of the product brand.
The name of the product's brand.
orderType
CategoryProductsOrderTypeEnumsalesChannelIds
[String!]It is the information of which sales channel the product brand is in.
translations
[ProductBrandTranslation!]It is the translation information of the product brand.
ProductTag
type ProductTag {
id: ID!
name: String!
translations: [ProductTagTranslation!]
}
Fields
The name of the product's tag.
translations
[ProductTagTranslation!]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
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.
conditions
[CategoryCondition!]description
StringIt is the description of the category of the product.
imageId
StringIt is the id where the picture of the category is kept in the system.
isAutomated
BooleanmetaData
HTMLMetaDataIt is the metadata information of the product category.
It is the name of the category in which the product is located.
orderType
CategoryProductsOrderTypeEnumparentId
StringIt 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.
salesChannels
[CategorySalesChannel!]List of hidden sales channels of the category.
shouldMatchAllConditions
Booleantranslations
[CategoryTranslation!]It is the translation information of the product category.
ProductVariantType
type VariantType {
id: ID!
name: String!
selectionType: VariantSelectionTypeEnum!
translations: [VariantTypeTranslation!]
values: [VariantValue!]!
}
Fields
Product variant type name information. For example: Size, Color, Number etc..It can be a maximum of 100 characters.
Product variant type selection type. It can be choice or color.
translations
[VariantTypeTranslation!]It is the translation information of the product variant types.
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
description
StringIt is the description information of the translation.
It is the name information of the translation.
name
StringIt 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
description
StringDescription of the attribute
Name of the attribute
options
[ProductAttributeOption!]Options of the attribute
tableTemplate
ProductAttributeTableTemplateTable template description for product attribute
translations
[ProductAttributeTranslation!]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
attributeId
ProductAttributeFilterInputbarcodeList
StringFilterInputList of barcode for the product.
brandId
StringFilterInputcategoryIds
CategoryFilterInputincludeDeleted
Booleanpagination
PaginationInputWith the pagination feature in the data returned as a response, you can filter the data and display the part you want.
salesChannelIds
StringFilterInputSKU of the product.
sort
StringtagIds
StringFilterInputvariantStockLocationId
StringFilterInputvariantTypeId
StringFilterInputvendorId
StringFilterInputReturn Type
ProductPaginationResponse
ProductPaginationResponseSearch Products
Result(s) containing searched products.
searchProducts(
input: SearchInput!
): ProductSearchResponse!
Arguments
Input data for product search
Return Type
ProductSearchResponse
ProductSearchResponseMutations
Save Product
Use this mutation to create or update a product with provided input values.
saveProduct(
input: ProductInput!
): Product!
Arguments
Return Type
Product
ProductDelete Product List
Use this mutation to delete products with specific product ids.
deleteProductList(
idList: [String!]!
): Boolean!
Arguments
Return Type
Boolean
BooleanThe 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.
salesChannelId
StringId of the sales channel to update its sales channels.
Return Type
Boolean
BooleanThe 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
String
StringThe 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
Boolean
BooleanThe Boolean
scalar type represents true
or false
.
Examples
Retrieves a list of products
- BASH
- NODE.JS
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 } } }"}'
const axios = require('axios');
const data = {"query":`{
listProduct {
data {
id
name
createdAt
}
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
Response
{
"data": {
"listProduct": {
"data": [
{
"id": "a8befae6-2cb9-487a-bd7f-5e0bfff3676b",
"name": "Product name",
"createdAt": 1634019877744
}
]
}
}
}
Updates Specified Variant Prices
- BASH
- NODE.JS
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 } }] }) { } }"}'
const axios = require('axios');
const data = {"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
}
}]
}) {
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
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
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.
order
numberOrder of the uploading image.
isMain
booleanWhether the uploading image is the main image or not.
url
stringUrl of the uploading image.If this value is entered, it is not necessary to enter base64.
base64
stringBase64 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
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
stringUrl of the uploading image.If this value is entered, it is not necessary to enter base64.
base64
stringBase64 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
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
stringUrl of the uploading image.If this value is entered, it is not necessary to enter base64.
base64
stringBase64 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
- BASH
- NODE.JS
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>
var axios = require("axios").default;
var options = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/product/upload/image',
headers: {
'content-type': 'application/json',
'Authorization: Bearer <your_access_token>'
},
data: {
productImage: {
variantIds: '<your_variant_ids_array>',
url?: <image_url>,
base64?: <base64_string>,
order: '<order_of_image>',
isMain: '<true | false>'
}
}
};
axios.request(options)
.then((response) => {
console.log(response.data);
}).catch((error) => {
console.error(error);
});