Trendsic Platform Service

<back to all web services

DispatchSettlementsRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/dispatch/settlements
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 DispatchSettlementsRequest implements IConvertible
{
    DispatchSettlementsRequest();
    DispatchSettlementsRequest.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "DispatchSettlementsRequest";
    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>[]),
    'DispatchSettlementsRequest': TypeInfo(TypeOf.Class, create:() => DispatchSettlementsRequest()),
});

Dart DispatchSettlementsRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /v1/dispatch/settlements HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Settlements":[{"SettlementId":0,"Code":"String","VendorID":0,"VendorName":"String","PeriodStart":"0001-01-01T00:00:00.0000000","PeriodEnd":"0001-01-01T00:00:00.0000000","LoadCount":0,"GrossRevenue":0,"SplitPct":0,"CarrierShare":0,"DeductionsTotal":0,"Net":0,"Status":"String","Notes":"String","GeneratedUtc":"0001-01-01T00:00:00.0000000","SentUtc":"0001-01-01T00:00:00.0000000","ApprovedUtc":"0001-01-01T00:00:00.0000000","ApprovedBy":"String","PaidUtc":"0001-01-01T00:00:00.0000000","PaidRef":"String","ContactCount":0,"Deductions":[{"DeductionId":0,"Kind":"String","Label":"String","Amount":0,"Note":"String"}],"Loads":[{"LoadId":0,"Code":"String","Module":"String","TruckLabel":"String","DriverLabel":"String","CarrierLabel":"String","SourceLabel":"String","DestinationLabel":"String","Qty":0,"Unit":"String","QtyText":"String","TicketCode":"String","RateApplied":0,"RateBasis":"String","Revenue":0,"PayPlanLabel":"String","Pay":0,"Status":"String","OpenedUtc":"0001-01-01T00:00:00.0000000","ClosedUtc":"0001-01-01T00:00:00.0000000","Photos":0,"Stages":[{"Stage":"String","AtUtc":"0001-01-01T00:00:00.0000000","Note":"String"}]}]}],"Settlement":{"SettlementId":0,"Code":"String","VendorID":0,"VendorName":"String","PeriodStart":"0001-01-01T00:00:00.0000000","PeriodEnd":"0001-01-01T00:00:00.0000000","LoadCount":0,"GrossRevenue":0,"SplitPct":0,"CarrierShare":0,"DeductionsTotal":0,"Net":0,"Status":"String","Notes":"String","GeneratedUtc":"0001-01-01T00:00:00.0000000","SentUtc":"0001-01-01T00:00:00.0000000","ApprovedUtc":"0001-01-01T00:00:00.0000000","ApprovedBy":"String","PaidUtc":"0001-01-01T00:00:00.0000000","PaidRef":"String","ContactCount":0,"Deductions":[{"DeductionId":0,"Kind":"String","Label":"String","Amount":0,"Note":"String"}],"Loads":[{"LoadId":0,"Code":"String","Module":"String","TruckLabel":"String","DriverLabel":"String","CarrierLabel":"String","SourceLabel":"String","DestinationLabel":"String","Qty":0,"Unit":"String","QtyText":"String","TicketCode":"String","RateApplied":0,"RateBasis":"String","Revenue":0,"PayPlanLabel":"String","Pay":0,"Status":"String","OpenedUtc":"0001-01-01T00:00:00.0000000","ClosedUtc":"0001-01-01T00:00:00.0000000","Photos":0,"Stages":[{"Stage":"String","AtUtc":"0001-01-01T00:00:00.0000000","Note":"String"}]}]},"Suggestions":[{"VendorID":0,"VendorName":"String","SplitPct":0,"Terms":"String","W9OnFile":false,"CoiExpires":"0001-01-01T00:00:00.0000000","PeriodStart":"0001-01-01T00:00:00.0000000","PeriodEnd":"0001-01-01T00:00:00.0000000","UnsettledLoads":0,"UnpricedLoads":0,"UnsettledPay":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}