Richemont.Booster2.PublicApi

<back to all web services

CreateBasket

Requires Authentication
The following routes are available for this service:
POST/purchase/basketCreate Basket
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BasketStrapItem:
    # @ApiMember(Description="Article reference")
    speaking_article_code: Optional[str] = None
    """
    Article reference
    """


    # @ApiMember(Description="Buckle type Description")
    buckle_type_description: Optional[str] = None
    """
    Buckle type Description
    """


    # @ApiMember(Description="Buckle type")
    buckle_type_code: Optional[str] = None
    """
    Buckle type
    """


    # @ApiMember(Description="watch 6 Length")
    watch6_length: Optional[int] = None
    """
    watch 6 Length
    """


    # @ApiMember(Description="watch 12 Length")
    watch12_length: Optional[int] = None
    """
    watch 12 Length
    """


    # @ApiMember(Description="Article Material Code")
    material_code: Optional[str] = None
    """
    Article Material Code
    """


    # @ApiMember(Description="Article Material Description")
    material_description: Optional[str] = None
    """
    Article Material Description
    """


    # @ApiMember(Description="Article Color Code")
    color_code: Optional[str] = None
    """
    Article Color Code
    """


    # @ApiMember(Description="Article Color Description")
    color_description: Optional[str] = None
    """
    Article Color Description
    """


    # @ApiMember(Description="Buckle Witdh")
    buckle_width: Optional[str] = None
    """
    Buckle Witdh
    """


    # @ApiMember(Description="Article Lining Code")
    lining_code: Optional[str] = None
    """
    Article Lining Code
    """


    # @ApiMember(Description="Article Lining Description")
    lining_description: Optional[str] = None
    """
    Article Lining Description
    """


    # @ApiMember(Description="Article Stitching Code")
    stitching_code: Optional[str] = None
    """
    Article Stitching Code
    """


    # @ApiMember(Description="Article Stitching Description")
    stitching_description: Optional[str] = None
    """
    Article Stitching Description
    """


    # @ApiMember(Description="Article Edge Code")
    edge_code: Optional[str] = None
    """
    Article Edge Code
    """


    # @ApiMember(Description="Article Edge Description")
    edge_description: Optional[str] = None
    """
    Article Edge Description
    """


    # @ApiMember(Description="Article Padding Code")
    padding_code: Optional[str] = None
    """
    Article Padding Code
    """


    # @ApiMember(Description="Article Padding Description")
    padding_description: Optional[str] = None
    """
    Article Padding Description
    """


    # @ApiMember(Description="Article Speciality Code")
    specialty_code: Optional[str] = None
    """
    Article Speciality Code
    """


    # @ApiMember(Description="Article Speciality Description")
    specialty_description: Optional[str] = None
    """
    Article Speciality Description
    """


    # @ApiMember(Description="Nuancier Code")
    nuancier_code: Optional[str] = None
    """
    Nuancier Code
    """


    # @ApiMember(Description="Strap Vip Order")
    is_strap_vip_order: Optional[bool] = None
    """
    Strap Vip Order
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BasketItemResponse:
    # @ApiMember(Description="Line number of the article")
    line: int = 0
    """
    Line number of the article
    """


    # @ApiMember(Description="Reference ID of the article/product")
    article_code: Optional[str] = None
    """
    Reference ID of the article/product
    """


    # @ApiMember(Description="Old reference ID of the article/product")
    old_article_code: Optional[str] = None
    """
    Old reference ID of the article/product
    """


    # @ApiMember(Description="Quantity of the article")
    quantity: int = 0
    """
    Quantity of the article
    """


    # @ApiMember(Description="Delivery date of the article")
    delivery_date: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    Delivery date of the article
    """


    # @ApiMember(Description="Strap definition")
    strap: Optional[BasketStrapItem] = None
    """
    Strap definition
    """


    # @ApiMember(Description="Errors for the article")
    errors: Optional[List[str]] = None
    """
    Errors for the article
    """


    # @ApiMember(Description="Warnings for the article")
    warnings: Optional[List[str]] = None
    """
    Warnings for the article
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateBasketResponse:
    # @ApiMember(Description="ID of the newly created Purchase Order / Basket", IsRequired=true)
    purchase_order_id: int = 0
    """
    ID of the newly created Purchase Order / Basket
    """


    # @ApiMember(Description="Validation results of each basket item")
    validation_results: Optional[List[BasketItemResponse]] = None
    """
    Validation results of each basket item
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BasketItem:
    # @ApiMember(Description="Reference ID of the article/product", IsRequired=true)
    article_code: Optional[str] = None
    """
    Reference ID of the article/product
    """


    # @ApiMember(Description="Desired quantity of the article")
    quantity: int = 0
    """
    Desired quantity of the article
    """


    # @ApiMember(Description="Strap definition")
    strap: Optional[BasketStrapItem] = None
    """
    Strap definition
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateBasket:
    # @ApiMember(Description="Brand Trigram of the intended order", IsRequired=true)
    brand: Optional[str] = None
    """
    Brand Trigram of the intended order
    """


    # @ApiMember(Description="Pos Code for the intended order e.g. ES03-10415-01", IsRequired=true)
    pos_code: Optional[str] = None
    """
    Pos Code for the intended order e.g. ES03-10415-01
    """


    # @ApiMember(Description="Customer Reference", IsRequired=true)
    customer_reference: Optional[str] = None
    """
    Customer Reference
    """


    # @ApiMember(Description="Additional Notes regarding the order", IsRequired=true)
    notes: Optional[str] = None
    """
    Additional Notes regarding the order
    """


    # @ApiMember(Description="List of Articles to be added in the basket")
    order_items: Optional[List[BasketItem]] = None
    """
    List of Articles to be added in the basket
    """


    # @ApiMember(Description="Brand Context ID")
    booster_context_id: Optional[str] = None
    """
    Brand Context ID
    """

Python CreateBasket DTOs

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

HTTP + JSON

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"]}]}