| Requires any of the roles: | Admin, TeamAdmin | Required permission: | Tickets.Add |
| POST | /Webshop/Variant/Restock |
|---|
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 WebshopVariantResult implements IConvertible
{
WebshopVariantSummary? variant;
int? statusCode;
String? message;
WebshopVariantResult({this.variant,this.statusCode,this.message});
WebshopVariantResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
variant = JsonConverters.fromJson(json['variant'],'WebshopVariantSummary',context!);
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'variant': JsonConverters.toJson(variant,'WebshopVariantSummary',context!),
'statusCode': statusCode,
'message': message
};
getTypeName() => "WebshopVariantResult";
TypeContext? context = _ctx;
}
class WebshopVariantRestockRequest implements IConvertible
{
int? variantId;
String? kind;
int? quantity;
String? note;
String? idempotencyKey;
int? ownerId;
WebshopVariantRestockRequest({this.variantId,this.kind,this.quantity,this.note,this.idempotencyKey,this.ownerId});
WebshopVariantRestockRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
variantId = json['variantId'];
kind = json['kind'];
quantity = json['quantity'];
note = json['note'];
idempotencyKey = json['idempotencyKey'];
ownerId = json['ownerId'];
return this;
}
Map<String, dynamic> toJson() => {
'variantId': variantId,
'kind': kind,
'quantity': quantity,
'note': note,
'idempotencyKey': idempotencyKey,
'ownerId': ownerId
};
getTypeName() => "WebshopVariantRestockRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'WebshopVariantSummary': TypeInfo(TypeOf.Class, create:() => WebshopVariantSummary()),
'WebshopVariantResult': TypeInfo(TypeOf.Class, create:() => WebshopVariantResult()),
'WebshopVariantRestockRequest': TypeInfo(TypeOf.Class, create:() => WebshopVariantRestockRequest()),
});
Dart WebshopVariantRestockRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Webshop/Variant/Restock HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/json
Content-Type: application/json
Content-Length: length
{"variantId":0,"kind":"String","quantity":0,"note":"String","idempotencyKey":"String","ownerId":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"variant":{"id":0,"productId":0,"size":"String","color":"String","stockOnHand":0,"quantitySold":0,"availableQuantity":0,"status":"String"},"statusCode":0,"message":"String"}