POST | /orders/{OrderNumber}/shipments |
---|
import 'package:servicestack/servicestack.dart';
class NAVOrderShipmentCreateResponse implements IConvertible
{
ResponseStatus? responseStatus;
NAVOrderShipmentCreateResponse({this.responseStatus});
NAVOrderShipmentCreateResponse.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() => "NAVOrderShipmentCreateResponse";
TypeContext? context = _ctx;
}
class NAVOrderShipmentSku implements IConvertible
{
int? orderLineNumber;
int? quantityShipped;
String? substituteSkuCode;
NAVOrderShipmentSku({this.orderLineNumber,this.quantityShipped,this.substituteSkuCode});
NAVOrderShipmentSku.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
orderLineNumber = json['orderLineNumber'];
quantityShipped = json['quantityShipped'];
substituteSkuCode = json['substituteSkuCode'];
return this;
}
Map<String, dynamic> toJson() => {
'orderLineNumber': orderLineNumber,
'quantityShipped': quantityShipped,
'substituteSkuCode': substituteSkuCode
};
getTypeName() => "NAVOrderShipmentSku";
TypeContext? context = _ctx;
}
class NAVOrderShipment implements IConvertible
{
String? shippingMethod;
String? shippingSpeed;
String? trackingNumber;
String? shipmentStatus;
String? shipmentDetails;
double? shippingCost;
double? charge;
double? tax;
double? actualShippingCost;
double? cartonWeight;
List<NAVOrderShipmentSku>? orderShipmentSku;
NAVOrderShipment({this.shippingMethod,this.shippingSpeed,this.trackingNumber,this.shipmentStatus,this.shipmentDetails,this.shippingCost,this.charge,this.tax,this.actualShippingCost,this.cartonWeight,this.orderShipmentSku});
NAVOrderShipment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
shippingMethod = json['shippingMethod'];
shippingSpeed = json['shippingSpeed'];
trackingNumber = json['trackingNumber'];
shipmentStatus = json['shipmentStatus'];
shipmentDetails = json['shipmentDetails'];
shippingCost = JsonConverters.toDouble(json['shippingCost']);
charge = JsonConverters.toDouble(json['charge']);
tax = JsonConverters.toDouble(json['tax']);
actualShippingCost = JsonConverters.toDouble(json['actualShippingCost']);
cartonWeight = JsonConverters.toDouble(json['cartonWeight']);
orderShipmentSku = JsonConverters.fromJson(json['orderShipmentSku'],'List<NAVOrderShipmentSku>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'shippingMethod': shippingMethod,
'shippingSpeed': shippingSpeed,
'trackingNumber': trackingNumber,
'shipmentStatus': shipmentStatus,
'shipmentDetails': shipmentDetails,
'shippingCost': shippingCost,
'charge': charge,
'tax': tax,
'actualShippingCost': actualShippingCost,
'cartonWeight': cartonWeight,
'orderShipmentSku': JsonConverters.toJson(orderShipmentSku,'List<NAVOrderShipmentSku>',context!)
};
getTypeName() => "NAVOrderShipment";
TypeContext? context = _ctx;
}
class NAVOrderShipmentCreate implements IPost, IConvertible
{
String? orderNumber;
DateTime? shipmentDateUTC;
List<NAVOrderShipment>? shipment;
NAVOrderShipmentCreate({this.orderNumber,this.shipmentDateUTC,this.shipment});
NAVOrderShipmentCreate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
orderNumber = json['orderNumber'];
shipmentDateUTC = JsonConverters.fromJson(json['shipmentDateUTC'],'DateTime',context!);
shipment = JsonConverters.fromJson(json['shipment'],'List<NAVOrderShipment>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'orderNumber': orderNumber,
'shipmentDateUTC': JsonConverters.toJson(shipmentDateUTC,'DateTime',context!),
'shipment': JsonConverters.toJson(shipment,'List<NAVOrderShipment>',context!)
};
getTypeName() => "NAVOrderShipmentCreate";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'extensions.avon.ca', types: <String, TypeInfo> {
'NAVOrderShipmentCreateResponse': TypeInfo(TypeOf.Class, create:() => NAVOrderShipmentCreateResponse()),
'NAVOrderShipmentSku': TypeInfo(TypeOf.Class, create:() => NAVOrderShipmentSku()),
'NAVOrderShipment': TypeInfo(TypeOf.Class, create:() => NAVOrderShipment()),
'List<NAVOrderShipmentSku>': TypeInfo(TypeOf.Class, create:() => <NAVOrderShipmentSku>[]),
'NAVOrderShipmentCreate': TypeInfo(TypeOf.Class, create:() => NAVOrderShipmentCreate()),
'List<NAVOrderShipment>': TypeInfo(TypeOf.Class, create:() => <NAVOrderShipment>[]),
});
Dart NAVOrderShipmentCreate DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /orders/{OrderNumber}/shipments HTTP/1.1
Host: extensions.avon.ca
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"orderNumber":"String","shipmentDateUTC":"0001-01-01T00:00:00.0000000","shipment":[{"shippingMethod":"String","shippingSpeed":"String","trackingNumber":"String","shipmentStatus":"String","shipmentDetails":"String","shippingCost":0,"charge":0,"tax":0,"actualShippingCost":0,"cartonWeight":0,"orderShipmentSku":[{"orderLineNumber":0,"quantityShipped":0,"substituteSkuCode":"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"}}}