Trendsic Platform Service

<back to all web services

PayApplicationUpdateRequest

Requires Authentication
The following routes are available for this service:
PATCH,PUT,OPTIONS/v1/projects/{ProjectID}/pay-apps/{PeriodNumber}
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 PayApplicationLine:
    pay_application_line_i_d: int = 0
    pay_application_i_d: int = 0
    cost_code: Optional[str] = None
    description: Optional[str] = None
    scheduled_value: Decimal = decimal.Decimal(0)
    from_previous_pct: Decimal = decimal.Decimal(0)
    this_period_pct: Decimal = decimal.Decimal(0)
    stored_materials: Decimal = decimal.Decimal(0)
    is_change_order: bool = False
    change_order_i_d: Optional[int] = None
    sort_order: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PayApplication:
    pay_application_i_d: int = 0
    pay_application_u_i_d: Optional[str] = None
    project_i_d: int = 0
    period_number: int = 0
    period_start: Optional[datetime.datetime] = None
    period_end: Optional[datetime.datetime] = None
    status: Optional[str] = None
    billing_template: Optional[str] = None
    retainage_pct: Decimal = decimal.Decimal(0)
    original_contract_sum: Decimal = decimal.Decimal(0)
    net_change_by_c_o: Decimal = decimal.Decimal(0)
    contract_sum_to_date: Decimal = decimal.Decimal(0)
    completed_stored_to_date: Decimal = decimal.Decimal(0)
    retainage_amount: Decimal = decimal.Decimal(0)
    earned_less_retainage: Decimal = decimal.Decimal(0)
    less_previous_certificates: Decimal = decimal.Decimal(0)
    current_payment_due: Decimal = decimal.Decimal(0)
    balance_to_finish: Decimal = decimal.Decimal(0)
    invoice_i_d: Optional[int] = None
    certified_at: Optional[datetime.datetime] = None
    certified_by: Optional[str] = None
    created_by: Optional[str] = None
    created_at: Optional[datetime.datetime] = None
    updated_at: Optional[datetime.datetime] = None
    lines: List[PayApplicationLine] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PayApplicationResponse:
    response_status: Optional[ResponseStatus] = None
    application: Optional[PayApplication] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PayApplicationUpdateRequest:
    project_i_d: int = 0
    period_number: int = 0
    period_start: Optional[datetime.datetime] = None
    period_end: Optional[datetime.datetime] = None
    retainage_pct: Optional[Decimal] = None
    billing_template: Optional[str] = None
    submit_for_certification: bool = False
    lines: List[PayApplicationLine] = field(default_factory=list)
    pull_from_wip: bool = False
    append_approved_change_orders: bool = False

Python PayApplicationUpdateRequest 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/projects/{ProjectID}/pay-apps/{PeriodNumber} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<PayApplicationUpdateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AppendApprovedChangeOrders>false</AppendApprovedChangeOrders>
  <BillingTemplate>String</BillingTemplate>
  <Lines>
    <PayApplicationLine>
      <ChangeOrderID>0</ChangeOrderID>
      <CostCode>String</CostCode>
      <Description>String</Description>
      <FromPreviousPct>0</FromPreviousPct>
      <IsChangeOrder>false</IsChangeOrder>
      <PayApplicationID>0</PayApplicationID>
      <PayApplicationLineID>0</PayApplicationLineID>
      <ScheduledValue>0</ScheduledValue>
      <SortOrder>0</SortOrder>
      <StoredMaterials>0</StoredMaterials>
      <ThisPeriodPct>0</ThisPeriodPct>
    </PayApplicationLine>
  </Lines>
  <PeriodEnd>0001-01-01T00:00:00</PeriodEnd>
  <PeriodNumber>0</PeriodNumber>
  <PeriodStart>0001-01-01T00:00:00</PeriodStart>
  <ProjectID>0</ProjectID>
  <PullFromWip>false</PullFromWip>
  <RetainagePct>0</RetainagePct>
  <SubmitForCertification>false</SubmitForCertification>
</PayApplicationUpdateRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PayApplicationResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Application>
    <BalanceToFinish>0</BalanceToFinish>
    <BillingTemplate>String</BillingTemplate>
    <CertifiedAt>0001-01-01T00:00:00</CertifiedAt>
    <CertifiedBy>String</CertifiedBy>
    <CompletedStoredToDate>0</CompletedStoredToDate>
    <ContractSumToDate>0</ContractSumToDate>
    <CreatedAt>0001-01-01T00:00:00</CreatedAt>
    <CreatedBy>String</CreatedBy>
    <CurrentPaymentDue>0</CurrentPaymentDue>
    <EarnedLessRetainage>0</EarnedLessRetainage>
    <InvoiceID>0</InvoiceID>
    <LessPreviousCertificates>0</LessPreviousCertificates>
    <Lines>
      <PayApplicationLine>
        <ChangeOrderID>0</ChangeOrderID>
        <CostCode>String</CostCode>
        <Description>String</Description>
        <FromPreviousPct>0</FromPreviousPct>
        <IsChangeOrder>false</IsChangeOrder>
        <PayApplicationID>0</PayApplicationID>
        <PayApplicationLineID>0</PayApplicationLineID>
        <ScheduledValue>0</ScheduledValue>
        <SortOrder>0</SortOrder>
        <StoredMaterials>0</StoredMaterials>
        <ThisPeriodPct>0</ThisPeriodPct>
      </PayApplicationLine>
    </Lines>
    <NetChangeByCO>0</NetChangeByCO>
    <OriginalContractSum>0</OriginalContractSum>
    <PayApplicationID>0</PayApplicationID>
    <PayApplicationUID>00000000-0000-0000-0000-000000000000</PayApplicationUID>
    <PeriodEnd>0001-01-01T00:00:00</PeriodEnd>
    <PeriodNumber>0</PeriodNumber>
    <PeriodStart>0001-01-01T00:00:00</PeriodStart>
    <ProjectID>0</ProjectID>
    <RetainageAmount>0</RetainageAmount>
    <RetainagePct>0</RetainagePct>
    <Status>String</Status>
    <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
  </Application>
  <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>
</PayApplicationResponse>