TicketUserServices

<back to all web services

WebshopCatalogRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdmin, MobileAppRequires the permission:ReadData
The following routes are available for this service:
GET/Webshop/Catalog/{OwnerId}
import 'package:servicestack/servicestack.dart';

class WebshopVariantSummary implements IConvertible
{
    int? id;
    int? productId;
    String? size;
    String? color;
    int? stockOnHand;
    int? quantitySold;
    int? availableQuantity;
    String? status;

    WebshopVariantSummary({this.id,this.productId,this.size,this.color,this.stockOnHand,this.quantitySold,this.availableQuantity,this.status});
    WebshopVariantSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        productId = json['productId'];
        size = json['size'];
        color = json['color'];
        stockOnHand = json['stockOnHand'];
        quantitySold = json['quantitySold'];
        availableQuantity = json['availableQuantity'];
        status = json['status'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'productId': productId,
        'size': size,
        'color': color,
        'stockOnHand': stockOnHand,
        'quantitySold': quantitySold,
        'availableQuantity': availableQuantity,
        'status': status
    };

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

class WebshopProductSummary implements IConvertible
{
    int? id;
    int? ownerId;
    String? name;
    String? description;
    String? category;
    String? subCategory;
    int? defaultPriceMinor;
    String? imageUrl;
    int? viewOrder;
    String? status;
    int? payoutInfoId;
    int? legacyItemId;
    List<WebshopVariantSummary>? variants;

    WebshopProductSummary({this.id,this.ownerId,this.name,this.description,this.category,this.subCategory,this.defaultPriceMinor,this.imageUrl,this.viewOrder,this.status,this.payoutInfoId,this.legacyItemId,this.variants});
    WebshopProductSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        ownerId = json['ownerId'];
        name = json['name'];
        description = json['description'];
        category = json['category'];
        subCategory = json['subCategory'];
        defaultPriceMinor = json['defaultPriceMinor'];
        imageUrl = json['imageUrl'];
        viewOrder = json['viewOrder'];
        status = json['status'];
        payoutInfoId = json['payoutInfoId'];
        legacyItemId = json['legacyItemId'];
        variants = JsonConverters.fromJson(json['variants'],'List<WebshopVariantSummary>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'ownerId': ownerId,
        'name': name,
        'description': description,
        'category': category,
        'subCategory': subCategory,
        'defaultPriceMinor': defaultPriceMinor,
        'imageUrl': imageUrl,
        'viewOrder': viewOrder,
        'status': status,
        'payoutInfoId': payoutInfoId,
        'legacyItemId': legacyItemId,
        'variants': JsonConverters.toJson(variants,'List<WebshopVariantSummary>',context!)
    };

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

class WebshopDeliveryOptions implements IConvertible
{
    bool? pickupAllowed;
    bool? droppAllowed;
    bool? shippedAllowed;
    String? pickupAddress;
    String? pickupDescription;
    int? droppFeeMinor;
    int? shippedFeeMinor;
    String? orderEmail;

    WebshopDeliveryOptions({this.pickupAllowed,this.droppAllowed,this.shippedAllowed,this.pickupAddress,this.pickupDescription,this.droppFeeMinor,this.shippedFeeMinor,this.orderEmail});
    WebshopDeliveryOptions.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        pickupAllowed = json['pickupAllowed'];
        droppAllowed = json['droppAllowed'];
        shippedAllowed = json['shippedAllowed'];
        pickupAddress = json['pickupAddress'];
        pickupDescription = json['pickupDescription'];
        droppFeeMinor = json['droppFeeMinor'];
        shippedFeeMinor = json['shippedFeeMinor'];
        orderEmail = json['orderEmail'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'pickupAllowed': pickupAllowed,
        'droppAllowed': droppAllowed,
        'shippedAllowed': shippedAllowed,
        'pickupAddress': pickupAddress,
        'pickupDescription': pickupDescription,
        'droppFeeMinor': droppFeeMinor,
        'shippedFeeMinor': shippedFeeMinor,
        'orderEmail': orderEmail
    };

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

class WebshopCatalogResult implements IConvertible
{
    int? ownerId;
    List<WebshopProductSummary>? products;
    WebshopDeliveryOptions? delivery;
    int? statusCode;
    String? message;

    WebshopCatalogResult({this.ownerId,this.products,this.delivery,this.statusCode,this.message});
    WebshopCatalogResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ownerId = json['ownerId'];
        products = JsonConverters.fromJson(json['products'],'List<WebshopProductSummary>',context!);
        delivery = JsonConverters.fromJson(json['delivery'],'WebshopDeliveryOptions',context!);
        statusCode = json['statusCode'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ownerId': ownerId,
        'products': JsonConverters.toJson(products,'List<WebshopProductSummary>',context!),
        'delivery': JsonConverters.toJson(delivery,'WebshopDeliveryOptions',context!),
        'statusCode': statusCode,
        'message': message
    };

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

class WebshopCatalogRequest implements IConvertible
{
    int? ownerId;
    String? externalId;

    WebshopCatalogRequest({this.ownerId,this.externalId});
    WebshopCatalogRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ownerId = json['ownerId'];
        externalId = json['externalId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ownerId': ownerId,
        'externalId': externalId
    };

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

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'WebshopVariantSummary': TypeInfo(TypeOf.Class, create:() => WebshopVariantSummary()),
    'WebshopProductSummary': TypeInfo(TypeOf.Class, create:() => WebshopProductSummary()),
    'List<WebshopVariantSummary>': TypeInfo(TypeOf.Class, create:() => <WebshopVariantSummary>[]),
    'WebshopDeliveryOptions': TypeInfo(TypeOf.Class, create:() => WebshopDeliveryOptions()),
    'WebshopCatalogResult': TypeInfo(TypeOf.Class, create:() => WebshopCatalogResult()),
    'List<WebshopProductSummary>': TypeInfo(TypeOf.Class, create:() => <WebshopProductSummary>[]),
    'WebshopCatalogRequest': TypeInfo(TypeOf.Class, create:() => WebshopCatalogRequest()),
});

Dart WebshopCatalogRequest DTOs

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

HTTP + JSV

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

GET /Webshop/Catalog/{OwnerId} HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ownerId: 0,
	products: 
	[
		{
			id: 0,
			ownerId: 0,
			name: String,
			description: String,
			category: String,
			subCategory: String,
			defaultPriceMinor: 0,
			imageUrl: String,
			viewOrder: 0,
			status: String,
			payoutInfoId: 0,
			legacyItemId: 0,
			variants: 
			[
				{
					id: 0,
					productId: 0,
					size: String,
					color: String,
					stockOnHand: 0,
					quantitySold: 0,
					availableQuantity: 0,
					status: String
				}
			]
		}
	],
	delivery: 
	{
		pickupAllowed: False,
		droppAllowed: False,
		shippedAllowed: False,
		pickupAddress: String,
		pickupDescription: String,
		droppFeeMinor: 0,
		shippedFeeMinor: 0,
		orderEmail: String
	},
	statusCode: 0,
	message: String
}