| GET | /price/{brand} | Get the list of prices of the requested items |
|---|
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 DealerCostPrice:
# @ApiMember(Description="Currency of the Dealer Cost Price", IsRequired=true)
currency: Optional[str] = None
"""
Currency of the Dealer Cost Price
"""
# @ApiMember(Description="Dealer Cost Price of the item", IsRequired=true)
price: Optional[Decimal] = None
"""
Dealer Cost Price of the item
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Price:
# @ApiMember(Description="Reference Code of the item", IsRequired=true)
article_code: Optional[str] = None
"""
Reference Code of the item
"""
# @ApiMember(Description="Currency of the price", IsRequired=true)
currency: Optional[str] = None
"""
Currency of the price
"""
# @ApiMember(Description="Retail price of the item")
retail_sale_price: Decimal = decimal.Decimal(0)
"""
Retail price of the item
"""
# @ApiMember(Description="Code of currency applied", IsRequired=true)
price_list_code: Optional[str] = None
"""
Code of currency applied
"""
# @ApiMember(Description="Dealer Cost Price")
dealer_cost_price: Optional[DealerCostPrice] = None
"""
Dealer Cost Price
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetPriceResponse(List[Price]):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetPrice:
# @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="List of Article Codes", IsRequired=true)
article_codes: Optional[List[str]] = None
"""
List of Article Codes
"""
# @ApiMember(Description="Include Dealer Cost Price in the response", IsRequired=true)
include_dealer_cost_price: bool = False
"""
Include Dealer Cost Price in the response
"""
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /price/{brand} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length [ ]