Trendsic Platform Service

<back to all web services

CourierTrackProblemRequest

The following routes are available for this service:
POST,OPTIONS/v1/dispatch/track/{Token}/problem
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 CourierTrackActRequest(IReturn[DispatchTrackResponse]):
    token: Optional[str] = None
    act_token: Optional[str] = None
    @staticmethod
    def response_type(): return DispatchTrackResponse


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchTrackStepView:
    name: Optional[str] = None
    at: Optional[datetime.datetime] = None
    done: bool = False
    current: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackBusiness:
    name: Optional[str] = None
    phone: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackDriver:
    first_name: Optional[str] = None
    initial: Optional[str] = None
    vehicle: Optional[str] = None
    plate: Optional[str] = None
    eta_min: Optional[int] = None
    eta_pct: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackProof:
    kind: Optional[str] = None
    photo_url: Optional[str] = None
    at_text: Optional[str] = None
    gps_ok: bool = False
    units: int = 0
    damage_note: Optional[str] = None
    delivered_to: Optional[str] = None
    waited_min: int = 0
    attempts: int = 0
    contacted_text: Optional[str] = None
    each_tagged: bool = False
    each_scanned: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackRating:
    stars: int = 0
    tags: Optional[str] = None
    tip: Decimal = decimal.Decimal(0)
    tip_status: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackSlot:
    id: Optional[str] = None
    day: Optional[str] = None
    day_es: Optional[str] = None
    win: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackMissed:
    code: Optional[str] = None
    fee: Decimal = decimal.Decimal(0)
    waited_min: int = 0
    auto_rebook: bool = False
    rebook_window_text: Optional[str] = None
    slots: List[CourierTrackSlot] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackCan:
    edit_instructions: bool = False
    change_units: bool = False
    cancel: bool = False
    reschedule_delivery: bool = False
    rebook: bool = False
    rate: bool = False
    message: bool = False
    report: bool = False
    max_units: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackMessage:
    who: Optional[str] = None
    mine: bool = False
    office: bool = False
    at_text: Optional[str] = None
    body: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackView:
    state: Optional[str] = None
    code: Optional[str] = None
    run_code: Optional[str] = None
    shape: Optional[str] = None
    template: Optional[str] = None
    courier_step: Optional[str] = None
    unit_one: Optional[str] = None
    unit_many: Optional[str] = None
    unit_one_es: Optional[str] = None
    unit_many_es: Optional[str] = None
    facility_noun: Optional[str] = None
    facility_noun_es: Optional[str] = None
    units: int = 0
    units_counted: bool = False
    address: Optional[str] = None
    dropoff_address: Optional[str] = None
    dropoff_name: Optional[str] = None
    instructions: Optional[str] = None
    gate_code: Optional[str] = None
    handoff: Optional[str] = None
    level_name: Optional[str] = None
    ready_promise: Optional[str] = None
    window_text: Optional[str] = None
    is_asap: bool = False
    times: Dict[str, str] = field(default_factory=dict)
    stop_position: Optional[int] = None
    stop_count: Optional[int] = None
    delivery_window_text: Optional[str] = None
    driver: Optional[CourierTrackDriver] = None
    proof: Optional[CourierTrackProof] = None
    handoff_code: Optional[str] = None
    rating: Optional[CourierTrackRating] = None
    tip_allowed: bool = False
    tips_pct: Decimal = decimal.Decimal(0)
    missed: Optional[CourierTrackMissed] = None
    cancel_fee: Decimal = decimal.Decimal(0)
    cancel_fee_charged: Decimal = decimal.Decimal(0)
    cancelled_by: Optional[str] = None
    book_url: Optional[str] = None
    can: Optional[CourierTrackCan] = None
    delivery_slots: List[CourierTrackSlot] = field(default_factory=list)
    messages: List[CourierTrackMessage] = field(default_factory=list)
    messages_open: bool = False
    case_code: Optional[str] = None
    case_status: Optional[str] = None
    case_reply: Optional[str] = None
    thread_hrs: int = 0
    expires_utc: Optional[datetime.datetime] = None
    live_eta: bool = False
    live: bool = False
    server_utc: datetime.datetime = datetime.datetime(1, 1, 1)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DispatchTrackResponse:
    kind: Optional[str] = None
    code: Optional[str] = None
    what: Optional[str] = None
    from_loc: Optional[str] = None
    to_loc: Optional[str] = None
    bags: Optional[int] = None
    fare: Optional[Decimal] = None
    pay_mode: Optional[str] = None
    card_last4: Optional[str] = None
    charged: bool = False
    stage: Optional[str] = None
    headline: Optional[str] = None
    sub: Optional[str] = None
    is_closed: bool = False
    eta: Optional[str] = None
    driver_name: Optional[str] = None
    customer_name: Optional[str] = None
    steps: List[DispatchTrackStepView] = field(default_factory=list)
    expired: bool = False
    invalid: bool = False
    business: Optional[CourierTrackBusiness] = None
    courier: Optional[CourierTrackView] = None
    notice: Optional[str] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierTrackProblemRequest(CourierTrackActRequest):
    reason: Optional[str] = None
    note: Optional[str] = None
    photos: List[str] = field(default_factory=list)

Python CourierTrackProblemRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/dispatch/track/{Token}/problem HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CourierTrackProblemRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ActToken>String</ActToken>
  <Token>String</Token>
  <Note>String</Note>
  <Photos xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Photos>
  <Reason>String</Reason>
</CourierTrackProblemRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DispatchTrackResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Bags>0</Bags>
  <Business>
    <Name>String</Name>
    <Phone>String</Phone>
  </Business>
  <CardLast4>String</CardLast4>
  <Charged>false</Charged>
  <Code>String</Code>
  <Courier>
    <Address>String</Address>
    <BookUrl>String</BookUrl>
    <Can>
      <Cancel>false</Cancel>
      <ChangeUnits>false</ChangeUnits>
      <EditInstructions>false</EditInstructions>
      <MaxUnits>0</MaxUnits>
      <Message>false</Message>
      <Rate>false</Rate>
      <Rebook>false</Rebook>
      <Report>false</Report>
      <RescheduleDelivery>false</RescheduleDelivery>
    </Can>
    <CancelFee>0</CancelFee>
    <CancelFeeCharged>0</CancelFeeCharged>
    <CancelledBy>String</CancelledBy>
    <CaseCode>String</CaseCode>
    <CaseReply>String</CaseReply>
    <CaseStatus>String</CaseStatus>
    <Code>String</Code>
    <CourierStep>String</CourierStep>
    <DeliverySlots>
      <CourierTrackSlot>
        <Day>String</Day>
        <DayEs>String</DayEs>
        <Id>String</Id>
        <Win>String</Win>
      </CourierTrackSlot>
    </DeliverySlots>
    <DeliveryWindowText>String</DeliveryWindowText>
    <Driver>
      <EtaMin>0</EtaMin>
      <EtaPct>0</EtaPct>
      <FirstName>String</FirstName>
      <Initial>String</Initial>
      <Plate>String</Plate>
      <Vehicle>String</Vehicle>
    </Driver>
    <DropoffAddress>String</DropoffAddress>
    <DropoffName>String</DropoffName>
    <ExpiresUtc>0001-01-01T00:00:00</ExpiresUtc>
    <FacilityNoun>String</FacilityNoun>
    <FacilityNounEs>String</FacilityNounEs>
    <GateCode>String</GateCode>
    <Handoff>String</Handoff>
    <HandoffCode>String</HandoffCode>
    <Instructions>String</Instructions>
    <IsAsap>false</IsAsap>
    <LevelName>String</LevelName>
    <Live>false</Live>
    <LiveEta>false</LiveEta>
    <Messages>
      <CourierTrackMessage>
        <AtText>String</AtText>
        <Body>String</Body>
        <Mine>false</Mine>
        <Office>false</Office>
        <Who>String</Who>
      </CourierTrackMessage>
    </Messages>
    <MessagesOpen>false</MessagesOpen>
    <Missed>
      <AutoRebook>false</AutoRebook>
      <Code>String</Code>
      <Fee>0</Fee>
      <RebookWindowText>String</RebookWindowText>
      <Slots>
        <CourierTrackSlot>
          <Day>String</Day>
          <DayEs>String</DayEs>
          <Id>String</Id>
          <Win>String</Win>
        </CourierTrackSlot>
      </Slots>
      <WaitedMin>0</WaitedMin>
    </Missed>
    <Proof>
      <AtText>String</AtText>
      <Attempts>0</Attempts>
      <ContactedText>String</ContactedText>
      <DamageNote>String</DamageNote>
      <DeliveredTo>String</DeliveredTo>
      <EachScanned>false</EachScanned>
      <EachTagged>false</EachTagged>
      <GpsOk>false</GpsOk>
      <Kind>String</Kind>
      <PhotoUrl>String</PhotoUrl>
      <Units>0</Units>
      <WaitedMin>0</WaitedMin>
    </Proof>
    <Rating>
      <Stars>0</Stars>
      <Tags>String</Tags>
      <Tip>0</Tip>
      <TipStatus>String</TipStatus>
    </Rating>
    <ReadyPromise>String</ReadyPromise>
    <RunCode>String</RunCode>
    <ServerUtc>0001-01-01T00:00:00</ServerUtc>
    <Shape>String</Shape>
    <State>String</State>
    <StopCount>0</StopCount>
    <StopPosition>0</StopPosition>
    <Template>String</Template>
    <ThreadHrs>0</ThreadHrs>
    <Times xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </Times>
    <TipAllowed>false</TipAllowed>
    <TipsPct>0</TipsPct>
    <UnitMany>String</UnitMany>
    <UnitManyEs>String</UnitManyEs>
    <UnitOne>String</UnitOne>
    <UnitOneEs>String</UnitOneEs>
    <Units>0</Units>
    <UnitsCounted>false</UnitsCounted>
    <WindowText>String</WindowText>
  </Courier>
  <CustomerName>String</CustomerName>
  <DriverName>String</DriverName>
  <Eta>String</Eta>
  <Expired>false</Expired>
  <Fare>0</Fare>
  <FromLoc>String</FromLoc>
  <Headline>String</Headline>
  <Invalid>false</Invalid>
  <IsClosed>false</IsClosed>
  <Kind>String</Kind>
  <Notice>String</Notice>
  <PayMode>String</PayMode>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Stage>String</Stage>
  <Steps>
    <DispatchTrackStepView>
      <At>0001-01-01T00:00:00</At>
      <Current>false</Current>
      <Done>false</Done>
      <Name>String</Name>
    </DispatchTrackStepView>
  </Steps>
  <Sub>String</Sub>
  <ToLoc>String</ToLoc>
  <What>String</What>
</DispatchTrackResponse>