| POST | /stock/validate | Create Validate Stock Request |
|---|
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 CreateStockValidateResponse:
# @ApiMember(Description="Validation Id", IsRequired=true)
validation_id: int = 0
"""
Validation Id
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateStockValidateRequestItem:
# @ApiMember(Description="Legacy Article Code of the item", IsRequired=true)
article_code: Optional[str] = None
"""
Legacy Article Code of the item
"""
# @ApiMember(Description="Stock Quantity", IsRequired=true)
quantity: int = 0
"""
Stock Quantity
"""
# @ApiMember(Description="Serial Numbers")
serial_numbers: Optional[List[str]] = None
"""
Serial Numbers
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CreateStockValidateRequest:
# @ApiMember(Description="Brand Trigram, e.g. CAR, IWC", IsRequired=true)
brand: Optional[str] = None
"""
Brand Trigram, e.g. CAR, IWC
"""
# @ApiMember(Description="POS Code e.g. ES100:102048", IsRequired=true)
pos_code: Optional[str] = None
"""
POS Code e.g. ES100:102048
"""
# @ApiMember(Description="Validation Date", IsRequired=true)
date: datetime.datetime = datetime.datetime(1, 1, 1)
"""
Validation Date
"""
# @ApiMember(Description="Items", IsRequired=true)
items: Optional[List[CreateStockValidateRequestItem]] = None
"""
Items
"""
Python CreateStockValidateRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /stock/validate HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"brand":"String","posCode":"String","date":"\/Date(-62135596800000-0000)\/","items":[{"articleCode":"String","quantity":0,"serialNumbers":["String"]}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"validationId":0}