| POST | /purchase/v2 | Create Order |
|---|
import 'package:servicestack/servicestack.dart';
class StrapItem implements IConvertible
{
/**
* Article reference
*/
// @ApiMember(Description="Article reference")
String? speakingArticleCode;
/**
* Buckle type Description
*/
// @ApiMember(Description="Buckle type Description")
String? buckleTypeDescription;
/**
* Buckle type
*/
// @ApiMember(Description="Buckle type")
String? buckleTypeCode;
/**
* watch 6 Length
*/
// @ApiMember(Description="watch 6 Length")
int? watch6Length;
/**
* watch 12 Length
*/
// @ApiMember(Description="watch 12 Length")
int? watch12Length;
/**
* Article Material Code
*/
// @ApiMember(Description="Article Material Code")
String? materialCode;
/**
* Article Material Description
*/
// @ApiMember(Description="Article Material Description")
String? materialDescription;
/**
* Article Color Code
*/
// @ApiMember(Description="Article Color Code")
String? colorCode;
/**
* Article Color Description
*/
// @ApiMember(Description="Article Color Description")
String? colorDescription;
/**
* Buckle Witdh
*/
// @ApiMember(Description="Buckle Witdh")
String? buckleWidth;
/**
* Article Lining Code
*/
// @ApiMember(Description="Article Lining Code")
String? liningCode;
/**
* Article Lining Description
*/
// @ApiMember(Description="Article Lining Description")
String? liningDescription;
/**
* Article Stitching Code
*/
// @ApiMember(Description="Article Stitching Code")
String? stitchingCode;
/**
* Article Stitching Description
*/
// @ApiMember(Description="Article Stitching Description")
String? stitchingDescription;
/**
* Article Edge Code
*/
// @ApiMember(Description="Article Edge Code")
String? edgeCode;
/**
* Article Edge Description
*/
// @ApiMember(Description="Article Edge Description")
String? edgeDescription;
/**
* Article Padding Code
*/
// @ApiMember(Description="Article Padding Code")
String? paddingCode;
/**
* Article Padding Description
*/
// @ApiMember(Description="Article Padding Description")
String? paddingDescription;
/**
* Article Speciality Code
*/
// @ApiMember(Description="Article Speciality Code")
String? specialtyCode;
/**
* Article Speciality Description
*/
// @ApiMember(Description="Article Speciality Description")
String? specialtyDescription;
/**
* Nuancier Code
*/
// @ApiMember(Description="Nuancier Code")
String? nuancierCode;
/**
* Strap Vip Order
*/
// @ApiMember(Description="Strap Vip Order")
bool? isStrapVipOrder;
StrapItem({this.speakingArticleCode,this.buckleTypeDescription,this.buckleTypeCode,this.watch6Length,this.watch12Length,this.materialCode,this.materialDescription,this.colorCode,this.colorDescription,this.buckleWidth,this.liningCode,this.liningDescription,this.stitchingCode,this.stitchingDescription,this.edgeCode,this.edgeDescription,this.paddingCode,this.paddingDescription,this.specialtyCode,this.specialtyDescription,this.nuancierCode,this.isStrapVipOrder});
StrapItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
speakingArticleCode = json['speakingArticleCode'];
buckleTypeDescription = json['buckleTypeDescription'];
buckleTypeCode = json['buckleTypeCode'];
watch6Length = json['watch6Length'];
watch12Length = json['watch12Length'];
materialCode = json['materialCode'];
materialDescription = json['materialDescription'];
colorCode = json['colorCode'];
colorDescription = json['colorDescription'];
buckleWidth = json['buckleWidth'];
liningCode = json['liningCode'];
liningDescription = json['liningDescription'];
stitchingCode = json['stitchingCode'];
stitchingDescription = json['stitchingDescription'];
edgeCode = json['edgeCode'];
edgeDescription = json['edgeDescription'];
paddingCode = json['paddingCode'];
paddingDescription = json['paddingDescription'];
specialtyCode = json['specialtyCode'];
specialtyDescription = json['specialtyDescription'];
nuancierCode = json['nuancierCode'];
isStrapVipOrder = json['isStrapVipOrder'];
return this;
}
Map<String, dynamic> toJson() => {
'speakingArticleCode': speakingArticleCode,
'buckleTypeDescription': buckleTypeDescription,
'buckleTypeCode': buckleTypeCode,
'watch6Length': watch6Length,
'watch12Length': watch12Length,
'materialCode': materialCode,
'materialDescription': materialDescription,
'colorCode': colorCode,
'colorDescription': colorDescription,
'buckleWidth': buckleWidth,
'liningCode': liningCode,
'liningDescription': liningDescription,
'stitchingCode': stitchingCode,
'stitchingDescription': stitchingDescription,
'edgeCode': edgeCode,
'edgeDescription': edgeDescription,
'paddingCode': paddingCode,
'paddingDescription': paddingDescription,
'specialtyCode': specialtyCode,
'specialtyDescription': specialtyDescription,
'nuancierCode': nuancierCode,
'isStrapVipOrder': isStrapVipOrder
};
getTypeName() => "StrapItem";
TypeContext? context = _ctx;
}
class CreateOrderItemRequestV2 implements IConvertible
{
/**
* Line Number
*/
// @ApiMember(Description="Line Number", IsRequired=true)
int? lineNumber;
/**
* Reference ID of the article/product, e.g. 'CRWB520003'
*/
// @ApiMember(Description="Reference ID of the article/product, e.g. 'CRWB520003'", IsRequired=true)
String? articleCode;
/**
* Desired quantity of the article
*/
// @ApiMember(Description="Desired quantity of the article", IsRequired=true)
int? quantity;
/**
* Requested Delivery Date of the Item, e.g. '2020-12-30'
*/
// @ApiMember(Description="Requested Delivery Date of the Item, e.g. '2020-12-30'")
DateTime? requestedDeliveryDate;
/**
* Strap definition
*/
// @ApiMember(Description="Strap definition")
StrapItem? strap;
/**
* Purchase order type, e.g. 'WCFS', null. Null for ordinary order
*/
// @ApiMember(Description="Purchase order type, e.g. 'WCFS', null. Null for ordinary order")
String? orderType;
/**
* DeliveryPlantId of item, e.g.: CHD6
*/
// @ApiMember(Description="DeliveryPlantId of item, e.g.: CHD6")
String? deliveryPlantId;
/**
* Reason Code
*/
// @ApiMember(Description="Reason Code", IsRequired=true)
String? reasonCode;
/**
* Order Delivery Priority, e.g.: 10, 20, 30, 40, 50
*/
// @ApiMember(Description="Order Delivery Priority, e.g.: 10, 20, 30, 40, 50")
int? orderDeliveryPriority;
/**
* Buckle Summary, can be get from order simulation
*/
// @ApiMember(Description="Buckle Summary, can be get from order simulation")
String? buckleSummary;
/**
* Material Summary, can be get from order simulation
*/
// @ApiMember(Description="Material Summary, can be get from order simulation")
String? materialSummary;
/**
* Content Summary, can be get from order simulation
*/
// @ApiMember(Description="Content Summary, can be get from order simulation")
String? contentSummary;
/**
* Strap Summary, can be get from order simulation
*/
// @ApiMember(Description="Strap Summary, can be get from order simulation")
String? strapSummary;
CreateOrderItemRequestV2({this.lineNumber,this.articleCode,this.quantity,this.requestedDeliveryDate,this.strap,this.orderType,this.deliveryPlantId,this.reasonCode,this.orderDeliveryPriority,this.buckleSummary,this.materialSummary,this.contentSummary,this.strapSummary});
CreateOrderItemRequestV2.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
lineNumber = json['lineNumber'];
articleCode = json['articleCode'];
quantity = json['quantity'];
requestedDeliveryDate = JsonConverters.fromJson(json['requestedDeliveryDate'],'DateTime',context!);
strap = JsonConverters.fromJson(json['strap'],'StrapItem',context!);
orderType = json['orderType'];
deliveryPlantId = json['deliveryPlantId'];
reasonCode = json['reasonCode'];
orderDeliveryPriority = json['orderDeliveryPriority'];
buckleSummary = json['buckleSummary'];
materialSummary = json['materialSummary'];
contentSummary = json['contentSummary'];
strapSummary = json['strapSummary'];
return this;
}
Map<String, dynamic> toJson() => {
'lineNumber': lineNumber,
'articleCode': articleCode,
'quantity': quantity,
'requestedDeliveryDate': JsonConverters.toJson(requestedDeliveryDate,'DateTime',context!),
'strap': JsonConverters.toJson(strap,'StrapItem',context!),
'orderType': orderType,
'deliveryPlantId': deliveryPlantId,
'reasonCode': reasonCode,
'orderDeliveryPriority': orderDeliveryPriority,
'buckleSummary': buckleSummary,
'materialSummary': materialSummary,
'contentSummary': contentSummary,
'strapSummary': strapSummary
};
getTypeName() => "CreateOrderItemRequestV2";
TypeContext? context = _ctx;
}
class SplittedOrder implements IConvertible
{
/**
* Ship To Pos Code
*/
// @ApiMember(Description="Ship To Pos Code", IsRequired=true)
String? shipToId;
/**
* Final Ship To Pos Code
*/
// @ApiMember(Description="Final Ship To Pos Code")
String? finalShipToId;
/**
* Bill To Pos Code
*/
// @ApiMember(Description="Bill To Pos Code", IsRequired=true)
String? billToId;
/**
* Sold To Pos Code
*/
// @ApiMember(Description="Sold To Pos Code", IsRequired=true)
String? soldToId;
/**
* Sales Representative Code
*/
// @ApiMember(Description="Sales Representative Code")
String? salesRepresentativeId;
/**
* List of Articles to be created
*/
// @ApiMember(Description="List of Articles to be created", IsRequired=true)
List<CreateOrderItemRequestV2>? orderItems;
SplittedOrder({this.shipToId,this.finalShipToId,this.billToId,this.soldToId,this.salesRepresentativeId,this.orderItems});
SplittedOrder.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
shipToId = json['shipToId'];
finalShipToId = json['finalShipToId'];
billToId = json['billToId'];
soldToId = json['soldToId'];
salesRepresentativeId = json['salesRepresentativeId'];
orderItems = JsonConverters.fromJson(json['orderItems'],'List<CreateOrderItemRequestV2>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'shipToId': shipToId,
'finalShipToId': finalShipToId,
'billToId': billToId,
'soldToId': soldToId,
'salesRepresentativeId': salesRepresentativeId,
'orderItems': JsonConverters.toJson(orderItems,'List<CreateOrderItemRequestV2>',context!)
};
getTypeName() => "SplittedOrder";
TypeContext? context = _ctx;
}
class EndCustomerDetails implements IConvertible
{
/**
* Title of the end Customer, e.g. 'MR', 'MRS'.
*/
// @ApiMember(Description="Title of the end Customer, e.g. 'MR', 'MRS'.")
String? title;
/**
* First Name of the end Customer
*/
// @ApiMember(Description="First Name of the end Customer", IsRequired=true)
String? firstName;
/**
* Last Name of the end Customer
*/
// @ApiMember(Description="Last Name of the end Customer", IsRequired=true)
String? lastName;
/**
* Email of the end Customer
*/
// @ApiMember(Description="Email of the end Customer")
String? email;
/**
* Phone number of the end Customer, e.g. '0032477123456'.
*/
// @ApiMember(Description="Phone number of the end Customer, e.g. '0032477123456'. ")
String? phone;
/**
* Countr code in the shipping address, e.g. 'BE' (ISO Code)
*/
// @ApiMember(Description="Countr code in the shipping address, e.g. 'BE' (ISO Code)", IsRequired=true)
String? country;
/**
* City name in the shipping address
*/
// @ApiMember(Description="City name in the shipping address", IsRequired=true)
String? city;
/**
* Street name in the shipping address
*/
// @ApiMember(Description="Street name in the shipping address", IsRequired=true)
String? street;
/**
* House number in the shipping address
*/
// @ApiMember(Description="House number in the shipping address")
String? houseNumber;
/**
* Building number in the shipping address
*/
// @ApiMember(Description="Building number in the shipping address")
String? building;
/**
* Postal code in the shipping address
*/
// @ApiMember(Description="Postal code in the shipping address")
String? postalCode;
/**
* Region code in the shipping address, e.g. 'VL' (ISO Code)
*/
// @ApiMember(Description="Region code in the shipping address, e.g. 'VL' (ISO Code)")
String? region;
/**
* District name in the shipping address
*/
// @ApiMember(Description="District name in the shipping address")
String? district;
/**
* Additional Info number to the shipping address
*/
// @ApiMember(Description="Additional Info number to the shipping address")
String? additionalInfo;
EndCustomerDetails({this.title,this.firstName,this.lastName,this.email,this.phone,this.country,this.city,this.street,this.houseNumber,this.building,this.postalCode,this.region,this.district,this.additionalInfo});
EndCustomerDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
title = json['title'];
firstName = json['firstName'];
lastName = json['lastName'];
email = json['email'];
phone = json['phone'];
country = json['country'];
city = json['city'];
street = json['street'];
houseNumber = json['houseNumber'];
building = json['building'];
postalCode = json['postalCode'];
region = json['region'];
district = json['district'];
additionalInfo = json['additionalInfo'];
return this;
}
Map<String, dynamic> toJson() => {
'title': title,
'firstName': firstName,
'lastName': lastName,
'email': email,
'phone': phone,
'country': country,
'city': city,
'street': street,
'houseNumber': houseNumber,
'building': building,
'postalCode': postalCode,
'region': region,
'district': district,
'additionalInfo': additionalInfo
};
getTypeName() => "EndCustomerDetails";
TypeContext? context = _ctx;
}
class CreateOrderV2 implements IConvertible
{
/**
* Purchase order ID, total length-max with x-booster-App header: 99
*/
// @ApiMember(Description="Purchase order ID, total length-max with x-booster-App header: 99", IsRequired=true)
String? orderId;
/**
* Global Pos Code for the intended Order e.g. ES100:102048
*/
// @ApiMember(Description="Global Pos Code for the intended Order e.g. ES100:102048", IsRequired=true)
String? posCode;
/**
* Brand Trigram of the intended Order, e.g. 'IWC', 'CAR', etc.
*/
// @ApiMember(Description="Brand Trigram of the intended Order, e.g. 'IWC', 'CAR', etc.", IsRequired=true)
String? brand;
/**
* Additional Notes regarding the Order
*/
// @ApiMember(Description="Additional Notes regarding the Order")
String? notes;
/**
* Customer Reference
*/
// @ApiMember(Description="Customer Reference")
String? customerReference;
/**
* Customer Reference for Consignment Order
*/
// @ApiMember(Description="Customer Reference for Consignment Order")
String? customerReferenceConsignment;
/**
* Purchase order date, e.g. '2020-12-31'
*/
// @ApiMember(Description="Purchase order date, e.g. '2020-12-31'")
DateTime? orderDate;
/**
* Details of the end Customer
*/
// @ApiMember(Description="Details of the end Customer")
List<SplittedOrder>? splittedOrders;
/**
* Booster1 ID of the end Customer
*/
// @ApiMember(Description="Booster1 ID of the end Customer")
String? endCustomerBooster1Id;
/**
* Details of the end Customer
*/
// @ApiMember(Description="Details of the end Customer")
EndCustomerDetails? endCustomerDetails;
CreateOrderV2({this.orderId,this.posCode,this.brand,this.notes,this.customerReference,this.customerReferenceConsignment,this.orderDate,this.splittedOrders,this.endCustomerBooster1Id,this.endCustomerDetails});
CreateOrderV2.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
orderId = json['orderId'];
posCode = json['posCode'];
brand = json['brand'];
notes = json['notes'];
customerReference = json['customerReference'];
customerReferenceConsignment = json['customerReferenceConsignment'];
orderDate = JsonConverters.fromJson(json['orderDate'],'DateTime',context!);
splittedOrders = JsonConverters.fromJson(json['splittedOrders'],'List<SplittedOrder>',context!);
endCustomerBooster1Id = json['endCustomerBooster1Id'];
endCustomerDetails = JsonConverters.fromJson(json['endCustomerDetails'],'EndCustomerDetails',context!);
return this;
}
Map<String, dynamic> toJson() => {
'orderId': orderId,
'posCode': posCode,
'brand': brand,
'notes': notes,
'customerReference': customerReference,
'customerReferenceConsignment': customerReferenceConsignment,
'orderDate': JsonConverters.toJson(orderDate,'DateTime',context!),
'splittedOrders': JsonConverters.toJson(splittedOrders,'List<SplittedOrder>',context!),
'endCustomerBooster1Id': endCustomerBooster1Id,
'endCustomerDetails': JsonConverters.toJson(endCustomerDetails,'EndCustomerDetails',context!)
};
getTypeName() => "CreateOrderV2";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'StrapItem': TypeInfo(TypeOf.Class, create:() => StrapItem()),
'CreateOrderItemRequestV2': TypeInfo(TypeOf.Class, create:() => CreateOrderItemRequestV2()),
'SplittedOrder': TypeInfo(TypeOf.Class, create:() => SplittedOrder()),
'List<CreateOrderItemRequestV2>': TypeInfo(TypeOf.Class, create:() => <CreateOrderItemRequestV2>[]),
'EndCustomerDetails': TypeInfo(TypeOf.Class, create:() => EndCustomerDetails()),
'CreateOrderV2': TypeInfo(TypeOf.Class, create:() => CreateOrderV2()),
'List<SplittedOrder>': TypeInfo(TypeOf.Class, create:() => <SplittedOrder>[]),
});
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 /purchase/v2 HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"orderId":"String","posCode":"String","brand":"String","notes":"String","customerReference":"String","customerReferenceConsignment":"String","orderDate":"\/Date(-62135596800000-0000)\/","splittedOrders":[{"shipToId":"String","finalShipToId":"String","billToId":"String","soldToId":"String","salesRepresentativeId":"String","orderItems":[{"lineNumber":0,"articleCode":"String","quantity":0,"requestedDeliveryDate":"\/Date(-62135596800000-0000)\/","strap":{"speakingArticleCode":"String","buckleTypeDescription":"String","buckleTypeCode":"String","watch6Length":0,"watch12Length":0,"materialCode":"String","materialDescription":"String","colorCode":"String","colorDescription":"String","buckleWidth":"String","liningCode":"String","liningDescription":"String","stitchingCode":"String","stitchingDescription":"String","edgeCode":"String","edgeDescription":"String","paddingCode":"String","paddingDescription":"String","specialtyCode":"String","specialtyDescription":"String","nuancierCode":"String","isStrapVipOrder":false},"orderType":"String","deliveryPlantId":"String","reasonCode":"String","orderDeliveryPriority":0,"buckleSummary":"String","materialSummary":"String","contentSummary":"String","strapSummary":"String"}]}],"endCustomerBooster1Id":"String","endCustomerDetails":{"title":"String","firstName":"String","lastName":"String","email":"String","phone":"String","country":"String","city":"String","street":"String","houseNumber":"String","building":"String","postalCode":"String","region":"String","district":"String","additionalInfo":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{}