Catalog Service - rettersoft/rbs-docs GitHub Wiki
RBS Catalog Service
Models
Actions
- rbs.product.get.DATA
const input = {
variantGroupId: string
id: string
modelName: string
merchantId?: string = 'default'
zoneId?: string = 'default'
segment?: string = 'default'
inStock?: boolean
}
const response = CatalogResponseItem
- rbs.product.get.SOME
const input = {
modelName: string // rbs.pimproduct
ids: [ {
variantGroupId: string,
id: string,
merchantId: string? // Default: default
}],
zoneId: string?, //default: 'default'
segment: string?, //default: 'default'
locale: string?, //default: tr_TR
inStock: boolean?
}
- rbs.product.request.STOCK
const input = {
modelName: string, // default: 'rbs.pimproduct'
variantGroupId: string,
zoneId: string? // default: 'default'
}
const response = [] {
variantGroupId: string,
itemId: string,
stockStatus: string, // HIGH, LOW, NONE, 10,9...1
merchantId: string,
zoneId :string
}
const response = CatalogResponseItem[]
- rbs.catalog.request.SEARCH
const input = {
modelName: string,
searchTerm: string?,
from: number?, // default: 0,
size: number?, //default: 20,
filters: SearchFilterValue[]?,
locale: string?, // default: tr_TR,
zoneId: string?, // default: 'default'
segment: string?, // default: 'default'
inStock: boolean?, // default: false
sortAttribute: string?, // ex: 'priceTag.price.normal', 'attributes.brand.keyword'
sortOrder: enum(string), // 'asc' or 'desc'
tags: string[], // default []
includeBlobs: boolean?, // default: false
categoryId: string?,
matchTerms: Term[]?, // default: []
priceRange: PriceRange?,
range: SearchRange?,
isBackOffice: boolean?, // default: false,
sortBy: SortBy[]?,
}
Search action searches products in projects product catalog.
- rbs.catalog.request.AGGREGATE
(categoryId:string, locale: string, filters: [SearchFilterValue], searchTerm:string, inStock:bool) -> [Product]
Aggregate action fetches the filter aggregations for a search. It is mostly be called together with search action.
- rbs.categories.get.DATA
const request = {
locale?: string, // default: tr_TR
zoneId?: string,
segment?: string,
inStock?: boolean
}
const response = CategoryTree
Returns the category tree for the project.
- rbs.catalog.request.UPDATE_ITEM
(id: string, variantGroupId: string, modelName: string, attributes: any, images: any[], itemType: string)
Updates catalog item
- rbs.catalog.request.DELETE_ITEM
(id: string, variantGroupId: string, modelName: string)
Removes catalog item
- rbs.catalog.get.SUGGEST
const input = {
modelName: string,
field: string,
query: string,
}
const resposne = string[]
- rbs.product.get.MOST_SEARCHED
const input = {
locale: string? // Default: tr_TR
}
const response = string[]
- rbs.catalog.request.GET_MODEL_CONFIG
const input = {
modelName: string? // Default: PROJECT
}
const response = ModelConfig
Attribute Types
ID = "ID"
IMAGE = "IMAGE"
TEXT = "TEXT"
LONG_TEXT = "LONG_TEXT"
NUMBER = "NUMBER"
BOOL = "BOOL"
LIST = "LIST"
VARIANT = "VARIANT"
BLOB = "BLOB"
Events
- rbs.catalog.event.CONFIG_UPDATED
const response = {
modelName: string, // 'PROJECT', 'rbs.pimproduct'
config: ModelConfig | ProjectConfig
}
- rbs.product.event.UPDATED
const response = CatalogItem
- rbs.product.event.CREATED
const response = {
modelName: string,
variantGroupId: string,
id: string,
}
- rbs.product.event.REMOVED
const response = {
modelName: string,
variantGroupId: string,
id: string,
}