| GET | /stock/{brand}/lookup | Get Serial Number and Article lookup from the database |
|---|
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 GetStockLookupResponse:
# @ApiMember(Description="Exists in Stock?", IsRequired=true)
exists_in_stock: bool = False
"""
Exists in Stock?
"""
# @ApiMember(Description="Stock Locations / POSes", IsRequired=true)
stock_location: Optional[Pos] = None
"""
Stock Locations / POSes
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetStockLookup:
# @ApiMember(Description="Brand", IsRequired=true)
brand: Optional[str] = None
"""
Brand
"""
# @ApiMember(Description="Article Code", IsRequired=true)
article_code: Optional[str] = None
"""
Article Code
"""
# @ApiMember(Description="Serial Number", IsRequired=true)
serial_number: Optional[str] = None
"""
Serial Number
"""
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.
GET /stock/{brand}/lookup HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetStockLookupResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Stock.ServiceModel">
<existsInStock>false</existsInStock>
<stockLocation>
<city>String</city>
<country>String</country>
<name>String</name>
<posCode>String</posCode>
<posCodeToBeDisplayed>String</posCodeToBeDisplayed>
<postalCode>String</postalCode>
<state>String</state>
<street>String</street>
</stockLocation>
</GetStockLookupResponse>