| 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 .xml suffix or ?format=xml
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/xml
Content-Type: application/xml
Content-Length: length
<CreateBasket xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Purchase.ServiceModel">
<boosterContextId>String</boosterContextId>
<brand>String</brand>
<customerReference>String</customerReference>
<notes>String</notes>
<orderItems>
<BasketItem>
<articleCode>String</articleCode>
<quantity>0</quantity>
<strap xmlns:d4p1="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Purchase.ServiceModel.SharedModels">
<d4p1:buckleTypeCode>String</d4p1:buckleTypeCode>
<d4p1:buckleTypeDescription>String</d4p1:buckleTypeDescription>
<d4p1:buckleWidth>String</d4p1:buckleWidth>
<d4p1:colorCode>String</d4p1:colorCode>
<d4p1:colorDescription>String</d4p1:colorDescription>
<d4p1:edgeCode>String</d4p1:edgeCode>
<d4p1:edgeDescription>String</d4p1:edgeDescription>
<d4p1:isStrapVipOrder>false</d4p1:isStrapVipOrder>
<d4p1:liningCode>String</d4p1:liningCode>
<d4p1:liningDescription>String</d4p1:liningDescription>
<d4p1:materialCode>String</d4p1:materialCode>
<d4p1:materialDescription>String</d4p1:materialDescription>
<d4p1:nuancierCode>String</d4p1:nuancierCode>
<d4p1:paddingCode>String</d4p1:paddingCode>
<d4p1:paddingDescription>String</d4p1:paddingDescription>
<d4p1:speakingArticleCode>String</d4p1:speakingArticleCode>
<d4p1:specialtyCode>String</d4p1:specialtyCode>
<d4p1:specialtyDescription>String</d4p1:specialtyDescription>
<d4p1:stitchingCode>String</d4p1:stitchingCode>
<d4p1:stitchingDescription>String</d4p1:stitchingDescription>
<d4p1:watch12Length>0</d4p1:watch12Length>
<d4p1:watch6Length>0</d4p1:watch6Length>
</strap>
</BasketItem>
</orderItems>
<posCode>String</posCode>
</CreateBasket>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CreateBasketResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Purchase.ServiceModel">
<purchaseOrderId>0</purchaseOrderId>
<validationResults>
<BasketItemResponse>
<articleCode>String</articleCode>
<deliveryDate>0001-01-01T00:00:00</deliveryDate>
<errors xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</errors>
<line>0</line>
<oldArticleCode>String</oldArticleCode>
<quantity>0</quantity>
<strap xmlns:d4p1="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Purchase.ServiceModel.SharedModels">
<d4p1:buckleTypeCode>String</d4p1:buckleTypeCode>
<d4p1:buckleTypeDescription>String</d4p1:buckleTypeDescription>
<d4p1:buckleWidth>String</d4p1:buckleWidth>
<d4p1:colorCode>String</d4p1:colorCode>
<d4p1:colorDescription>String</d4p1:colorDescription>
<d4p1:edgeCode>String</d4p1:edgeCode>
<d4p1:edgeDescription>String</d4p1:edgeDescription>
<d4p1:isStrapVipOrder>false</d4p1:isStrapVipOrder>
<d4p1:liningCode>String</d4p1:liningCode>
<d4p1:liningDescription>String</d4p1:liningDescription>
<d4p1:materialCode>String</d4p1:materialCode>
<d4p1:materialDescription>String</d4p1:materialDescription>
<d4p1:nuancierCode>String</d4p1:nuancierCode>
<d4p1:paddingCode>String</d4p1:paddingCode>
<d4p1:paddingDescription>String</d4p1:paddingDescription>
<d4p1:speakingArticleCode>String</d4p1:speakingArticleCode>
<d4p1:specialtyCode>String</d4p1:specialtyCode>
<d4p1:specialtyDescription>String</d4p1:specialtyDescription>
<d4p1:stitchingCode>String</d4p1:stitchingCode>
<d4p1:stitchingDescription>String</d4p1:stitchingDescription>
<d4p1:watch12Length>0</d4p1:watch12Length>
<d4p1:watch6Length>0</d4p1:watch6Length>
</strap>
<warnings xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</warnings>
</BasketItemResponse>
</validationResults>
</CreateBasketResponse>