Merchant Service - rettersoft/rbs-docs GitHub Wiki
Input: Item
Item {
variantGroupId: string //required
itemId: string //required
}
Output: No Content
- If you want to send the merchant id, you should pass in token claims with 'merchantId' attribute.
Input: MerchantVariantModel
MerchantVariantModel {
variantGroupId: string //required
itemId: string //required
priceTags: PriceTagItem[]
}
PriceTagItem {
zone?: string //optional
segment?: string //optional
campaignId?: string //optional
suggested?: number //required
discounted?: number //required
extraData?: any // optional
}
Output: Response
Response {
projectId: string;
variantGroupId: string;
itemId: string;
merchantId: string;
priceTags: PriceTag[];
hash: string;
updateToken: string;
createdAt: Date;
updatedAt: Date;
}
PriceTag {
campaignId: string;
segment: string;
zone: string;
discounted?: number;
suggested?: number;
}
- Query project merchant variants
Input: Params {
variantGroupId: string, // required
itemId?: string, // optional
merchantId?: string // optional
}
Output: Item[]
Item {
projectId: string;
variantGroupId: string;
itemId: string;
merchantId: string;
priceTags: PriceTag[];
hash: string;
updateToken: string;
createdAt: Date;
updatedAt: Date;
}
PriceTag {
discounted?: number;
normal: number;
zone: string;
campaignId: string;
segment?: string;
extraData?: any;
}
Example Inputs:
{
variantGroupId: "default_variant_group_id"
}
{
variantGroupId: "default_variant_group_id",
itemId: "default_item_id"
}
{
variantGroupId: "default_variant_group_id",
itemId: "default_item_id",
merchantId: "default_merchant"
}
- Export data set
- Get from storage service with file id
- File ttl is 5 minute
Input: No Input
Output: Item
Item {
fileId: string // Ex: "a84cf58d-51b5-451a-b1a1-8a346ebba360"
}
- Import data set
- Supports only XLSX files
Input: {
data: string // base64 encoded xlsx file
}
Output: Item
Item {
failedRows: Array<number>, // failed xlsx items rows
"totalSkipped": number, // ignored items (no changes)
"totalProcessed": number, // total processed items
"total": number // total items in the imported xlsx file
}
- Get specific project config
Input: No Input
Output: Item
Item {
segments: string[];
zones: string[];
updateToken: string; // !!! for update this config
createdAt: Date;
updatedAt: Date;
}
- Update specific project config with update token
- Fails on invalid update token
Input: {
config: Config;
updateToken: string; // newest update token
}
Config {
segments: string[];
zones: string[];
}
Output: Item
Item {
segments: string[];
zones: string[];
updateToken: string; // !!! for update this config
createdAt: Date;
updatedAt: Date;
}
- Return file names array
Input: No Input
Output: Item
Item : Array<String>
- Price update handler
Payload : PriceEventUpdateRemoveObject
PriceEventUpdateRemoveObject {
divider?: number // optional
variantGroupId: string
itemId: string
merchantId: string
segmentId: string
zoneId: string
campaignId: string
price: {
normal: number,
discounted: number
},
lastUpdate: number //Timestamp in milliseconds
extraData?: any;
}
- Price remove handler
- Same with the rbs.price.event.UPDATED action
- Same with the rbs.merchant.get.MERCHANT_VARIANTS action