Richemont.Booster2.PublicApi

<back to all web services

CreateBasket

Requires Authentication
The following routes are available for this service:
POST/purchase/basketCreate Basket
import 'package:servicestack/servicestack.dart';

class BasketStrapItem 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;

    BasketStrapItem({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});
    BasketStrapItem.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() => "BasketStrapItem";
    TypeContext? context = _ctx;
}

class BasketItemResponse implements IConvertible
{
    /**
    * Line number of the article
    */
    // @ApiMember(Description="Line number of the article")
    int? line;

    /**
    * Reference ID of the article/product
    */
    // @ApiMember(Description="Reference ID of the article/product")
    String? articleCode;

    /**
    * Old reference ID of the article/product
    */
    // @ApiMember(Description="Old reference ID of the article/product")
    String? oldArticleCode;

    /**
    * Quantity of the article
    */
    // @ApiMember(Description="Quantity of the article")
    int? quantity;

    /**
    * Delivery date of the article
    */
    // @ApiMember(Description="Delivery date of the article")
    DateTime? deliveryDate;

    /**
    * Strap definition
    */
    // @ApiMember(Description="Strap definition")
    BasketStrapItem? strap;

    /**
    * Errors for the article
    */
    // @ApiMember(Description="Errors for the article")
    List<String>? errors;

    /**
    * Warnings for the article
    */
    // @ApiMember(Description="Warnings for the article")
    List<String>? warnings;

    BasketItemResponse({this.line,this.articleCode,this.oldArticleCode,this.quantity,this.deliveryDate,this.strap,this.errors,this.warnings});
    BasketItemResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        line = json['line'];
        articleCode = json['articleCode'];
        oldArticleCode = json['oldArticleCode'];
        quantity = json['quantity'];
        deliveryDate = JsonConverters.fromJson(json['deliveryDate'],'DateTime',context!);
        strap = JsonConverters.fromJson(json['strap'],'BasketStrapItem',context!);
        errors = JsonConverters.fromJson(json['errors'],'List<String>',context!);
        warnings = JsonConverters.fromJson(json['warnings'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'line': line,
        'articleCode': articleCode,
        'oldArticleCode': oldArticleCode,
        'quantity': quantity,
        'deliveryDate': JsonConverters.toJson(deliveryDate,'DateTime',context!),
        'strap': JsonConverters.toJson(strap,'BasketStrapItem',context!),
        'errors': JsonConverters.toJson(errors,'List<String>',context!),
        'warnings': JsonConverters.toJson(warnings,'List<String>',context!)
    };

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

class CreateBasketResponse implements IConvertible
{
    /**
    * ID of the newly created Purchase Order / Basket
    */
    // @ApiMember(Description="ID of the newly created Purchase Order / Basket", IsRequired=true)
    int? purchaseOrderId;

    /**
    * Validation results of each basket item
    */
    // @ApiMember(Description="Validation results of each basket item")
    List<BasketItemResponse>? validationResults;

    CreateBasketResponse({this.purchaseOrderId,this.validationResults});
    CreateBasketResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        purchaseOrderId = json['purchaseOrderId'];
        validationResults = JsonConverters.fromJson(json['validationResults'],'List<BasketItemResponse>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'purchaseOrderId': purchaseOrderId,
        'validationResults': JsonConverters.toJson(validationResults,'List<BasketItemResponse>',context!)
    };

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

class BasketItem implements IConvertible
{
    /**
    * Reference ID of the article/product
    */
    // @ApiMember(Description="Reference ID of the article/product", IsRequired=true)
    String? articleCode;

    /**
    * Desired quantity of the article
    */
    // @ApiMember(Description="Desired quantity of the article")
    int? quantity;

    /**
    * Strap definition
    */
    // @ApiMember(Description="Strap definition")
    BasketStrapItem? strap;

    BasketItem({this.articleCode,this.quantity,this.strap});
    BasketItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        articleCode = json['articleCode'];
        quantity = json['quantity'];
        strap = JsonConverters.fromJson(json['strap'],'BasketStrapItem',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'articleCode': articleCode,
        'quantity': quantity,
        'strap': JsonConverters.toJson(strap,'BasketStrapItem',context!)
    };

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

class CreateBasket implements IConvertible
{
    /**
    * Brand Trigram of the intended order
    */
    // @ApiMember(Description="Brand Trigram of the intended order", IsRequired=true)
    String? brand;

    /**
    * Pos Code for the intended order e.g. ES03-10415-01
    */
    // @ApiMember(Description="Pos Code for the intended order e.g. ES03-10415-01", IsRequired=true)
    String? posCode;

    /**
    * Customer Reference
    */
    // @ApiMember(Description="Customer Reference", IsRequired=true)
    String? customerReference;

    /**
    * Additional Notes regarding the order
    */
    // @ApiMember(Description="Additional Notes regarding the order", IsRequired=true)
    String? notes;

    /**
    * List of Articles to be added in the basket
    */
    // @ApiMember(Description="List of Articles to be added in the basket")
    List<BasketItem>? orderItems;

    /**
    * Brand Context ID
    */
    // @ApiMember(Description="Brand Context ID")
    String? boosterContextId;

    CreateBasket({this.brand,this.posCode,this.customerReference,this.notes,this.orderItems,this.boosterContextId});
    CreateBasket.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        brand = json['brand'];
        posCode = json['posCode'];
        customerReference = json['customerReference'];
        notes = json['notes'];
        orderItems = JsonConverters.fromJson(json['orderItems'],'List<BasketItem>',context!);
        boosterContextId = json['boosterContextId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'brand': brand,
        'posCode': posCode,
        'customerReference': customerReference,
        'notes': notes,
        'orderItems': JsonConverters.toJson(orderItems,'List<BasketItem>',context!),
        'boosterContextId': boosterContextId
    };

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

TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
    'BasketStrapItem': TypeInfo(TypeOf.Class, create:() => BasketStrapItem()),
    'BasketItemResponse': TypeInfo(TypeOf.Class, create:() => BasketItemResponse()),
    'CreateBasketResponse': TypeInfo(TypeOf.Class, create:() => CreateBasketResponse()),
    'List<BasketItemResponse>': TypeInfo(TypeOf.Class, create:() => <BasketItemResponse>[]),
    'BasketItem': TypeInfo(TypeOf.Class, create:() => BasketItem()),
    'CreateBasket': TypeInfo(TypeOf.Class, create:() => CreateBasket()),
    'List<BasketItem>': TypeInfo(TypeOf.Class, create:() => <BasketItem>[]),
});

Dart CreateBasket 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.

POST /purchase/basket HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	brand: String,
	posCode: String,
	customerReference: String,
	notes: String,
	orderItems: 
	[
		{
			articleCode: String,
			quantity: 0,
			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
			}
		}
	],
	boosterContextId: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	purchaseOrderId: 0,
	validationResults: 
	[
		{
			line: 0,
			articleCode: String,
			oldArticleCode: String,
			quantity: 0,
			deliveryDate: 0001-01-01,
			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
			},
			errors: 
			[
				String
			],
			warnings: 
			[
				String
			]
		}
	]
}