| GET | /stock/{brand}/{posCode}/{articleCode} | Get stock details |
|---|
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 Pos:
# @ApiMember(Description="Name of the POS", IsRequired=true)
name: Optional[str] = None
"""
Name of the POS
"""
# @ApiMember(Description="POS Code", IsRequired=true)
pos_code: Optional[str] = None
"""
POS Code
"""
# @ApiMember(Description="Pos Code To Be Displayed", IsRequired=true)
pos_code_to_be_displayed: Optional[str] = None
"""
Pos Code To Be Displayed
"""
# @ApiMember(Description="Country of the POS", IsRequired=true)
country: Optional[str] = None
"""
Country of the POS
"""
# @ApiMember(Description="City of the POS", IsRequired=true)
city: Optional[str] = None
"""
City of the POS
"""
# @ApiMember(Description="Postal Code", IsRequired=true)
postal_code: Optional[str] = None
"""
Postal Code
"""
# @ApiMember(Description="State", IsRequired=true)
state: Optional[str] = None
"""
State
"""
# @ApiMember(Description="Street", IsRequired=true)
street: Optional[str] = None
"""
Street
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UnitNetAmount:
# @ApiMember(Description="Currency Iso Code", IsRequired=true)
currency_iso_code: Optional[str] = None
"""
Currency Iso Code
"""
# @ApiMember(Description="Value", IsRequired=true)
value: Optional[Decimal] = None
"""
Value
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class StockPositionItem:
# @ApiMember(Description="Quantity", IsRequired=true)
quantity: int = 0
"""
Quantity
"""
# @ApiMember(Description="Serial Number")
serial_number: Optional[str] = None
"""
Serial Number
"""
# @ApiMember(Description="Stock Date", IsRequired=true)
stock_date: Optional[str] = None
"""
Stock Date
"""
# @ApiMember(Description="Loaded On Date", IsRequired=true)
loaded_on_date: Optional[str] = None
"""
Loaded On Date
"""
# @ApiMember(Description="Type e.g. consignment or standard", IsRequired=true)
type: Optional[str] = None
"""
Type e.g. consignment or standard
"""
# @ApiMember(Description="Is Consignment Sellable ", IsRequired=true)
is_consignment_sellable: bool = False
"""
Is Consignment Sellable
"""
# @ApiMember(Description="Sell-In Price. Disclaimer: this data will be arriving empty/null due to DealerCost project still being in test phase.")
unit_net_amount: Optional[UnitNetAmount] = None
"""
Sell-In Price. Disclaimer: this data will be arriving empty/null due to DealerCost project still being in test phase.
"""
# @ApiMember(Description="Retail Sales Price")
retail_sales_price: Optional[UnitNetAmount] = None
"""
Retail Sales Price
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetStockDetailResponse:
# @ApiMember(Description="Article code", IsRequired=true)
article_code: Optional[str] = None
"""
Article code
"""
# @ApiMember(Description="Brand", IsRequired=true)
brand: Optional[str] = None
"""
Brand
"""
# @ApiMember(Description="Pos Code", IsRequired=true)
pos_code: Optional[str] = None
"""
Pos Code
"""
# @ApiMember(Description="Current Stock Quantity", IsRequired=true)
current_stock_quantity: int = 0
"""
Current Stock Quantity
"""
# @ApiMember(Description="Shared Stock Location", IsRequired=true)
shared_stock_location: Optional[Pos] = None
"""
Shared Stock Location
"""
# @ApiMember(Description="Stock Positions", IsRequired=true)
stock_positions: Optional[List[StockPositionItem]] = None
"""
Stock Positions
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetStockDetail:
# @ApiMember(Description="Brand", IsRequired=true)
brand: Optional[str] = None
"""
Brand
"""
# @ApiMember(Description="POS Legacy", IsRequired=true)
pos_code: Optional[str] = None
"""
POS Legacy
"""
# @ApiMember(Description="Article Code", IsRequired=true)
article_code: Optional[str] = None
"""
Article Code
"""
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /stock/{brand}/{posCode}/{articleCode} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"articleCode":"String","brand":"String","posCode":"String","currentStockQuantity":0,"sharedStockLocation":{"name":"String","posCode":"String","posCodeToBeDisplayed":"String","country":"String","city":"String","postalCode":"String","state":"String","street":"String"},"stockPositions":[{"quantity":0,"serialNumber":"String","stockDate":"String","loadedOnDate":"String","type":"String","isConsignmentSellable":false,"unitNetAmount":{"currencyIsoCode":"String","value":0},"retailSalesPrice":{"currencyIsoCode":"String","value":0}}]}