1Fetch Client API

<back to all web services

PicUpCreateShipmentRequest

The following routes are available for this service:
POST/picup/createshipment
import 'package:servicestack/servicestack.dart';

class LinkedWaypoint implements IConvertible
{
    int? FromWaypointNumber;
    int? ToWaypointNumber;
    double? FromLatitude;
    double? FromLongitude;
    double? ToLatitude;
    double? ToLongitude;

    LinkedWaypoint({this.FromWaypointNumber,this.ToWaypointNumber,this.FromLatitude,this.FromLongitude,this.ToLatitude,this.ToLongitude});
    LinkedWaypoint.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FromWaypointNumber = json['FromWaypointNumber'];
        ToWaypointNumber = json['ToWaypointNumber'];
        FromLatitude = JsonConverters.toDouble(json['FromLatitude']);
        FromLongitude = JsonConverters.toDouble(json['FromLongitude']);
        ToLatitude = JsonConverters.toDouble(json['ToLatitude']);
        ToLongitude = JsonConverters.toDouble(json['ToLongitude']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FromWaypointNumber': FromWaypointNumber,
        'ToWaypointNumber': ToWaypointNumber,
        'FromLatitude': FromLatitude,
        'FromLongitude': FromLongitude,
        'ToLatitude': ToLatitude,
        'ToLongitude': ToLongitude
    };

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

class WaypointQuoteInformation extends LinkedWaypoint implements IConvertible
{
    /**
    * Distance between waypoints as a number
    */
    // @ApiMember(Description="Distance between waypoints as a number")
    double? Distance;

    /**
    * String formatted distance
    */
    // @ApiMember(Description="String formatted distance")
    String? DistanceValue;

    bool? WaypointValid;
    String? Message;
    List<String>? ErrorDetails;
    /**
    * Caculated price between waypoints excluding vat
    */
    // @ApiMember(Description="Caculated price between waypoints excluding vat")
    double? Price;

    /**
    * Price excluding vat formatted as a string rand value
    */
    // @ApiMember(Description="Price excluding vat formatted as a string rand value")
    String? PriceValue;

    /**
    * The price between waypoints including vat
    */
    // @ApiMember(Description="The price between waypoints including vat")
    double? PriceWithVAT;

    /**
    * The price including vat formatted as a rand value string
    */
    // @ApiMember(Description="The price including vat formatted as a rand value string")
    String? PriceValueWithVAT;

    WaypointQuoteInformation({this.Distance,this.DistanceValue,this.WaypointValid,this.Message,this.ErrorDetails,this.Price,this.PriceValue,this.PriceWithVAT,this.PriceValueWithVAT});
    WaypointQuoteInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Distance = JsonConverters.toDouble(json['Distance']);
        DistanceValue = json['DistanceValue'];
        WaypointValid = json['WaypointValid'];
        Message = json['Message'];
        ErrorDetails = JsonConverters.fromJson(json['ErrorDetails'],'List<String>',context!);
        Price = JsonConverters.toDouble(json['Price']);
        PriceValue = json['PriceValue'];
        PriceWithVAT = JsonConverters.toDouble(json['PriceWithVAT']);
        PriceValueWithVAT = json['PriceValueWithVAT'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Distance': Distance,
        'DistanceValue': DistanceValue,
        'WaypointValid': WaypointValid,
        'Message': Message,
        'ErrorDetails': JsonConverters.toJson(ErrorDetails,'List<String>',context!),
        'Price': Price,
        'PriceValue': PriceValue,
        'PriceWithVAT': PriceWithVAT,
        'PriceValueWithVAT': PriceValueWithVAT
    });

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

class WaypointValidationInformation implements IConvertible
{
    int? WaypointNumber;
    bool? IsValid;
    List<String>? ErrorMessages;

    WaypointValidationInformation({this.WaypointNumber,this.IsValid,this.ErrorMessages});
    WaypointValidationInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        WaypointNumber = json['WaypointNumber'];
        IsValid = json['IsValid'];
        ErrorMessages = JsonConverters.fromJson(json['ErrorMessages'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'WaypointNumber': WaypointNumber,
        'IsValid': IsValid,
        'ErrorMessages': JsonConverters.toJson(ErrorMessages,'List<String>',context!)
    };

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

class PicUpCreateShipmentResponse implements IConvertible
{
    // @DataMember(Name="is_success")
    bool? is_success;

    // @DataMember(Name="courier_reference")
    String? courier_reference;

    // @DataMember(Name="error")
    String? error;

    /**
    * List of order information for pricing etc between each waypoint
    */
    // @ApiMember(Description="List of order information for pricing etc between each waypoint")
    List<WaypointQuoteInformation>? Waypoints;

    /**
    * List with validation information for each waypoint
    */
    // @ApiMember(Description="List with validation information for each waypoint")
    List<WaypointValidationInformation>? WaypointValidations;

    /**
    * The 1Fetch Waybill reference for the shipment
    */
    // @ApiMember(Description="The 1Fetch Waybill reference for the shipment")
    String? Waybill;

    PicUpCreateShipmentResponse({this.is_success,this.courier_reference,this.error,this.Waypoints,this.WaypointValidations,this.Waybill});
    PicUpCreateShipmentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        is_success = json['IsSuccess'];
        courier_reference = json['CourierReference'];
        error = json['Error'];
        Waypoints = JsonConverters.fromJson(json['Waypoints'],'List<WaypointQuoteInformation>',context!);
        WaypointValidations = JsonConverters.fromJson(json['WaypointValidations'],'List<WaypointValidationInformation>',context!);
        Waybill = json['Waybill'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'is_success': is_success,
        'courier_reference': courier_reference,
        'error': error,
        'Waypoints': JsonConverters.toJson(Waypoints,'List<WaypointQuoteInformation>',context!),
        'WaypointValidations': JsonConverters.toJson(WaypointValidations,'List<WaypointValidationInformation>',context!),
        'Waybill': Waybill
    };

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

class BucketDetails implements IConvertible
{
    // @DataMember(Name="delivery_date")
    DateTime? delivery_date;

    BucketDetails({this.delivery_date});
    BucketDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class CourierRequest implements IConvertible
{
    // @DataMember(Name="bucket_details")
    BucketDetails? bucket_details;

    // @DataMember(Name="shipments")
    List<Shipment>? shipments;

    CourierRequest({this.bucket_details,this.shipments});
    CourierRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        bucket_details = JsonConverters.fromJson(json['BucketDetails'],'BucketDetails',context!);
        shipments = JsonConverters.fromJson(json['Shipments'],'List<Shipment>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'bucket_details': JsonConverters.toJson(bucket_details,'BucketDetails',context!),
        'shipments': JsonConverters.toJson(shipments,'List<Shipment>',context!)
    };

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

class PicUpCreateShipmentRequest implements IHasApiKey, ILogRequest, IConvertible
{
    String? ApiKey;
    // @DataMember(Name="courier_request")
    CourierRequest? courier_request;

    PicUpCreateShipmentRequest({this.ApiKey,this.courier_request});
    PicUpCreateShipmentRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ApiKey = json['ApiKey'];
        courier_request = JsonConverters.fromJson(json['CourierRequest'],'CourierRequest',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ApiKey': ApiKey,
        'courier_request': JsonConverters.toJson(courier_request,'CourierRequest',context!)
    };

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

class Address implements IConvertible
{
    // @DataMember(Name="address_line_1")
    String? address_line_1;

    // @DataMember(Name="address_line_2")
    String? address_line_2;

    // @DataMember(Name="address_line_3")
    String? address_line_3;

    // @DataMember(Name="address_line_4")
    String? address_line_4;

    // @DataMember(Name="city")
    String? city;

    // @DataMember(Name="formatted_address")
    String? formatted_address;

    // @DataMember(Name="latitude")
    double? latitude;

    // @DataMember(Name="longitude")
    double? longitude;

    // @DataMember(Name="postal_code")
    String? postal_code;

    // @DataMember(Name="suburb")
    String? suburb;

    // @DataMember(Name="unit")
    String? unit;

    // @DataMember(Name="building")
    String? building;

    Address({this.address_line_1,this.address_line_2,this.address_line_3,this.address_line_4,this.city,this.formatted_address,this.latitude,this.longitude,this.postal_code,this.suburb,this.unit,this.building});
    Address.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        address_line_1 = json['AddressLine1'];
        address_line_2 = json['AddressLine2'];
        address_line_3 = json['AddressLine3'];
        address_line_4 = json['AddressLine4'];
        city = json['City'];
        formatted_address = json['FormattedAddress'];
        latitude = JsonConverters.toDouble(json['Latitude']);
        longitude = JsonConverters.toDouble(json['Longitude']);
        postal_code = json['PostalCode'];
        suburb = json['Suburb'];
        unit = json['Unit'];
        building = json['Building'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'address_line_1': address_line_1,
        'address_line_2': address_line_2,
        'address_line_3': address_line_3,
        'address_line_4': address_line_4,
        'city': city,
        'formatted_address': formatted_address,
        'latitude': latitude,
        'longitude': longitude,
        'postal_code': postal_code,
        'suburb': suburb,
        'unit': unit,
        'building': building
    };

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

class Contact implements IConvertible
{
    // @DataMember(Name="customer_name")
    String? customer_name;

    // @DataMember(Name="customer_phone")
    String? customer_phone;

    // @DataMember(Name="email_address")
    String? email_address;

    // @DataMember(Name="special_instructions")
    String? special_instructions;

    Contact({this.customer_name,this.customer_phone,this.email_address,this.special_instructions});
    Contact.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        customer_name = json['CustomerName'];
        customer_phone = json['CustomerPhone'];
        email_address = json['EmailAddress'];
        special_instructions = json['SpecialInstructions'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'customer_name': customer_name,
        'customer_phone': customer_phone,
        'email_address': email_address,
        'special_instructions': special_instructions
    };

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

class Sender implements IConvertible
{
    // @DataMember(Name="address")
    Address? address;

    // @DataMember(Name="contact")
    Contact? contact;

    Sender({this.address,this.contact});
    Sender.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        address = JsonConverters.fromJson(json['Address'],'Address',context!);
        contact = JsonConverters.fromJson(json['Contact'],'Contact',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'address': JsonConverters.toJson(address,'Address',context!),
        'contact': JsonConverters.toJson(contact,'Contact',context!)
    };

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

class Receiver implements IConvertible
{
    // @DataMember(Name="parcels")
    List<Parcel>? parcels;

    // @DataMember(Name="address")
    Address? address;

    // @DataMember(Name="contact")
    Contact? contact;

    Receiver({this.parcels,this.address,this.contact});
    Receiver.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        parcels = JsonConverters.fromJson(json['Parcels'],'List<Parcel>',context!);
        address = JsonConverters.fromJson(json['Address'],'Address',context!);
        contact = JsonConverters.fromJson(json['Contact'],'Contact',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'parcels': JsonConverters.toJson(parcels,'List<Parcel>',context!),
        'address': JsonConverters.toJson(address,'Address',context!),
        'contact': JsonConverters.toJson(contact,'Contact',context!)
    };

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

class Shipment implements IConvertible
{
    // @DataMember(Name="waybill_number")
    String? waybill_number;

    // @DataMember(Name="business_reference")
    String? business_reference;

    // @DataMember(Name="service_type")
    String? service_type;

    // @DataMember(Name="sender")
    Sender? sender;

    // @DataMember(Name="receiver")
    Receiver? receiver;

    Shipment({this.waybill_number,this.business_reference,this.service_type,this.sender,this.receiver});
    Shipment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        waybill_number = json['WaybillNumber'];
        business_reference = json['BusinessReference'];
        service_type = json['ServiceType'];
        sender = JsonConverters.fromJson(json['Sender'],'Sender',context!);
        receiver = JsonConverters.fromJson(json['Receiver'],'Receiver',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'waybill_number': waybill_number,
        'business_reference': business_reference,
        'service_type': service_type,
        'sender': JsonConverters.toJson(sender,'Sender',context!),
        'receiver': JsonConverters.toJson(receiver,'Receiver',context!)
    };

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

class Parcel implements IConvertible
{
    // @DataMember(Name="parcel_waybill")
    String? parcel_waybill;

    // @DataMember(Name="parcel_reference")
    String? parcel_reference;

    // @DataMember(Name="tracking_number")
    String? tracking_number;

    // @DataMember(Name="length_mm")
    int? length_mm;

    // @DataMember(Name="width_mm")
    int? width_mm;

    // @DataMember(Name="height_mm")
    int? height_mm;

    // @DataMember(Name="weight_kg")
    int? weight_kg;

    Parcel({this.parcel_waybill,this.parcel_reference,this.tracking_number,this.length_mm,this.width_mm,this.height_mm,this.weight_kg});
    Parcel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        parcel_waybill = json['ParcelWaybill'];
        parcel_reference = json['ParcelReference'];
        tracking_number = json['TrackingNumber'];
        length_mm = json['LengthMm'];
        width_mm = json['WidthMm'];
        height_mm = json['HeightMm'];
        weight_kg = json['WeightKg'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'parcel_waybill': parcel_waybill,
        'parcel_reference': parcel_reference,
        'tracking_number': tracking_number,
        'length_mm': length_mm,
        'width_mm': width_mm,
        'height_mm': height_mm,
        'weight_kg': weight_kg
    };

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

TypeContext _ctx = TypeContext(library: '1fetch.api.client.prod.86degrees.com', types: <String, TypeInfo> {
    'LinkedWaypoint': TypeInfo(TypeOf.Class, create:() => LinkedWaypoint()),
    'WaypointQuoteInformation': TypeInfo(TypeOf.Class, create:() => WaypointQuoteInformation()),
    'WaypointValidationInformation': TypeInfo(TypeOf.Class, create:() => WaypointValidationInformation()),
    'PicUpCreateShipmentResponse': TypeInfo(TypeOf.Class, create:() => PicUpCreateShipmentResponse()),
    'List<WaypointQuoteInformation>': TypeInfo(TypeOf.Class, create:() => <WaypointQuoteInformation>[]),
    'List<WaypointValidationInformation>': TypeInfo(TypeOf.Class, create:() => <WaypointValidationInformation>[]),
    'BucketDetails': TypeInfo(TypeOf.Class, create:() => BucketDetails()),
    'CourierRequest': TypeInfo(TypeOf.Class, create:() => CourierRequest()),
    'List<Shipment>': TypeInfo(TypeOf.Class, create:() => <Shipment>[]),
    'Shipment': TypeInfo(TypeOf.Class, create:() => Shipment()),
    'PicUpCreateShipmentRequest': TypeInfo(TypeOf.Class, create:() => PicUpCreateShipmentRequest()),
    'Address': TypeInfo(TypeOf.Class, create:() => Address()),
    'Contact': TypeInfo(TypeOf.Class, create:() => Contact()),
    'Sender': TypeInfo(TypeOf.Class, create:() => Sender()),
    'Receiver': TypeInfo(TypeOf.Class, create:() => Receiver()),
    'List<Parcel>': TypeInfo(TypeOf.Class, create:() => <Parcel>[]),
    'Parcel': TypeInfo(TypeOf.Class, create:() => Parcel()),
});

Dart PicUpCreateShipmentRequest DTOs

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

HTTP + JSV

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

POST /picup/createshipment HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ApiKey: String,
	courier_request: 
	{
		bucket_details: 
		{
			delivery_date: 0001-01-01T00:00:00.0000000+00:00
		},
		shipments: 
		[
			{
				waybill_number: String,
				business_reference: String,
				service_type: String,
				sender: 
				{
					address: 
					{
						address_line_1: String,
						address_line_2: String,
						address_line_3: String,
						address_line_4: String,
						city: String,
						formatted_address: String,
						latitude: 0,
						longitude: 0,
						postal_code: String,
						suburb: String,
						unit: String,
						building: String
					},
					contact: 
					{
						customer_name: String,
						customer_phone: String,
						email_address: String,
						special_instructions: String
					}
				},
				receiver: 
				{
					parcels: 
					[
						{
							parcel_waybill: String,
							parcel_reference: String,
							tracking_number: String,
							length_mm: 0,
							width_mm: 0,
							height_mm: 0,
							weight_kg: 0
						}
					],
					address: 
					{
						address_line_1: String,
						address_line_2: String,
						address_line_3: String,
						address_line_4: String,
						city: String,
						formatted_address: String,
						latitude: 0,
						longitude: 0,
						postal_code: String,
						suburb: String,
						unit: String,
						building: String
					},
					contact: 
					{
						customer_name: String,
						customer_phone: String,
						email_address: String,
						special_instructions: String
					}
				}
			}
		]
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	is_success: False,
	courier_reference: String,
	error: String,
	Waypoints: 
	[
		{
			
		}
	],
	WaypointValidations: 
	[
		{
			
		}
	],
	Waybill: String
}