| 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 .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}/lookup HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"existsInStock":false,"stockLocation":{"name":"String","posCode":"String","posCodeToBeDisplayed":"String","country":"String","city":"String","postalCode":"String","state":"String","street":"String"}}