| POST | /warranty | Create a Sell-Out | Create a sell-out in a POS you are authorised for |
|---|
import 'package:servicestack/servicestack.dart';
class CreateSellOutResponse implements IConvertible
{
/**
* Unique Identifier of the Sell-out item created in Booster
*/
// @ApiMember(Description="Unique Identifier of the Sell-out item created in Booster")
int? saleDetailId;
/**
* Unique Identifiers of the Sell-out items created in Booster if more than one
*/
// @ApiMember(Description="Unique Identifiers of the Sell-out items created in Booster if more than one")
List<int>? saleDetailIds;
/**
* Unique Identifier of the Sell-out header created in Booster
*/
// @ApiMember(Description="Unique Identifier of the Sell-out header created in Booster", IsRequired=true)
int? saleId;
CreateSellOutResponse({this.saleDetailId,this.saleDetailIds,this.saleId});
CreateSellOutResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
saleDetailId = json['saleDetailId'];
saleDetailIds = JsonConverters.fromJson(json['saleDetailIds'],'List<int>',context!);
saleId = json['saleId'];
return this;
}
Map<String, dynamic> toJson() => {
'saleDetailId': saleDetailId,
'saleDetailIds': JsonConverters.toJson(saleDetailIds,'List<int>',context!),
'saleId': saleId
};
getTypeName() => "CreateSellOutResponse";
TypeContext? context = _ctx;
}
class CreateSellOut implements IConvertible
{
/**
* Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided
*/
// @ApiMember(Description="Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided")
String? brand;
/**
* Richemont POS code
*/
// @ApiMember(Description="Richemont POS code", IsRequired=true)
String? posCode;
/**
* Receipt or Invoice Number
*/
// @ApiMember(Description="Receipt or Invoice Number")
String? documentNumber;
/**
* Date of the Sell-out
*/
// @ApiMember(Description="Date of the Sell-out", IsRequired=true)
DateTime? documentDate;
/**
* Position Number
*/
// @ApiMember(Description="Position Number")
int? documentLineNumber;
/**
* Richemont Reference Code of the item
*/
// @ApiMember(Description="Richemont Reference Code of the item", IsRequired=true)
String? articleCode;
/**
* Serial Number of the item
*/
// @ApiMember(Description="Serial Number of the item")
String? serialNumber;
/**
* Use positive for standard Sell-out and negative quantity for return
*/
// @ApiMember(Description="Use positive for standard Sell-out and negative quantity for return", IsRequired=true)
int? quantity;
/**
* Sold Price
*/
// @ApiMember(Description="Sold Price")
double? unitPrice;
/**
* Currency of the sold price
*/
// @ApiMember(Description="Currency of the sold price")
String? currencyCode;
/**
* Booster Customer Id
*/
// @ApiMember(Description="Booster Customer Id")
int? boosterCustomerId;
/**
* Sale Representative Email e.g. rauf.aliyev@richemont.com
*/
// @ApiMember(Description="Sale Representative Email e.g. rauf.aliyev@richemont.com")
List<String>? saleRepresentativeEmails;
/**
* Promoter Type ID, e.g. DAI, FIT, GRT
*/
// @ApiMember(Description="Promoter Type ID, e.g. DAI, FIT, GRT")
String? promoterTypeId;
/**
* Return Reason ID, e.g ADM, CLR, EXC, DEF, OTH
*/
// @ApiMember(Description="Return Reason ID, e.g ADM, CLR, EXC, DEF, OTH")
String? returnReasonId;
/**
* Sale related comments
*/
// @ApiMember(Description="Sale related comments")
String? comments;
/**
* Original Sale Detail Id
*/
// @ApiMember(Description="Original Sale Detail Id")
int? originalSaleDetailId;
/**
* To have the piece back in stock as consignment in case of consignment sellout return
*/
// @ApiMember(Description="To have the piece back in stock as consignment in case of consignment sellout return")
bool? consSelloutReturnInStock;
CreateSellOut({this.brand,this.posCode,this.documentNumber,this.documentDate,this.documentLineNumber,this.articleCode,this.serialNumber,this.quantity,this.unitPrice,this.currencyCode,this.boosterCustomerId,this.saleRepresentativeEmails,this.promoterTypeId,this.returnReasonId,this.comments,this.originalSaleDetailId,this.consSelloutReturnInStock});
CreateSellOut.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
brand = json['brand'];
posCode = json['posCode'];
documentNumber = json['documentNumber'];
documentDate = JsonConverters.fromJson(json['documentDate'],'DateTime',context!);
documentLineNumber = json['documentLineNumber'];
articleCode = json['articleCode'];
serialNumber = json['serialNumber'];
quantity = json['quantity'];
unitPrice = JsonConverters.toDouble(json['unitPrice']);
currencyCode = json['currencyCode'];
boosterCustomerId = json['boosterCustomerId'];
saleRepresentativeEmails = JsonConverters.fromJson(json['saleRepresentativeEmails'],'List<String>',context!);
promoterTypeId = json['promoterTypeId'];
returnReasonId = json['returnReasonId'];
comments = json['comments'];
originalSaleDetailId = json['originalSaleDetailId'];
consSelloutReturnInStock = json['consSelloutReturnInStock'];
return this;
}
Map<String, dynamic> toJson() => {
'brand': brand,
'posCode': posCode,
'documentNumber': documentNumber,
'documentDate': JsonConverters.toJson(documentDate,'DateTime',context!),
'documentLineNumber': documentLineNumber,
'articleCode': articleCode,
'serialNumber': serialNumber,
'quantity': quantity,
'unitPrice': unitPrice,
'currencyCode': currencyCode,
'boosterCustomerId': boosterCustomerId,
'saleRepresentativeEmails': JsonConverters.toJson(saleRepresentativeEmails,'List<String>',context!),
'promoterTypeId': promoterTypeId,
'returnReasonId': returnReasonId,
'comments': comments,
'originalSaleDetailId': originalSaleDetailId,
'consSelloutReturnInStock': consSelloutReturnInStock
};
getTypeName() => "CreateSellOut";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'CreateSellOutResponse': TypeInfo(TypeOf.Class, create:() => CreateSellOutResponse()),
'CreateSellOut': TypeInfo(TypeOf.Class, create:() => CreateSellOut()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /warranty HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"brand":"String","posCode":"String","documentNumber":"String","documentDate":"\/Date(-62135596800000-0000)\/","documentLineNumber":0,"articleCode":"String","serialNumber":"String","quantity":0,"unitPrice":0,"currencyCode":"String","boosterCustomerId":0,"saleRepresentativeEmails":["String"],"promoterTypeId":"String","returnReasonId":"String","comments":"String","originalSaleDetailId":0,"consSelloutReturnInStock":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"saleDetailId":0,"saleDetailIds":[0],"saleId":0}