| POST | /uplift/auth |
|---|
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 ApiServiceRequest(IServiceRequest, IHasApiKey, IHasDeviceInfo):
# @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
api_key: Optional[str] = None
"""
The API Key required for authentication
"""
# @ApiMember(DataType="double", Description="Latitude of the user making this request")
latitude: float = 0.0
"""
Latitude of the user making this request
"""
# @ApiMember(DataType="double", Description="Longitude of the user making this request")
longitude: float = 0.0
"""
Longitude of the user making this request
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiServiceResponse(IServiceResponse):
# @ApiMember(Description="Information about the response.", IsRequired=true)
description: Optional[str] = None
"""
Information about the response.
"""
# @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
heading: Optional[str] = None
"""
Heading or summary of the response.
"""
# @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
was_successful: bool = False
"""
Did the intended operation for this response complete successfully?
"""
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpliftAuthRequestResponse(ApiServiceResponse):
uplift_auth_request_id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpliftProductData:
uplift_product_id: int = 0
uplift_id: int = 0
product_id: int = 0
unit_price: Decimal = decimal.Decimal(0)
name: Optional[str] = None
category: Optional[str] = None
unit_barcode: Optional[str] = None
unit_size: Optional[str] = None
unit_weight: Decimal = decimal.Decimal(0)
code: Optional[str] = None
uplift_images: Optional[List[Object]] = None
quantity: float = 0.0
value: Decimal = decimal.Decimal(0)
price_over_max: bool = False
quantity_over_max: bool = False
quantity_over_requirement: bool = False
serial_number: Optional[str] = None
batch_code: Optional[str] = None
stock_status_id: int = 0
lot_number: Optional[str] = None
expiry_date: Optional[str] = None
manufacture_date: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpliftSealData:
unbagged: bool = False
seal_number: Optional[str] = None
antel_seal_number: Optional[str] = None
products: Optional[List[UpliftProductData]] = None
total_price: float = 0.0
total_quantity: float = 0.0
net_weight: float = 0.0
gross_weight: float = 0.0
billable_seal: bool = False
invalid_antel_seal_number: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpliftAuthRequest(ApiServiceRequest):
uplift_schedule_principle_id: int = 0
total_value: Decimal = decimal.Decimal(0)
total_units: float = 0.0
region: Optional[str] = None
channel: Optional[str] = None
seals: Optional[List[UpliftSealData]] = None
unbagged_items: Optional[UpliftSealData] = None
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.
POST /uplift/auth HTTP/1.1
Host: antel.api.dev.86degrees.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"upliftSchedulePrincipleId":0,"totalValue":0,"totalUnits":0,"region":"String","channel":"String","seals":[{"unbagged":false,"sealNumber":"String","antelSealNumber":"String","products":[{"upliftProductId":0,"upliftId":0,"productId":0,"unitPrice":0,"name":"String","category":"String","unitBarcode":"String","unitSize":"String","unitWeight":0,"code":"String","upliftImages":[{}],"quantity":0,"value":0,"priceOverMax":false,"quantityOverMax":false,"quantityOverRequirement":false,"serialNumber":"String","batchCode":"String","stockStatusId":0,"lotNumber":"String","expiryDate":"String","manufactureDate":"String"}],"totalPrice":0,"totalQuantity":0,"netWeight":0,"grossWeight":0,"billableSeal":false,"invalidAntelSealNumber":false}],"unbaggedItems":{"unbagged":false,"sealNumber":"String","antelSealNumber":"String","products":[{"upliftProductId":0,"upliftId":0,"productId":0,"unitPrice":0,"name":"String","category":"String","unitBarcode":"String","unitSize":"String","unitWeight":0,"code":"String","upliftImages":[{}],"quantity":0,"value":0,"priceOverMax":false,"quantityOverMax":false,"quantityOverRequirement":false,"serialNumber":"String","batchCode":"String","stockStatusId":0,"lotNumber":"String","expiryDate":"String","manufactureDate":"String"}],"totalPrice":0,"totalQuantity":0,"netWeight":0,"grossWeight":0,"billableSeal":false,"invalidAntelSealNumber":false},"apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"description":"String","heading":"String","wasSuccessful":false,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}