Trendsic Platform Service

<back to all web services

CustomerAppRecurringEditRequest

The following routes are available for this service:
PUT/v1/c/app/recurring/{Id}
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 CustomerAppSessionRequest:
    slug: Optional[str] = None
    profile: Optional[str] = None


@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 CourierBookLevel:
    code: Optional[str] = None
    name: Optional[str] = None
    ready: Optional[str] = None
    within_min: int = 0
    in_by: Optional[str] = None
    surcharge: Decimal = decimal.Decimal(0)
    days: List[int] = field(default_factory=list)
    deadline_min: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class HandoffOptions:
    hand: bool = False
    porch: bool = False
    desk: bool = False
    sig_required: bool = False
    id_required: bool = False
    code_required: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookProfile:
    code: Optional[str] = None
    name: Optional[str] = None
    shape: Optional[str] = None
    template: 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
    facility_name: Optional[str] = None
    levels: List[CourierBookLevel] = field(default_factory=list)
    asap: bool = False
    recurring: bool = False
    pay_timing: Optional[str] = None
    final_after_count: bool = False
    cancel_fee: Decimal = decimal.Decimal(0)
    missed_fee: Decimal = decimal.Decimal(0)
    missed_wait_min: int = 0
    service_area: List[str] = field(default_factory=list)
    zips: List[str] = field(default_factory=list)
    handoffs: Optional[HandoffOptions] = None


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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookPageView:
    available: bool = False
    booking_on: bool = False
    business: Optional[CourierTrackBusiness] = None
    profile: Optional[CourierBookProfile] = None
    profiles: List[CourierBookProfileLink] = field(default_factory=list)
    card_enabled: bool = False
    publishable_key: Optional[str] = None
    app_url: Optional[str] = None
    today: Optional[str] = None
    weekday: int = 0
    now_min: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppBoot:
    profile: Optional[str] = None
    available: bool = False
    reason: Optional[str] = None
    auth_method: Optional[str] = None
    slug: Optional[str] = None
    page: Optional[CourierBookPageView] = None
    manifest_url: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppAddress:
    id: int = 0
    label: Optional[str] = None
    street: Optional[str] = None
    unit: Optional[str] = None
    city: Optional[str] = None
    zip: Optional[str] = None
    lat: Optional[Decimal] = None
    lng: Optional[Decimal] = None
    in_area: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppCard:
    id: int = 0
    label: Optional[str] = None
    brand: Optional[str] = None
    last4: Optional[str] = None
    is_default: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppNotif:
    texts: bool = False
    push: bool = False
    promos: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppStep:
    key: Optional[str] = None
    done: bool = False
    time: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppOrder:
    id: int = 0
    code: Optional[str] = None
    status: Optional[str] = None
    state: Optional[str] = None
    active: bool = False
    level_code: Optional[str] = None
    level_name: Optional[str] = None
    units: int = 0
    units_found: Optional[int] = None
    address: Optional[str] = None
    unit: Optional[str] = None
    zip: Optional[str] = None
    drop_address: Optional[str] = None
    recipient_name: Optional[str] = None
    handoff: Optional[str] = None
    is_asap: bool = False
    day_ix: int = 0
    date_text: Optional[str] = None
    start_min: Optional[int] = None
    end_min: Optional[int] = None
    driver_first_name: Optional[str] = None
    eta_min: Optional[int] = None
    promise: Optional[str] = None
    pay_mode: Optional[str] = None
    amount: Decimal = decimal.Decimal(0)
    charged: Optional[Decimal] = None
    tip: Optional[Decimal] = None
    card_last4: Optional[str] = None
    recurrence_id: Optional[int] = None
    steps: List[CustomerAppStep] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppRecurrence:
    id: int = 0
    weekday: int = 0
    start_min: int = 0
    end_min: int = 0
    cadence: Optional[str] = None
    level_code: Optional[str] = None
    units: int = 0
    handoff: Optional[str] = None
    address: Optional[str] = None
    paused: bool = False
    pay_mode: Optional[str] = None
    card_last4: Optional[str] = None
    next_date: Optional[str] = None
    skipped_date: Optional[str] = None
    ahead_days: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppInvoice:
    uid: Optional[str] = None
    number: Optional[str] = None
    date_text: Optional[str] = None
    total: Decimal = decimal.Decimal(0)
    balance: Decimal = decimal.Decimal(0)
    paid: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppMe:
    contact_id: int = 0
    first_name: Optional[str] = None
    last_name: Optional[str] = None
    name: Optional[str] = None
    phone: Optional[str] = None
    needs_name: bool = False
    billing_mode: Optional[str] = None
    account_code: Optional[str] = None
    addresses: List[CustomerAppAddress] = field(default_factory=list)
    cards: List[CustomerAppCard] = field(default_factory=list)
    notif: Optional[CustomerAppNotif] = None
    orders: List[CustomerAppOrder] = field(default_factory=list)
    recurring: List[CustomerAppRecurrence] = field(default_factory=list)
    invoices: List[CustomerAppInvoice] = field(default_factory=list)
    today: Optional[str] = None
    now_min: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierBookOrderResponse:
    done: bool = False
    needs_action: bool = False
    client_secret: Optional[str] = None
    setup_intent_id: Optional[str] = None
    code: Optional[str] = None
    track_url: Optional[str] = None
    ics_url: Optional[str] = None
    window_text: Optional[str] = None
    promise: Optional[str] = None
    total: Decimal = decimal.Decimal(0)
    pay_timing: Optional[str] = None
    card_last4: Optional[str] = None
    repeats: Optional[str] = None
    link_sent_by: Optional[str] = None
    reopen_step: Optional[str] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CourierCustomerRow:
    contact_id: int = 0
    name: Optional[str] = None
    phone: Optional[str] = None
    billing_mode: Optional[str] = None
    account_code: Optional[str] = None
    orders: int = 0
    last_order_at: Optional[datetime.datetime] = None
    unbilled: int = 0
    unbilled_amount: Decimal = decimal.Decimal(0)
    cards: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RunResult:
    invoices: int = 0
    orders: int = 0
    total: Decimal = decimal.Decimal(0)
    skipped: List[str] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppResponse:
    boot: Optional[CustomerAppBoot] = None
    customer: Optional[CustomerAppMe] = None
    addresses: List[CustomerAppAddress] = field(default_factory=list)
    cards: List[CustomerAppCard] = field(default_factory=list)
    notif: Optional[CustomerAppNotif] = None
    recurring: List[CustomerAppRecurrence] = field(default_factory=list)
    booked: Optional[CourierBookOrderResponse] = None
    sent: bool = False
    token: Optional[str] = None
    needs_name: bool = False
    name: Optional[str] = None
    url: Optional[str] = None
    client_secret: Optional[str] = None
    publishable_key: Optional[str] = None
    message: Optional[str] = None
    reopen_step: Optional[str] = None
    customers: List[CourierCustomerRow] = field(default_factory=list)
    run: Optional[RunResult] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerAppRecurringEditRequest(CustomerAppSessionRequest):
    id: int = 0
    level: Optional[str] = None
    window_id: Optional[str] = None
    recur: Optional[str] = None
    units: int = 0
    handoff: Optional[str] = None
    gate_code: Optional[str] = None
    note: Optional[str] = None

Python CustomerAppRecurringEditRequest 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.

PUT /v1/c/app/recurring/{Id} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CustomerAppRecurringEditRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Profile>String</Profile>
  <Slug>String</Slug>
  <GateCode>String</GateCode>
  <Handoff>String</Handoff>
  <Id>0</Id>
  <Level>String</Level>
  <Note>String</Note>
  <Recur>String</Recur>
  <Units>0</Units>
  <WindowId>String</WindowId>
</CustomerAppRecurringEditRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerAppResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Addresses>
    <CustomerAppAddress>
      <City>String</City>
      <Id>0</Id>
      <InArea>false</InArea>
      <Label>String</Label>
      <Lat>0</Lat>
      <Lng>0</Lng>
      <Street>String</Street>
      <Unit>String</Unit>
      <Zip>String</Zip>
    </CustomerAppAddress>
  </Addresses>
  <Booked>
    <CardLast4>String</CardLast4>
    <ClientSecret>String</ClientSecret>
    <Code>String</Code>
    <Done>false</Done>
    <IcsUrl>String</IcsUrl>
    <LinkSentBy>String</LinkSentBy>
    <NeedsAction>false</NeedsAction>
    <PayTiming>String</PayTiming>
    <Promise>String</Promise>
    <ReopenStep>String</ReopenStep>
    <Repeats>String</Repeats>
    <ResponseStatus xmlns:d3p1="http://schemas.servicestack.net/types">
      <d3p1:ErrorCode>String</d3p1:ErrorCode>
      <d3p1:Message>String</d3p1:Message>
      <d3p1:StackTrace>String</d3p1:StackTrace>
      <d3p1:Errors>
        <d3p1:ResponseError>
          <d3p1:ErrorCode>String</d3p1:ErrorCode>
          <d3p1:FieldName>String</d3p1:FieldName>
          <d3p1:Message>String</d3p1:Message>
          <d3p1:Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </d3p1:Meta>
        </d3p1:ResponseError>
      </d3p1:Errors>
      <d3p1:Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d3p1:Meta>
    </ResponseStatus>
    <SetupIntentId>String</SetupIntentId>
    <Total>0</Total>
    <TrackUrl>String</TrackUrl>
    <WindowText>String</WindowText>
  </Booked>
  <Boot>
    <AuthMethod>String</AuthMethod>
    <Available>false</Available>
    <ManifestUrl>String</ManifestUrl>
    <Page>
      <AppUrl>String</AppUrl>
      <Available>false</Available>
      <BookingOn>false</BookingOn>
      <Business>
        <Name>String</Name>
        <Phone>String</Phone>
      </Business>
      <CardEnabled>false</CardEnabled>
      <NowMin>0</NowMin>
      <Profile>
        <Asap>false</Asap>
        <CancelFee>0</CancelFee>
        <Code>String</Code>
        <FacilityName>String</FacilityName>
        <FacilityNoun>String</FacilityNoun>
        <FacilityNounEs>String</FacilityNounEs>
        <FinalAfterCount>false</FinalAfterCount>
        <Handoffs>
          <CodeRequired>false</CodeRequired>
          <Desk>false</Desk>
          <Hand>false</Hand>
          <IdRequired>false</IdRequired>
          <Porch>false</Porch>
          <SigRequired>false</SigRequired>
        </Handoffs>
        <Levels>
          <CourierBookLevel>
            <Code>String</Code>
            <Days xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <d7p1:int>0</d7p1:int>
            </Days>
            <DeadlineMin>0</DeadlineMin>
            <InBy>String</InBy>
            <Name>String</Name>
            <Ready>String</Ready>
            <Surcharge>0</Surcharge>
            <WithinMin>0</WithinMin>
          </CourierBookLevel>
        </Levels>
        <MissedFee>0</MissedFee>
        <MissedWaitMin>0</MissedWaitMin>
        <Name>String</Name>
        <PayTiming>String</PayTiming>
        <Recurring>false</Recurring>
        <ServiceArea xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </ServiceArea>
        <Shape>String</Shape>
        <Template>String</Template>
        <UnitMany>String</UnitMany>
        <UnitManyEs>String</UnitManyEs>
        <UnitOne>String</UnitOne>
        <UnitOneEs>String</UnitOneEs>
        <Zips xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </Zips>
      </Profile>
      <Profiles>
        <CourierBookProfileLink>
          <Code>String</Code>
          <Name>String</Name>
          <Shape>String</Shape>
        </CourierBookProfileLink>
      </Profiles>
      <PublishableKey>String</PublishableKey>
      <Today>String</Today>
      <Weekday>0</Weekday>
    </Page>
    <Profile>String</Profile>
    <Reason>String</Reason>
    <Slug>String</Slug>
  </Boot>
  <Cards>
    <CustomerAppCard>
      <Brand>String</Brand>
      <Id>0</Id>
      <IsDefault>false</IsDefault>
      <Label>String</Label>
      <Last4>String</Last4>
    </CustomerAppCard>
  </Cards>
  <ClientSecret>String</ClientSecret>
  <Customer>
    <AccountCode>String</AccountCode>
    <Addresses>
      <CustomerAppAddress>
        <City>String</City>
        <Id>0</Id>
        <InArea>false</InArea>
        <Label>String</Label>
        <Lat>0</Lat>
        <Lng>0</Lng>
        <Street>String</Street>
        <Unit>String</Unit>
        <Zip>String</Zip>
      </CustomerAppAddress>
    </Addresses>
    <BillingMode>String</BillingMode>
    <Cards>
      <CustomerAppCard>
        <Brand>String</Brand>
        <Id>0</Id>
        <IsDefault>false</IsDefault>
        <Label>String</Label>
        <Last4>String</Last4>
      </CustomerAppCard>
    </Cards>
    <ContactId>0</ContactId>
    <FirstName>String</FirstName>
    <Invoices>
      <CustomerAppInvoice>
        <Balance>0</Balance>
        <DateText>String</DateText>
        <Number>String</Number>
        <Paid>false</Paid>
        <Total>0</Total>
        <Uid>00000000-0000-0000-0000-000000000000</Uid>
      </CustomerAppInvoice>
    </Invoices>
    <LastName>String</LastName>
    <Name>String</Name>
    <NeedsName>false</NeedsName>
    <Notif>
      <Promos>false</Promos>
      <Push>false</Push>
      <Texts>false</Texts>
    </Notif>
    <NowMin>0</NowMin>
    <Orders>
      <CustomerAppOrder>
        <Active>false</Active>
        <Address>String</Address>
        <Amount>0</Amount>
        <CardLast4>String</CardLast4>
        <Charged>0</Charged>
        <Code>String</Code>
        <DateText>String</DateText>
        <DayIx>0</DayIx>
        <DriverFirstName>String</DriverFirstName>
        <DropAddress>String</DropAddress>
        <EndMin>0</EndMin>
        <EtaMin>0</EtaMin>
        <Handoff>String</Handoff>
        <Id>0</Id>
        <IsAsap>false</IsAsap>
        <LevelCode>String</LevelCode>
        <LevelName>String</LevelName>
        <PayMode>String</PayMode>
        <Promise>String</Promise>
        <RecipientName>String</RecipientName>
        <RecurrenceId>0</RecurrenceId>
        <StartMin>0</StartMin>
        <State>String</State>
        <Status>String</Status>
        <Steps>
          <CustomerAppStep>
            <Done>false</Done>
            <Key>String</Key>
            <Time>String</Time>
          </CustomerAppStep>
        </Steps>
        <Tip>0</Tip>
        <Unit>String</Unit>
        <Units>0</Units>
        <UnitsFound>0</UnitsFound>
        <Zip>String</Zip>
      </CustomerAppOrder>
    </Orders>
    <Phone>String</Phone>
    <Recurring>
      <CustomerAppRecurrence>
        <Address>String</Address>
        <AheadDays>0</AheadDays>
        <Cadence>String</Cadence>
        <CardLast4>String</CardLast4>
        <EndMin>0</EndMin>
        <Handoff>String</Handoff>
        <Id>0</Id>
        <LevelCode>String</LevelCode>
        <NextDate>String</NextDate>
        <Paused>false</Paused>
        <PayMode>String</PayMode>
        <SkippedDate>String</SkippedDate>
        <StartMin>0</StartMin>
        <Units>0</Units>
        <Weekday>0</Weekday>
      </CustomerAppRecurrence>
    </Recurring>
    <Today>String</Today>
  </Customer>
  <Customers>
    <CourierCustomerRow>
      <AccountCode>String</AccountCode>
      <BillingMode>String</BillingMode>
      <Cards>0</Cards>
      <ContactId>0</ContactId>
      <LastOrderAt>0001-01-01T00:00:00</LastOrderAt>
      <Name>String</Name>
      <Orders>0</Orders>
      <Phone>String</Phone>
      <Unbilled>0</Unbilled>
      <UnbilledAmount>0</UnbilledAmount>
    </CourierCustomerRow>
  </Customers>
  <Message>String</Message>
  <Name>String</Name>
  <NeedsName>false</NeedsName>
  <Notif>
    <Promos>false</Promos>
    <Push>false</Push>
    <Texts>false</Texts>
  </Notif>
  <PublishableKey>String</PublishableKey>
  <Recurring>
    <CustomerAppRecurrence>
      <Address>String</Address>
      <AheadDays>0</AheadDays>
      <Cadence>String</Cadence>
      <CardLast4>String</CardLast4>
      <EndMin>0</EndMin>
      <Handoff>String</Handoff>
      <Id>0</Id>
      <LevelCode>String</LevelCode>
      <NextDate>String</NextDate>
      <Paused>false</Paused>
      <PayMode>String</PayMode>
      <SkippedDate>String</SkippedDate>
      <StartMin>0</StartMin>
      <Units>0</Units>
      <Weekday>0</Weekday>
    </CustomerAppRecurrence>
  </Recurring>
  <ReopenStep>String</ReopenStep>
  <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>
  <Run>
    <Invoices>0</Invoices>
    <Orders>0</Orders>
    <Skipped xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Skipped>
    <Total>0</Total>
  </Run>
  <Sent>false</Sent>
  <Token>String</Token>
  <Url>String</Url>
</CustomerAppResponse>