| POST | /warranty | Create a Sell-Out | Create a sell-out in a POS you are authorised for |
|---|
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 CreateSellOutResponse:
# @ApiMember(Description="Unique Identifier of the Sell-out item created in Booster")
sale_detail_id: Optional[int] = None
"""
Unique Identifier of the Sell-out item created in Booster
"""
# @ApiMember(Description="Unique Identifiers of the Sell-out items created in Booster if more than one")
sale_detail_ids: Optional[List[int]] = None
"""
Unique Identifiers of the Sell-out items created in Booster if more than one
"""
# @ApiMember(Description="Unique Identifier of the Sell-out header created in Booster", IsRequired=true)
sale_id: int = 0
"""
Unique Identifier of the Sell-out header created in Booster
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateSellOut:
# @ApiMember(Description="Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided")
brand: Optional[str] = None
"""
Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided
"""
# @ApiMember(Description="Richemont POS code", IsRequired=true)
pos_code: Optional[str] = None
"""
Richemont POS code
"""
# @ApiMember(Description="Receipt or Invoice Number")
document_number: Optional[str] = None
"""
Receipt or Invoice Number
"""
# @ApiMember(Description="Date of the Sell-out", IsRequired=true)
document_date: datetime.datetime = datetime.datetime(1, 1, 1)
"""
Date of the Sell-out
"""
# @ApiMember(Description="Position Number")
document_line_number: Optional[int] = None
"""
Position Number
"""
# @ApiMember(Description="Richemont Reference Code of the item", IsRequired=true)
article_code: Optional[str] = None
"""
Richemont Reference Code of the item
"""
# @ApiMember(Description="Serial Number of the item")
serial_number: Optional[str] = None
"""
Serial Number of the item
"""
# @ApiMember(Description="Use positive for standard Sell-out and negative quantity for return", IsRequired=true)
quantity: int = 0
"""
Use positive for standard Sell-out and negative quantity for return
"""
# @ApiMember(Description="Sold Price")
unit_price: Optional[Decimal] = None
"""
Sold Price
"""
# @ApiMember(Description="Currency of the sold price")
currency_code: Optional[str] = None
"""
Currency of the sold price
"""
# @ApiMember(Description="Booster Customer Id")
booster_customer_id: Optional[int] = None
"""
Booster Customer Id
"""
# @ApiMember(Description="Sale Representative Email e.g. rauf.aliyev@richemont.com")
sale_representative_emails: Optional[List[str]] = None
"""
Sale Representative Email e.g. rauf.aliyev@richemont.com
"""
# @ApiMember(Description="Promoter Type ID, e.g. DAI, FIT, GRT")
promoter_type_id: Optional[str] = None
"""
Promoter Type ID, e.g. DAI, FIT, GRT
"""
# @ApiMember(Description="Return Reason ID, e.g ADM, CLR, EXC, DEF, OTH")
return_reason_id: Optional[str] = None
"""
Return Reason ID, e.g ADM, CLR, EXC, DEF, OTH
"""
# @ApiMember(Description="Sale related comments")
comments: Optional[str] = None
"""
Sale related comments
"""
# @ApiMember(Description="Original Sale Detail Id")
original_sale_detail_id: Optional[int] = None
"""
Original Sale Detail Id
"""
# @ApiMember(Description="To have the piece back in stock as consignment in case of consignment sellout return")
cons_sellout_return_in_stock: Optional[bool] = None
"""
To have the piece back in stock as consignment in case of consignment sellout return
"""
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 /warranty HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateSellOut xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Sellout.ServiceModel">
<articleCode>String</articleCode>
<boosterCustomerId>0</boosterCustomerId>
<brand>String</brand>
<comments>String</comments>
<consSelloutReturnInStock>false</consSelloutReturnInStock>
<currencyCode>String</currencyCode>
<documentDate>0001-01-01T00:00:00</documentDate>
<documentLineNumber>0</documentLineNumber>
<documentNumber>String</documentNumber>
<originalSaleDetailId>0</originalSaleDetailId>
<posCode>String</posCode>
<promoterTypeId>String</promoterTypeId>
<quantity>0</quantity>
<returnReasonId>String</returnReasonId>
<saleRepresentativeEmails xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</saleRepresentativeEmails>
<serialNumber>String</serialNumber>
<unitPrice>0</unitPrice>
</CreateSellOut>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CreateSellOutResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Sellout.ServiceModel">
<saleDetailId>0</saleDetailId>
<saleDetailIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</saleDetailIds>
<saleId>0</saleId>
</CreateSellOutResponse>