| GET | /v3.5/product/matches |
|---|
"use strict";
export class ProductIdentifiers {
/** @param {{productGuid?:string,gtins?:string[],mpns?:string[],ean8?:string[],ean13?:string[],isbn9?:string[],isbn10?:string[],isbn13?:string[],itf14?:string[],upc12?:string[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
productGuid;
/** @type {string[]} */
gtins;
/** @type {string[]} */
mpns;
/** @type {string[]} */
ean8;
/** @type {string[]} */
ean13;
/** @type {string[]} */
isbn9;
/** @type {string[]} */
isbn10;
/** @type {string[]} */
isbn13;
/** @type {string[]} */
itf14;
/** @type {string[]} */
upc12;
}
export class BookAttributes {
/** @param {{authors?:string[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string[]} */
authors;
}
export class AudiobookAttributes extends BookAttributes {
/** @param {{authors?:string[]}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
}
export class EBookAttributes extends BookAttributes {
/** @param {{authors?:string[]}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
}
export class ItemAttributes {
/** @param {{book?:BookAttributes,audiobook?:AudiobookAttributes,ebook?:EBookAttributes}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {BookAttributes} */
book;
/** @type {AudiobookAttributes} */
audiobook;
/** @type {EBookAttributes} */
ebook;
}
export class ProductAttributes {
/** @param {{retailer?:string,retailerGuid?:string,storefront?:string,storefrontIso2?:string,storefrontGuid?:string,category?:string,categoryGuid?:string,brand?:string,brandGuid?:string,manufacturer?:string,manufacturerGuid?:string,identifiers?:ProductIdentifiers,itemAttributes?:ItemAttributes}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
retailer;
/** @type {string} */
retailerGuid;
/** @type {string} */
storefront;
/** @type {string} */
storefrontIso2;
/** @type {string} */
storefrontGuid;
/** @type {string} */
category;
/** @type {string} */
categoryGuid;
/** @type {string} */
brand;
/** @type {string} */
brandGuid;
/** @type {string} */
manufacturer;
/** @type {string} */
manufacturerGuid;
/** @type {ProductIdentifiers} */
identifiers;
/** @type {ItemAttributes} */
itemAttributes;
}
export class RetailerSpecificAttributes {
/** @param {{name?:string,description?:string,skus?:string[],asin?:string,url?:string,productImages?:{ [index:string]: string; },additionalData?:{ [index:string]: string; }}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
name;
/** @type {string} */
description;
/** @type {string[]} */
skus;
/** @type {string} */
asin;
/** @type {string} */
url;
/** @type {{ [index:string]: string; }} */
productImages;
/** @type {{ [index:string]: string; }} */
additionalData;
}
export class ProductData {
/** @param {{attributes?:ProductAttributes,retailerSpecificAttributes?:RetailerSpecificAttributes,rawSourceData?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ProductAttributes} */
attributes;
/** @type {RetailerSpecificAttributes} */
retailerSpecificAttributes;
/** @type {string} */
rawSourceData;
}
/** @typedef {'Throttled'|'TargetRetailerProductNotFound'|'Unknown'|'NullMatchResult'|'NullSourceData'|'SourceDataProcessingFailure'|'LocalizationFailure'} */
export var ErrorCode;
(function (ErrorCode) {
ErrorCode["Throttled"] = "Throttled"
ErrorCode["TargetRetailerProductNotFound"] = "TargetRetailerProductNotFound"
ErrorCode["Unknown"] = "Unknown"
ErrorCode["NullMatchResult"] = "NullMatchResult"
ErrorCode["NullSourceData"] = "NullSourceData"
ErrorCode["SourceDataProcessingFailure"] = "SourceDataProcessingFailure"
ErrorCode["LocalizationFailure"] = "LocalizationFailure"
})(ErrorCode || (ErrorCode = {}));
export class MatchError {
/** @param {{message?:string,error?:ErrorCode}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
message;
/** @type {ErrorCode} */
error;
}
export class MatchResult {
/** @param {{retailer?:string,retailerGuid?:string,storefront?:string,storefrontIso2?:string,storefrontGuid?:string,data?:ProductData,errors?:MatchError[],matchAccuracy?:string,matchingRuleName?:string,dataSource?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
retailer;
/** @type {string} */
retailerGuid;
/** @type {string} */
storefront;
/** @type {string} */
storefrontIso2;
/** @type {string} */
storefrontGuid;
/** @type {ProductData} */
data;
/** @type {MatchError[]} */
errors;
/** @type {string} */
matchAccuracy;
/** @type {string} */
matchingRuleName;
/** @type {string} */
dataSource;
}
export class ProductMetadata {
/** @param {{title?:string,author?:string,url?:string,description?:string,retailer?:string,productImages?:{ [index:string]: string; },rawAttributes?:MatchResult}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
title;
/** @type {string} */
author;
/** @type {string} */
url;
/** @type {string} */
description;
/** @type {string} */
retailer;
/** @type {{ [index:string]: string; }} */
productImages;
/** @type {MatchResult} */
rawAttributes;
}
export class GetProductMatchesByUrlResponse {
/** @param {{products?:ProductMetadata[],responseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ProductMetadata[]} */
products;
/** @type {ResponseStatus} */
responseStatus;
}
export class GetProductMatchesByUrlRequest {
/** @param {{url?:string,includeRaw?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
url;
/** @type {boolean} */
includeRaw;
}
JavaScript GetProductMatchesByUrlRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v3.5/product/matches HTTP/1.1 Host: geniuslink-api-zane.dev.platform.georiot.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}