Trendsic Platform Service

<back to all web services

CourierBookQuoteRequest

The following routes are available for this service:
POST,OPTIONS/v1/book/{Slug}/quote
import 'package:servicestack/servicestack.dart';

class CourierBookQuoteLine implements IConvertible
{
    String? Kind;
    double? Amount;
    double? Qty;
    double? Rate;

    CourierBookQuoteLine({this.Kind,this.Amount,this.Qty,this.Rate});
    CourierBookQuoteLine.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Kind': Kind,
        'Amount': Amount,
        'Qty': Qty,
        'Rate': Rate
    };

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

class CourierBookQuoteResponse implements IConvertible
{
    String? Zone;
    double? Miles;
    List<CourierBookQuoteLine>? Lines = [];
    double? Total;
    ResponseStatus? ResponseStatus;

    CourierBookQuoteResponse({this.Zone,this.Miles,this.Lines,this.Total,this.ResponseStatus});
    CourierBookQuoteResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Zone = json['Zone'];
        Miles = JsonConverters.toDouble(json['Miles']);
        Lines = JsonConverters.fromJson(json['Lines'],'List<CourierBookQuoteLine>',context!);
        Total = JsonConverters.toDouble(json['Total']);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Zone': Zone,
        'Miles': Miles,
        'Lines': JsonConverters.toJson(Lines,'List<CourierBookQuoteLine>',context!),
        'Total': Total,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class CourierBookQuoteRequest implements IConvertible
{
    String? Slug;
    String? Profile;
    String? Level;
    int? Units;
    String? Zip;
    double? Lat;
    double? Lng;
    double? DropLat;
    double? DropLng;

    CourierBookQuoteRequest({this.Slug,this.Profile,this.Level,this.Units,this.Zip,this.Lat,this.Lng,this.DropLat,this.DropLng});
    CourierBookQuoteRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Slug = json['Slug'];
        Profile = json['Profile'];
        Level = json['Level'];
        Units = json['Units'];
        Zip = json['Zip'];
        Lat = JsonConverters.toDouble(json['Lat']);
        Lng = JsonConverters.toDouble(json['Lng']);
        DropLat = JsonConverters.toDouble(json['DropLat']);
        DropLng = JsonConverters.toDouble(json['DropLng']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Slug': Slug,
        'Profile': Profile,
        'Level': Level,
        'Units': Units,
        'Zip': Zip,
        'Lat': Lat,
        'Lng': Lng,
        'DropLat': DropLat,
        'DropLng': DropLng
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CourierBookQuoteLine': TypeInfo(TypeOf.Class, create:() => CourierBookQuoteLine()),
    'CourierBookQuoteResponse': TypeInfo(TypeOf.Class, create:() => CourierBookQuoteResponse()),
    'List<CourierBookQuoteLine>': TypeInfo(TypeOf.Class, create:() => <CourierBookQuoteLine>[]),
    'CourierBookQuoteRequest': TypeInfo(TypeOf.Class, create:() => CourierBookQuoteRequest()),
});

Dart CourierBookQuoteRequest DTOs

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

HTTP + CSV

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

POST /v1/book/{Slug}/quote HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Slug":"String","Profile":"String","Level":"String","Units":0,"Zip":"String","Lat":0,"Lng":0,"DropLat":0,"DropLng":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Zone":"String","Miles":0,"Lines":[{"Kind":"String","Amount":0,"Qty":0,"Rate":0}],"Total":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}