| GET | /buyin/{brand} | Get list of buyin | Get list of paginated buyin based on the search parameters submitted |
|---|
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
Object = TypeVar('Object')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BuyIn:
# @ApiMember(Description="Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided", IsRequired=true)
brand: Optional[str] = None
"""
Brand Trigram, e.g. CAR, IWC; compulsory only if articleCode is not provided
"""
# @ApiMember(Description="Code of BuyIn", IsRequired=true)
buy_in_order_id: int = 0
"""
Code of BuyIn
"""
# @ApiMember(Description="Richemont POS code", IsRequired=true)
pos_code: Optional[str] = None
"""
Richemont POS code
"""
# @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="Buy-in order status code")
buy_in_status_id: Optional[str] = None
"""
Buy-in order status code
"""
# @ApiMember(Description="Buy-in creation date")
buy_in_date: datetime.datetime = datetime.datetime(1, 1, 1)
"""
Buy-in creation date
"""
# @ApiMember(Description="Emails of Sale Representatives")
sale_representative_emails: List[str] = field(default_factory=list)
"""
Emails of Sale Representatives
"""
# @ApiMember(Description="True is the buy-in’s piece is in stock, False otherwise")
is_in_stock: bool = False
"""
True is the buy-in’s piece is in stock, False otherwise
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetBuyInPaginatedResponse:
# @ApiMember(Description="Index of the result set returnedr", IsRequired=true)
page: int = 0
"""
Index of the result set returnedr
"""
# @ApiMember(Description="Size of the result set returned", IsRequired=true)
items: int = 0
"""
Size of the result set returned
"""
# @ApiMember(Description="Total amount of pages / result sets", IsRequired=true)
total_pages: int = 0
"""
Total amount of pages / result sets
"""
# @ApiMember(Description="Total amount of results", IsRequired=true)
total_results: int = 0
"""
Total amount of results
"""
# @ApiMember(Description="List of Sale Details", IsRequired=true)
elements: Optional[List[BuyIn]] = None
"""
List of Sale Details
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetBuyInPaginated:
# @ApiMember(Description="Richemont Brand ID")
brand: Optional[str] = None
"""
Richemont Brand ID
"""
# @ApiMember(Description="Richemont POS code", IsRequired=true)
pos_code: Optional[str] = None
"""
Richemont POS code
"""
# @ApiMember(Description="Richemont Reference Code of the item")
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="Buy-in order status code")
buy_in_status_id: Optional[str] = None
"""
Buy-in order status code
"""
# @ApiMember(Description="True is the buy-in’s piece is in stock, False otherwise")
is_in_stock: Optional[bool] = None
"""
True is the buy-in’s piece is in stock, False otherwise
"""
# @ApiMember(Description="Index of the result set returned", IsRequired=true)
page: int = 0
"""
Index of the result set returned
"""
# @ApiMember(Description="Size of the result set returned", IsRequired=true)
items: int = 0
"""
Size of the result set returned
"""
# @ApiMember(Description="Omit precise record count - save on performance")
no_count: bool = False
"""
Omit precise record count - save on performance
"""
# @ApiMember(Description="Sort Expression, Possible values: 'SaleDetailIdDESC', 'DocumentDate'.")
sort_by: Optional[str] = None
"""
Sort Expression, Possible values: 'SaleDetailIdDESC', 'DocumentDate'.
"""
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.
GET /buyin/{brand} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"page":0,"items":0,"totalPages":0,"totalResults":0}