Trendsic Platform Service

<back to all web services

DispatchSettlementDeductionRequest

Requires Authentication
The following routes are available for this service:
PUT,OPTIONS/v1/dispatch/settlements/{SettlementId}/deduction
import 'package:servicestack/servicestack.dart';

class DispatchSettlementDeductionView implements IConvertible
{
    int? DeductionId;
    String? Kind;
    String? Label;
    double? Amount;
    String? Note;

    DispatchSettlementDeductionView({this.DeductionId,this.Kind,this.Label,this.Amount,this.Note});
    DispatchSettlementDeductionView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        DeductionId = json['DeductionId'];
        Kind = json['Kind'];
        Label = json['Label'];
        Amount = JsonConverters.toDouble(json['Amount']);
        Note = json['Note'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'DeductionId': DeductionId,
        'Kind': Kind,
        'Label': Label,
        'Amount': Amount,
        'Note': Note
    };

    getTypeName() => "DispatchSettlementDeductionView";
    TypeContext? context = _ctx;
}

class DispatchLoadStageView implements IConvertible
{
    String? Stage;
    DateTime? AtUtc;
    String? Note;

    DispatchLoadStageView({this.Stage,this.AtUtc,this.Note});
    DispatchLoadStageView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Stage = json['Stage'];
        AtUtc = JsonConverters.fromJson(json['AtUtc'],'DateTime',context!);
        Note = json['Note'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Stage': Stage,
        'AtUtc': JsonConverters.toJson(AtUtc,'DateTime',context!),
        'Note': Note
    };

    getTypeName() => "DispatchLoadStageView";
    TypeContext? context = _ctx;
}

class DispatchLoadView implements IConvertible
{
    int? LoadId;
    String? Code;
    String? Module;
    String? TruckLabel;
    String? DriverLabel;
    String? CarrierLabel;
    String? SourceLabel;
    String? DestinationLabel;
    double? Qty;
    String? Unit;
    String? QtyText;
    String? TicketCode;
    double? RateApplied;
    String? RateBasis;
    double? Revenue;
    String? PayPlanLabel;
    double? Pay;
    String? Status;
    DateTime? OpenedUtc;
    DateTime? ClosedUtc;
    int? Photos;
    List<DispatchLoadStageView>? Stages = [];

    DispatchLoadView({this.LoadId,this.Code,this.Module,this.TruckLabel,this.DriverLabel,this.CarrierLabel,this.SourceLabel,this.DestinationLabel,this.Qty,this.Unit,this.QtyText,this.TicketCode,this.RateApplied,this.RateBasis,this.Revenue,this.PayPlanLabel,this.Pay,this.Status,this.OpenedUtc,this.ClosedUtc,this.Photos,this.Stages});
    DispatchLoadView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        LoadId = json['LoadId'];
        Code = json['Code'];
        Module = json['Module'];
        TruckLabel = json['TruckLabel'];
        DriverLabel = json['DriverLabel'];
        CarrierLabel = json['CarrierLabel'];
        SourceLabel = json['SourceLabel'];
        DestinationLabel = json['DestinationLabel'];
        Qty = JsonConverters.toDouble(json['Qty']);
        Unit = json['Unit'];
        QtyText = json['QtyText'];
        TicketCode = json['TicketCode'];
        RateApplied = JsonConverters.toDouble(json['RateApplied']);
        RateBasis = json['RateBasis'];
        Revenue = JsonConverters.toDouble(json['Revenue']);
        PayPlanLabel = json['PayPlanLabel'];
        Pay = JsonConverters.toDouble(json['Pay']);
        Status = json['Status'];
        OpenedUtc = JsonConverters.fromJson(json['OpenedUtc'],'DateTime',context!);
        ClosedUtc = JsonConverters.fromJson(json['ClosedUtc'],'DateTime',context!);
        Photos = json['Photos'];
        Stages = JsonConverters.fromJson(json['Stages'],'List<DispatchLoadStageView>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'LoadId': LoadId,
        'Code': Code,
        'Module': Module,
        'TruckLabel': TruckLabel,
        'DriverLabel': DriverLabel,
        'CarrierLabel': CarrierLabel,
        'SourceLabel': SourceLabel,
        'DestinationLabel': DestinationLabel,
        'Qty': Qty,
        'Unit': Unit,
        'QtyText': QtyText,
        'TicketCode': TicketCode,
        'RateApplied': RateApplied,
        'RateBasis': RateBasis,
        'Revenue': Revenue,
        'PayPlanLabel': PayPlanLabel,
        'Pay': Pay,
        'Status': Status,
        'OpenedUtc': JsonConverters.toJson(OpenedUtc,'DateTime',context!),
        'ClosedUtc': JsonConverters.toJson(ClosedUtc,'DateTime',context!),
        'Photos': Photos,
        'Stages': JsonConverters.toJson(Stages,'List<DispatchLoadStageView>',context!)
    };

    getTypeName() => "DispatchLoadView";
    TypeContext? context = _ctx;
}

class DispatchSettlementView implements IConvertible
{
    int? SettlementId;
    String? Code;
    int? VendorID;
    String? VendorName;
    DateTime? PeriodStart;
    DateTime? PeriodEnd;
    int? LoadCount;
    double? GrossRevenue;
    double? SplitPct;
    double? CarrierShare;
    double? DeductionsTotal;
    double? Net;
    String? Status;
    String? Notes;
    DateTime? GeneratedUtc;
    DateTime? SentUtc;
    DateTime? ApprovedUtc;
    String? ApprovedBy;
    DateTime? PaidUtc;
    String? PaidRef;
    int? ContactCount;
    List<DispatchSettlementDeductionView>? Deductions = [];
    List<DispatchLoadView>? Loads = [];

    DispatchSettlementView({this.SettlementId,this.Code,this.VendorID,this.VendorName,this.PeriodStart,this.PeriodEnd,this.LoadCount,this.GrossRevenue,this.SplitPct,this.CarrierShare,this.DeductionsTotal,this.Net,this.Status,this.Notes,this.GeneratedUtc,this.SentUtc,this.ApprovedUtc,this.ApprovedBy,this.PaidUtc,this.PaidRef,this.ContactCount,this.Deductions,this.Loads});
    DispatchSettlementView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SettlementId = json['SettlementId'];
        Code = json['Code'];
        VendorID = json['VendorID'];
        VendorName = json['VendorName'];
        PeriodStart = JsonConverters.fromJson(json['PeriodStart'],'DateTime',context!);
        PeriodEnd = JsonConverters.fromJson(json['PeriodEnd'],'DateTime',context!);
        LoadCount = json['LoadCount'];
        GrossRevenue = JsonConverters.toDouble(json['GrossRevenue']);
        SplitPct = JsonConverters.toDouble(json['SplitPct']);
        CarrierShare = JsonConverters.toDouble(json['CarrierShare']);
        DeductionsTotal = JsonConverters.toDouble(json['DeductionsTotal']);
        Net = JsonConverters.toDouble(json['Net']);
        Status = json['Status'];
        Notes = json['Notes'];
        GeneratedUtc = JsonConverters.fromJson(json['GeneratedUtc'],'DateTime',context!);
        SentUtc = JsonConverters.fromJson(json['SentUtc'],'DateTime',context!);
        ApprovedUtc = JsonConverters.fromJson(json['ApprovedUtc'],'DateTime',context!);
        ApprovedBy = json['ApprovedBy'];
        PaidUtc = JsonConverters.fromJson(json['PaidUtc'],'DateTime',context!);
        PaidRef = json['PaidRef'];
        ContactCount = json['ContactCount'];
        Deductions = JsonConverters.fromJson(json['Deductions'],'List<DispatchSettlementDeductionView>',context!);
        Loads = JsonConverters.fromJson(json['Loads'],'List<DispatchLoadView>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SettlementId': SettlementId,
        'Code': Code,
        'VendorID': VendorID,
        'VendorName': VendorName,
        'PeriodStart': JsonConverters.toJson(PeriodStart,'DateTime',context!),
        'PeriodEnd': JsonConverters.toJson(PeriodEnd,'DateTime',context!),
        'LoadCount': LoadCount,
        'GrossRevenue': GrossRevenue,
        'SplitPct': SplitPct,
        'CarrierShare': CarrierShare,
        'DeductionsTotal': DeductionsTotal,
        'Net': Net,
        'Status': Status,
        'Notes': Notes,
        'GeneratedUtc': JsonConverters.toJson(GeneratedUtc,'DateTime',context!),
        'SentUtc': JsonConverters.toJson(SentUtc,'DateTime',context!),
        'ApprovedUtc': JsonConverters.toJson(ApprovedUtc,'DateTime',context!),
        'ApprovedBy': ApprovedBy,
        'PaidUtc': JsonConverters.toJson(PaidUtc,'DateTime',context!),
        'PaidRef': PaidRef,
        'ContactCount': ContactCount,
        'Deductions': JsonConverters.toJson(Deductions,'List<DispatchSettlementDeductionView>',context!),
        'Loads': JsonConverters.toJson(Loads,'List<DispatchLoadView>',context!)
    };

    getTypeName() => "DispatchSettlementView";
    TypeContext? context = _ctx;
}

class DispatchSettlementSuggestView implements IConvertible
{
    int? VendorID;
    String? VendorName;
    double? SplitPct;
    String? Terms;
    bool? W9OnFile;
    DateTime? CoiExpires;
    DateTime? PeriodStart;
    DateTime? PeriodEnd;
    int? UnsettledLoads;
    int? UnpricedLoads;
    double? UnsettledPay;

    DispatchSettlementSuggestView({this.VendorID,this.VendorName,this.SplitPct,this.Terms,this.W9OnFile,this.CoiExpires,this.PeriodStart,this.PeriodEnd,this.UnsettledLoads,this.UnpricedLoads,this.UnsettledPay});
    DispatchSettlementSuggestView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        VendorID = json['VendorID'];
        VendorName = json['VendorName'];
        SplitPct = JsonConverters.toDouble(json['SplitPct']);
        Terms = json['Terms'];
        W9OnFile = json['W9OnFile'];
        CoiExpires = JsonConverters.fromJson(json['CoiExpires'],'DateTime',context!);
        PeriodStart = JsonConverters.fromJson(json['PeriodStart'],'DateTime',context!);
        PeriodEnd = JsonConverters.fromJson(json['PeriodEnd'],'DateTime',context!);
        UnsettledLoads = json['UnsettledLoads'];
        UnpricedLoads = json['UnpricedLoads'];
        UnsettledPay = JsonConverters.toDouble(json['UnsettledPay']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'VendorID': VendorID,
        'VendorName': VendorName,
        'SplitPct': SplitPct,
        'Terms': Terms,
        'W9OnFile': W9OnFile,
        'CoiExpires': JsonConverters.toJson(CoiExpires,'DateTime',context!),
        'PeriodStart': JsonConverters.toJson(PeriodStart,'DateTime',context!),
        'PeriodEnd': JsonConverters.toJson(PeriodEnd,'DateTime',context!),
        'UnsettledLoads': UnsettledLoads,
        'UnpricedLoads': UnpricedLoads,
        'UnsettledPay': UnsettledPay
    };

    getTypeName() => "DispatchSettlementSuggestView";
    TypeContext? context = _ctx;
}

class DispatchSettlementsResponse implements IConvertible
{
    List<DispatchSettlementView>? Settlements = [];
    DispatchSettlementView? Settlement;
    List<DispatchSettlementSuggestView>? Suggestions = [];
    ResponseStatus? ResponseStatus;

    DispatchSettlementsResponse({this.Settlements,this.Settlement,this.Suggestions,this.ResponseStatus});
    DispatchSettlementsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Settlements = JsonConverters.fromJson(json['Settlements'],'List<DispatchSettlementView>',context!);
        Settlement = JsonConverters.fromJson(json['Settlement'],'DispatchSettlementView',context!);
        Suggestions = JsonConverters.fromJson(json['Suggestions'],'List<DispatchSettlementSuggestView>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Settlements': JsonConverters.toJson(Settlements,'List<DispatchSettlementView>',context!),
        'Settlement': JsonConverters.toJson(Settlement,'DispatchSettlementView',context!),
        'Suggestions': JsonConverters.toJson(Suggestions,'List<DispatchSettlementSuggestView>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "DispatchSettlementsResponse";
    TypeContext? context = _ctx;
}

class DispatchSettlementDeductionRequest implements IConvertible
{
    int? SettlementId;
    DispatchSettlementDeductionView? Deduction;
    bool? Delete;

    DispatchSettlementDeductionRequest({this.SettlementId,this.Deduction,this.Delete});
    DispatchSettlementDeductionRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SettlementId = json['SettlementId'];
        Deduction = JsonConverters.fromJson(json['Deduction'],'DispatchSettlementDeductionView',context!);
        Delete = json['Delete'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SettlementId': SettlementId,
        'Deduction': JsonConverters.toJson(Deduction,'DispatchSettlementDeductionView',context!),
        'Delete': Delete
    };

    getTypeName() => "DispatchSettlementDeductionRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'DispatchSettlementDeductionView': TypeInfo(TypeOf.Class, create:() => DispatchSettlementDeductionView()),
    'DispatchLoadStageView': TypeInfo(TypeOf.Class, create:() => DispatchLoadStageView()),
    'DispatchLoadView': TypeInfo(TypeOf.Class, create:() => DispatchLoadView()),
    'List<DispatchLoadStageView>': TypeInfo(TypeOf.Class, create:() => <DispatchLoadStageView>[]),
    'DispatchSettlementView': TypeInfo(TypeOf.Class, create:() => DispatchSettlementView()),
    'List<DispatchSettlementDeductionView>': TypeInfo(TypeOf.Class, create:() => <DispatchSettlementDeductionView>[]),
    'List<DispatchLoadView>': TypeInfo(TypeOf.Class, create:() => <DispatchLoadView>[]),
    'DispatchSettlementSuggestView': TypeInfo(TypeOf.Class, create:() => DispatchSettlementSuggestView()),
    'DispatchSettlementsResponse': TypeInfo(TypeOf.Class, create:() => DispatchSettlementsResponse()),
    'List<DispatchSettlementView>': TypeInfo(TypeOf.Class, create:() => <DispatchSettlementView>[]),
    'List<DispatchSettlementSuggestView>': TypeInfo(TypeOf.Class, create:() => <DispatchSettlementSuggestView>[]),
    'DispatchSettlementDeductionRequest': TypeInfo(TypeOf.Class, create:() => DispatchSettlementDeductionRequest()),
});

Dart DispatchSettlementDeductionRequest 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/dispatch/settlements/{SettlementId}/deduction HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<DispatchSettlementDeductionRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Deduction>
    <Amount>0</Amount>
    <DeductionId>0</DeductionId>
    <Kind>String</Kind>
    <Label>String</Label>
    <Note>String</Note>
  </Deduction>
  <Delete>false</Delete>
  <SettlementId>0</SettlementId>
</DispatchSettlementDeductionRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DispatchSettlementsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <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>
  <Settlement>
    <ApprovedBy>String</ApprovedBy>
    <ApprovedUtc>0001-01-01T00:00:00</ApprovedUtc>
    <CarrierShare>0</CarrierShare>
    <Code>String</Code>
    <ContactCount>0</ContactCount>
    <Deductions>
      <DispatchSettlementDeductionView>
        <Amount>0</Amount>
        <DeductionId>0</DeductionId>
        <Kind>String</Kind>
        <Label>String</Label>
        <Note>String</Note>
      </DispatchSettlementDeductionView>
    </Deductions>
    <DeductionsTotal>0</DeductionsTotal>
    <GeneratedUtc>0001-01-01T00:00:00</GeneratedUtc>
    <GrossRevenue>0</GrossRevenue>
    <LoadCount>0</LoadCount>
    <Loads>
      <DispatchLoadView>
        <CarrierLabel>String</CarrierLabel>
        <ClosedUtc>0001-01-01T00:00:00</ClosedUtc>
        <Code>String</Code>
        <DestinationLabel>String</DestinationLabel>
        <DriverLabel>String</DriverLabel>
        <LoadId>0</LoadId>
        <Module>String</Module>
        <OpenedUtc>0001-01-01T00:00:00</OpenedUtc>
        <Pay>0</Pay>
        <PayPlanLabel>String</PayPlanLabel>
        <Photos>0</Photos>
        <Qty>0</Qty>
        <QtyText>String</QtyText>
        <RateApplied>0</RateApplied>
        <RateBasis>String</RateBasis>
        <Revenue>0</Revenue>
        <SourceLabel>String</SourceLabel>
        <Stages>
          <DispatchLoadStageView>
            <AtUtc>0001-01-01T00:00:00</AtUtc>
            <Note>String</Note>
            <Stage>String</Stage>
          </DispatchLoadStageView>
        </Stages>
        <Status>String</Status>
        <TicketCode>String</TicketCode>
        <TruckLabel>String</TruckLabel>
        <Unit>String</Unit>
      </DispatchLoadView>
    </Loads>
    <Net>0</Net>
    <Notes>String</Notes>
    <PaidRef>String</PaidRef>
    <PaidUtc>0001-01-01T00:00:00</PaidUtc>
    <PeriodEnd>0001-01-01T00:00:00</PeriodEnd>
    <PeriodStart>0001-01-01T00:00:00</PeriodStart>
    <SentUtc>0001-01-01T00:00:00</SentUtc>
    <SettlementId>0</SettlementId>
    <SplitPct>0</SplitPct>
    <Status>String</Status>
    <VendorID>0</VendorID>
    <VendorName>String</VendorName>
  </Settlement>
  <Settlements>
    <DispatchSettlementView>
      <ApprovedBy>String</ApprovedBy>
      <ApprovedUtc>0001-01-01T00:00:00</ApprovedUtc>
      <CarrierShare>0</CarrierShare>
      <Code>String</Code>
      <ContactCount>0</ContactCount>
      <Deductions>
        <DispatchSettlementDeductionView>
          <Amount>0</Amount>
          <DeductionId>0</DeductionId>
          <Kind>String</Kind>
          <Label>String</Label>
          <Note>String</Note>
        </DispatchSettlementDeductionView>
      </Deductions>
      <DeductionsTotal>0</DeductionsTotal>
      <GeneratedUtc>0001-01-01T00:00:00</GeneratedUtc>
      <GrossRevenue>0</GrossRevenue>
      <LoadCount>0</LoadCount>
      <Loads>
        <DispatchLoadView>
          <CarrierLabel>String</CarrierLabel>
          <ClosedUtc>0001-01-01T00:00:00</ClosedUtc>
          <Code>String</Code>
          <DestinationLabel>String</DestinationLabel>
          <DriverLabel>String</DriverLabel>
          <LoadId>0</LoadId>
          <Module>String</Module>
          <OpenedUtc>0001-01-01T00:00:00</OpenedUtc>
          <Pay>0</Pay>
          <PayPlanLabel>String</PayPlanLabel>
          <Photos>0</Photos>
          <Qty>0</Qty>
          <QtyText>String</QtyText>
          <RateApplied>0</RateApplied>
          <RateBasis>String</RateBasis>
          <Revenue>0</Revenue>
          <SourceLabel>String</SourceLabel>
          <Stages>
            <DispatchLoadStageView>
              <AtUtc>0001-01-01T00:00:00</AtUtc>
              <Note>String</Note>
              <Stage>String</Stage>
            </DispatchLoadStageView>
          </Stages>
          <Status>String</Status>
          <TicketCode>String</TicketCode>
          <TruckLabel>String</TruckLabel>
          <Unit>String</Unit>
        </DispatchLoadView>
      </Loads>
      <Net>0</Net>
      <Notes>String</Notes>
      <PaidRef>String</PaidRef>
      <PaidUtc>0001-01-01T00:00:00</PaidUtc>
      <PeriodEnd>0001-01-01T00:00:00</PeriodEnd>
      <PeriodStart>0001-01-01T00:00:00</PeriodStart>
      <SentUtc>0001-01-01T00:00:00</SentUtc>
      <SettlementId>0</SettlementId>
      <SplitPct>0</SplitPct>
      <Status>String</Status>
      <VendorID>0</VendorID>
      <VendorName>String</VendorName>
    </DispatchSettlementView>
  </Settlements>
  <Suggestions>
    <DispatchSettlementSuggestView>
      <CoiExpires>0001-01-01T00:00:00</CoiExpires>
      <PeriodEnd>0001-01-01T00:00:00</PeriodEnd>
      <PeriodStart>0001-01-01T00:00:00</PeriodStart>
      <SplitPct>0</SplitPct>
      <Terms>String</Terms>
      <UnpricedLoads>0</UnpricedLoads>
      <UnsettledLoads>0</UnsettledLoads>
      <UnsettledPay>0</UnsettledPay>
      <VendorID>0</VendorID>
      <VendorName>String</VendorName>
      <W9OnFile>false</W9OnFile>
    </DispatchSettlementSuggestView>
  </Suggestions>
</DispatchSettlementsResponse>