ProductMatching.API

<back to all web services

PostProductMatchingCallbackRequest

Requires Authentication
The following routes are available for this service:
POST/v1/product-matching-callback
import 'package:servicestack/servicestack.dart';

class PostProductMatchingCallbackResponse implements IConvertible
{
    ResponseStatus? responseStatus;

    PostProductMatchingCallbackResponse({this.responseStatus});
    PostProductMatchingCallbackResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "PostProductMatchingCallbackResponse";
    TypeContext? context = _ctx;
}

// @DataContract
class ProductMatch implements IProductMatch, IConvertible
{
    // @DataMember(Name="retailerGuid")
    String? retailerGuid;

    // @DataMember(Name="retailerName")
    String? retailerName;

    // @DataMember(Name="brand")
    String? brand;

    // @DataMember(Name="productName")
    String? productName;

    // @DataMember(Name="description")
    String? description;

    // @DataMember(Name="sku")
    String? sku;

    // @DataMember(Name="gtin")
    String? gtin;

    // @DataMember(Name="ean8")
    String? eaN8;

    // @DataMember(Name="ean13")
    String? eaN13;

    // @DataMember(Name="isbn")
    String? isbn;

    // @DataMember(Name="upc")
    String? upc;

    // @DataMember(Name="productImageUrl")
    Uri? productImageUrl;

    // @DataMember(Name="productUrl")
    Uri? productUrl;

    // @DataMember(Name="auditResult")
    String? auditResult;

    // @DataMember(Name="auditResultReasons")
    List<String>? auditResultReasons;

    ProductMatch({this.retailerGuid,this.retailerName,this.brand,this.productName,this.description,this.sku,this.gtin,this.eaN8,this.eaN13,this.isbn,this.upc,this.productImageUrl,this.productUrl,this.auditResult,this.auditResultReasons});
    ProductMatch.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        retailerGuid = json['retailerGuid'];
        retailerName = json['retailerName'];
        brand = json['brand'];
        productName = json['productName'];
        description = json['description'];
        sku = json['sku'];
        gtin = json['gtin'];
        eaN8 = json['eaN8'];
        eaN13 = json['eaN13'];
        isbn = json['isbn'];
        upc = json['upc'];
        productImageUrl = JsonConverters.fromJson(json['productImageUrl'],'Uri',context!);
        productUrl = JsonConverters.fromJson(json['productUrl'],'Uri',context!);
        auditResult = json['auditResult'];
        auditResultReasons = JsonConverters.fromJson(json['auditResultReasons'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'retailerGuid': retailerGuid,
        'retailerName': retailerName,
        'brand': brand,
        'productName': productName,
        'description': description,
        'sku': sku,
        'gtin': gtin,
        'eaN8': eaN8,
        'eaN13': eaN13,
        'isbn': isbn,
        'upc': upc,
        'productImageUrl': JsonConverters.toJson(productImageUrl,'Uri',context!),
        'productUrl': JsonConverters.toJson(productUrl,'Uri',context!),
        'auditResult': auditResult,
        'auditResultReasons': JsonConverters.toJson(auditResultReasons,'List<String>',context!)
    };

    getTypeName() => "ProductMatch";
    TypeContext? context = _ctx;
}

class PostProductMatchingCallbackRequest implements IConvertible
{
    List<ProductMatch>? matchedProducts;
    Map<String,String?>? request;

    PostProductMatchingCallbackRequest({this.matchedProducts,this.request});
    PostProductMatchingCallbackRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        matchedProducts = JsonConverters.fromJson(json['matchedProducts'],'List<ProductMatch>',context!);
        request = JsonConverters.fromJson(json['request'],'Map<String,String?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'matchedProducts': JsonConverters.toJson(matchedProducts,'List<ProductMatch>',context!),
        'request': JsonConverters.toJson(request,'Map<String,String?>',context!)
    };

    getTypeName() => "PostProductMatchingCallbackRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'product_matching_api.kit.co', types: <String, TypeInfo> {
    'PostProductMatchingCallbackResponse': TypeInfo(TypeOf.Class, create:() => PostProductMatchingCallbackResponse()),
    'ProductMatch': TypeInfo(TypeOf.Class, create:() => ProductMatch()),
    'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
    'PostProductMatchingCallbackRequest': TypeInfo(TypeOf.Class, create:() => PostProductMatchingCallbackRequest()),
    'List<ProductMatch>': TypeInfo(TypeOf.Class, create:() => <ProductMatch>[]),
    'Map<String,String?>': TypeInfo(TypeOf.Class, create:() => Map<String,String?>()),
});

Dart PostProductMatchingCallbackRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/product-matching-callback HTTP/1.1 
Host: product-matching-api.kit.co 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"matchedProducts":[{"retailerGuid":"00000000000000000000000000000000","retailerName":"String","brand":"String","productName":"String","description":"String","sku":"String","gtin":"String","ean8":"String","ean13":"String","isbn":"String","upc":"String","auditResult":"String","auditResultReasons":["String"]}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}