| 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 .csv suffix or ?format=csv
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: text/csv
Content-Type: text/csv
Content-Length: length
{"brand":"String","posCode":"String","documentNumber":"String","documentDate":"\/Date(-62135596800000-0000)\/","documentLineNumber":0,"articleCode":"String","serialNumber":"String","quantity":0,"unitPrice":0,"currencyCode":"String","boosterCustomerId":0,"saleRepresentativeEmails":["String"],"promoterTypeId":"String","returnReasonId":"String","comments":"String","originalSaleDetailId":0,"consSelloutReturnInStock":false}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"saleDetailId":0,"saleDetailIds":[0],"saleId":0}