| POST | /purchase/basket | Create Basket |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class CreateBasket
{
/**
* Brand Trigram of the intended order
*/
@ApiMember(Description="Brand Trigram of the intended order", IsRequired=true)
public String brand = null;
/**
* 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)
public String posCode = null;
/**
* Customer Reference
*/
@ApiMember(Description="Customer Reference", IsRequired=true)
public String customerReference = null;
/**
* Additional Notes regarding the order
*/
@ApiMember(Description="Additional Notes regarding the order", IsRequired=true)
public String notes = null;
/**
* List of Articles to be added in the basket
*/
@ApiMember(Description="List of Articles to be added in the basket")
public ArrayList<BasketItem> orderItems = null;
/**
* Brand Context ID
*/
@ApiMember(Description="Brand Context ID")
public String boosterContextId = null;
public String getBrand() { return brand; }
public CreateBasket setBrand(String value) { this.brand = value; return this; }
public String getPosCode() { return posCode; }
public CreateBasket setPosCode(String value) { this.posCode = value; return this; }
public String getCustomerReference() { return customerReference; }
public CreateBasket setCustomerReference(String value) { this.customerReference = value; return this; }
public String getNotes() { return notes; }
public CreateBasket setNotes(String value) { this.notes = value; return this; }
public ArrayList<BasketItem> getOrderItems() { return orderItems; }
public CreateBasket setOrderItems(ArrayList<BasketItem> value) { this.orderItems = value; return this; }
public String getBoosterContextId() { return boosterContextId; }
public CreateBasket setBoosterContextId(String value) { this.boosterContextId = value; return this; }
}
public static class BasketItem
{
/**
* Reference ID of the article/product
*/
@ApiMember(Description="Reference ID of the article/product", IsRequired=true)
public String articleCode = null;
/**
* Desired quantity of the article
*/
@ApiMember(Description="Desired quantity of the article")
public Integer quantity = null;
/**
* Strap definition
*/
@ApiMember(Description="Strap definition")
public BasketStrapItem strap = null;
public String getArticleCode() { return articleCode; }
public BasketItem setArticleCode(String value) { this.articleCode = value; return this; }
public Integer getQuantity() { return quantity; }
public BasketItem setQuantity(Integer value) { this.quantity = value; return this; }
public BasketStrapItem getStrap() { return strap; }
public BasketItem setStrap(BasketStrapItem value) { this.strap = value; return this; }
}
public static class BasketStrapItem
{
/**
* Article reference
*/
@ApiMember(Description="Article reference")
public String speakingArticleCode = null;
/**
* Buckle type Description
*/
@ApiMember(Description="Buckle type Description")
public String buckleTypeDescription = null;
/**
* Buckle type
*/
@ApiMember(Description="Buckle type")
public String buckleTypeCode = null;
/**
* watch 6 Length
*/
@ApiMember(Description="watch 6 Length")
public Integer watch6Length = null;
/**
* watch 12 Length
*/
@ApiMember(Description="watch 12 Length")
public Integer watch12Length = null;
/**
* Article Material Code
*/
@ApiMember(Description="Article Material Code")
public String materialCode = null;
/**
* Article Material Description
*/
@ApiMember(Description="Article Material Description")
public String materialDescription = null;
/**
* Article Color Code
*/
@ApiMember(Description="Article Color Code")
public String colorCode = null;
/**
* Article Color Description
*/
@ApiMember(Description="Article Color Description")
public String colorDescription = null;
/**
* Buckle Witdh
*/
@ApiMember(Description="Buckle Witdh")
public String buckleWidth = null;
/**
* Article Lining Code
*/
@ApiMember(Description="Article Lining Code")
public String liningCode = null;
/**
* Article Lining Description
*/
@ApiMember(Description="Article Lining Description")
public String liningDescription = null;
/**
* Article Stitching Code
*/
@ApiMember(Description="Article Stitching Code")
public String stitchingCode = null;
/**
* Article Stitching Description
*/
@ApiMember(Description="Article Stitching Description")
public String stitchingDescription = null;
/**
* Article Edge Code
*/
@ApiMember(Description="Article Edge Code")
public String edgeCode = null;
/**
* Article Edge Description
*/
@ApiMember(Description="Article Edge Description")
public String edgeDescription = null;
/**
* Article Padding Code
*/
@ApiMember(Description="Article Padding Code")
public String paddingCode = null;
/**
* Article Padding Description
*/
@ApiMember(Description="Article Padding Description")
public String paddingDescription = null;
/**
* Article Speciality Code
*/
@ApiMember(Description="Article Speciality Code")
public String specialtyCode = null;
/**
* Article Speciality Description
*/
@ApiMember(Description="Article Speciality Description")
public String specialtyDescription = null;
/**
* Nuancier Code
*/
@ApiMember(Description="Nuancier Code")
public String nuancierCode = null;
/**
* Strap Vip Order
*/
@ApiMember(Description="Strap Vip Order")
public Boolean isStrapVipOrder = null;
public String getSpeakingArticleCode() { return speakingArticleCode; }
public BasketStrapItem setSpeakingArticleCode(String value) { this.speakingArticleCode = value; return this; }
public String getBuckleTypeDescription() { return buckleTypeDescription; }
public BasketStrapItem setBuckleTypeDescription(String value) { this.buckleTypeDescription = value; return this; }
public String getBuckleTypeCode() { return buckleTypeCode; }
public BasketStrapItem setBuckleTypeCode(String value) { this.buckleTypeCode = value; return this; }
public Integer getWatch6Length() { return watch6Length; }
public BasketStrapItem setWatch6Length(Integer value) { this.watch6Length = value; return this; }
public Integer getWatch12Length() { return watch12Length; }
public BasketStrapItem setWatch12Length(Integer value) { this.watch12Length = value; return this; }
public String getMaterialCode() { return materialCode; }
public BasketStrapItem setMaterialCode(String value) { this.materialCode = value; return this; }
public String getMaterialDescription() { return materialDescription; }
public BasketStrapItem setMaterialDescription(String value) { this.materialDescription = value; return this; }
public String getColorCode() { return colorCode; }
public BasketStrapItem setColorCode(String value) { this.colorCode = value; return this; }
public String getColorDescription() { return colorDescription; }
public BasketStrapItem setColorDescription(String value) { this.colorDescription = value; return this; }
public String getBuckleWidth() { return buckleWidth; }
public BasketStrapItem setBuckleWidth(String value) { this.buckleWidth = value; return this; }
public String getLiningCode() { return liningCode; }
public BasketStrapItem setLiningCode(String value) { this.liningCode = value; return this; }
public String getLiningDescription() { return liningDescription; }
public BasketStrapItem setLiningDescription(String value) { this.liningDescription = value; return this; }
public String getStitchingCode() { return stitchingCode; }
public BasketStrapItem setStitchingCode(String value) { this.stitchingCode = value; return this; }
public String getStitchingDescription() { return stitchingDescription; }
public BasketStrapItem setStitchingDescription(String value) { this.stitchingDescription = value; return this; }
public String getEdgeCode() { return edgeCode; }
public BasketStrapItem setEdgeCode(String value) { this.edgeCode = value; return this; }
public String getEdgeDescription() { return edgeDescription; }
public BasketStrapItem setEdgeDescription(String value) { this.edgeDescription = value; return this; }
public String getPaddingCode() { return paddingCode; }
public BasketStrapItem setPaddingCode(String value) { this.paddingCode = value; return this; }
public String getPaddingDescription() { return paddingDescription; }
public BasketStrapItem setPaddingDescription(String value) { this.paddingDescription = value; return this; }
public String getSpecialtyCode() { return specialtyCode; }
public BasketStrapItem setSpecialtyCode(String value) { this.specialtyCode = value; return this; }
public String getSpecialtyDescription() { return specialtyDescription; }
public BasketStrapItem setSpecialtyDescription(String value) { this.specialtyDescription = value; return this; }
public String getNuancierCode() { return nuancierCode; }
public BasketStrapItem setNuancierCode(String value) { this.nuancierCode = value; return this; }
public Boolean getIsStrapVipOrder() { return isStrapVipOrder; }
public BasketStrapItem setIsStrapVipOrder(Boolean value) { this.isStrapVipOrder = value; return this; }
}
public static class CreateBasketResponse
{
/**
* ID of the newly created Purchase Order / Basket
*/
@ApiMember(Description="ID of the newly created Purchase Order / Basket", IsRequired=true)
public Integer purchaseOrderId = null;
/**
* Validation results of each basket item
*/
@ApiMember(Description="Validation results of each basket item")
public ArrayList<BasketItemResponse> validationResults = null;
public Integer getPurchaseOrderId() { return purchaseOrderId; }
public CreateBasketResponse setPurchaseOrderId(Integer value) { this.purchaseOrderId = value; return this; }
public ArrayList<BasketItemResponse> getValidationResults() { return validationResults; }
public CreateBasketResponse setValidationResults(ArrayList<BasketItemResponse> value) { this.validationResults = value; return this; }
}
public static class BasketItemResponse
{
/**
* Line number of the article
*/
@ApiMember(Description="Line number of the article")
public Integer line = null;
/**
* Reference ID of the article/product
*/
@ApiMember(Description="Reference ID of the article/product")
public String articleCode = null;
/**
* Old reference ID of the article/product
*/
@ApiMember(Description="Old reference ID of the article/product")
public String oldArticleCode = null;
/**
* Quantity of the article
*/
@ApiMember(Description="Quantity of the article")
public Integer quantity = null;
/**
* Delivery date of the article
*/
@ApiMember(Description="Delivery date of the article")
public Date deliveryDate = null;
/**
* Strap definition
*/
@ApiMember(Description="Strap definition")
public BasketStrapItem strap = null;
/**
* Errors for the article
*/
@ApiMember(Description="Errors for the article")
public ArrayList<String> errors = null;
/**
* Warnings for the article
*/
@ApiMember(Description="Warnings for the article")
public ArrayList<String> warnings = null;
public Integer getLine() { return line; }
public BasketItemResponse setLine(Integer value) { this.line = value; return this; }
public String getArticleCode() { return articleCode; }
public BasketItemResponse setArticleCode(String value) { this.articleCode = value; return this; }
public String getOldArticleCode() { return oldArticleCode; }
public BasketItemResponse setOldArticleCode(String value) { this.oldArticleCode = value; return this; }
public Integer getQuantity() { return quantity; }
public BasketItemResponse setQuantity(Integer value) { this.quantity = value; return this; }
public Date getDeliveryDate() { return deliveryDate; }
public BasketItemResponse setDeliveryDate(Date value) { this.deliveryDate = value; return this; }
public BasketStrapItem getStrap() { return strap; }
public BasketItemResponse setStrap(BasketStrapItem value) { this.strap = value; return this; }
public ArrayList<String> getErrors() { return errors; }
public BasketItemResponse setErrors(ArrayList<String> value) { this.errors = value; return this; }
public ArrayList<String> getWarnings() { return warnings; }
public BasketItemResponse setWarnings(ArrayList<String> value) { this.warnings = value; return this; }
}
}
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/basket HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/json
Content-Type: application/json
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: application/json
Content-Length: length
{"purchaseOrderId":0,"validationResults":[{"line":0,"articleCode":"String","oldArticleCode":"String","quantity":0,"deliveryDate":"\/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},"errors":["String"],"warnings":["String"]}]}