1Fetch Client API

<back to all web services

PicUpCreateShipmentRequest

The following routes are available for this service:
POST/picup/createshipment
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    public static class PicUpCreateShipmentRequest implements IHasApiKey, ILogRequest
    {
        public String ApiKey = null;
        @DataMember(Name="courier_request")
        @SerializedName("courier_request")
        public CourierRequest CourierRequest = null;
        
        public String getApiKey() { return ApiKey; }
        public PicUpCreateShipmentRequest setApiKey(String value) { this.ApiKey = value; return this; }
        public CourierRequest getCourierRequest() { return CourierRequest; }
        public PicUpCreateShipmentRequest setCourierRequest(CourierRequest value) { this.CourierRequest = value; return this; }
    }

    public static class CourierRequest
    {
        @DataMember(Name="bucket_details")
        @SerializedName("bucket_details")
        public BucketDetails BucketDetails = null;

        @DataMember(Name="shipments")
        @SerializedName("shipments")
        public ArrayList<Shipment> Shipments = null;
        
        public BucketDetails getBucketDetails() { return BucketDetails; }
        public CourierRequest setBucketDetails(BucketDetails value) { this.BucketDetails = value; return this; }
        public ArrayList<Shipment> getShipments() { return Shipments; }
        public CourierRequest setShipments(ArrayList<Shipment> value) { this.Shipments = value; return this; }
    }

    public static class BucketDetails
    {
        @DataMember(Name="delivery_date")
        @SerializedName("delivery_date")
        public Date DeliveryDate = null;
        
        public Date getDeliveryDate() { return DeliveryDate; }
        public BucketDetails setDeliveryDate(Date value) { this.DeliveryDate = value; return this; }
    }

    public static class Shipment
    {
        @DataMember(Name="waybill_number")
        @SerializedName("waybill_number")
        public String WaybillNumber = null;

        @DataMember(Name="business_reference")
        @SerializedName("business_reference")
        public String BusinessReference = null;

        @DataMember(Name="service_type")
        @SerializedName("service_type")
        public String ServiceType = null;

        @DataMember(Name="sender")
        @SerializedName("sender")
        public Sender Sender = null;

        @DataMember(Name="receiver")
        @SerializedName("receiver")
        public Receiver Receiver = null;
        
        public String getWaybillNumber() { return WaybillNumber; }
        public Shipment setWaybillNumber(String value) { this.WaybillNumber = value; return this; }
        public String getBusinessReference() { return BusinessReference; }
        public Shipment setBusinessReference(String value) { this.BusinessReference = value; return this; }
        public String getServiceType() { return ServiceType; }
        public Shipment setServiceType(String value) { this.ServiceType = value; return this; }
        public Sender getSender() { return Sender; }
        public Shipment setSender(Sender value) { this.Sender = value; return this; }
        public Receiver getReceiver() { return Receiver; }
        public Shipment setReceiver(Receiver value) { this.Receiver = value; return this; }
    }

    public static class Sender
    {
        @DataMember(Name="address")
        @SerializedName("address")
        public Address Address = null;

        @DataMember(Name="contact")
        @SerializedName("contact")
        public Contact Contact = null;
        
        public Address getAddress() { return Address; }
        public Sender setAddress(Address value) { this.Address = value; return this; }
        public Contact getContact() { return Contact; }
        public Sender setContact(Contact value) { this.Contact = value; return this; }
    }

    public static class Address
    {
        @DataMember(Name="address_line_1")
        @SerializedName("address_line_1")
        public String AddressLine1 = null;

        @DataMember(Name="address_line_2")
        @SerializedName("address_line_2")
        public String AddressLine2 = null;

        @DataMember(Name="address_line_3")
        @SerializedName("address_line_3")
        public String AddressLine3 = null;

        @DataMember(Name="address_line_4")
        @SerializedName("address_line_4")
        public String AddressLine4 = null;

        @DataMember(Name="city")
        @SerializedName("city")
        public String City = null;

        @DataMember(Name="formatted_address")
        @SerializedName("formatted_address")
        public String FormattedAddress = null;

        @DataMember(Name="latitude")
        @SerializedName("latitude")
        public Double Latitude = null;

        @DataMember(Name="longitude")
        @SerializedName("longitude")
        public Double Longitude = null;

        @DataMember(Name="postal_code")
        @SerializedName("postal_code")
        public String PostalCode = null;

        @DataMember(Name="suburb")
        @SerializedName("suburb")
        public String Suburb = null;

        @DataMember(Name="unit")
        @SerializedName("unit")
        public String Unit = null;

        @DataMember(Name="building")
        @SerializedName("building")
        public String Building = null;
        
        public String getAddressLine1() { return AddressLine1; }
        public Address setAddressLine1(String value) { this.AddressLine1 = value; return this; }
        public String getAddressLine2() { return AddressLine2; }
        public Address setAddressLine2(String value) { this.AddressLine2 = value; return this; }
        public String getAddressLine3() { return AddressLine3; }
        public Address setAddressLine3(String value) { this.AddressLine3 = value; return this; }
        public String getAddressLine4() { return AddressLine4; }
        public Address setAddressLine4(String value) { this.AddressLine4 = value; return this; }
        public String getCity() { return City; }
        public Address setCity(String value) { this.City = value; return this; }
        public String getFormattedAddress() { return FormattedAddress; }
        public Address setFormattedAddress(String value) { this.FormattedAddress = value; return this; }
        public Double getLatitude() { return Latitude; }
        public Address setLatitude(Double value) { this.Latitude = value; return this; }
        public Double getLongitude() { return Longitude; }
        public Address setLongitude(Double value) { this.Longitude = value; return this; }
        public String getPostalCode() { return PostalCode; }
        public Address setPostalCode(String value) { this.PostalCode = value; return this; }
        public String getSuburb() { return Suburb; }
        public Address setSuburb(String value) { this.Suburb = value; return this; }
        public String getUnit() { return Unit; }
        public Address setUnit(String value) { this.Unit = value; return this; }
        public String getBuilding() { return Building; }
        public Address setBuilding(String value) { this.Building = value; return this; }
    }

    public static class Contact
    {
        @DataMember(Name="customer_name")
        @SerializedName("customer_name")
        public String CustomerName = null;

        @DataMember(Name="customer_phone")
        @SerializedName("customer_phone")
        public String CustomerPhone = null;

        @DataMember(Name="email_address")
        @SerializedName("email_address")
        public String EmailAddress = null;

        @DataMember(Name="special_instructions")
        @SerializedName("special_instructions")
        public String SpecialInstructions = null;
        
        public String getCustomerName() { return CustomerName; }
        public Contact setCustomerName(String value) { this.CustomerName = value; return this; }
        public String getCustomerPhone() { return CustomerPhone; }
        public Contact setCustomerPhone(String value) { this.CustomerPhone = value; return this; }
        public String getEmailAddress() { return EmailAddress; }
        public Contact setEmailAddress(String value) { this.EmailAddress = value; return this; }
        public String getSpecialInstructions() { return SpecialInstructions; }
        public Contact setSpecialInstructions(String value) { this.SpecialInstructions = value; return this; }
    }

    public static class Receiver
    {
        @DataMember(Name="parcels")
        @SerializedName("parcels")
        public ArrayList<Parcel> Parcels = null;

        @DataMember(Name="address")
        @SerializedName("address")
        public Address Address = null;

        @DataMember(Name="contact")
        @SerializedName("contact")
        public Contact Contact = null;
        
        public ArrayList<Parcel> getParcels() { return Parcels; }
        public Receiver setParcels(ArrayList<Parcel> value) { this.Parcels = value; return this; }
        public Address getAddress() { return Address; }
        public Receiver setAddress(Address value) { this.Address = value; return this; }
        public Contact getContact() { return Contact; }
        public Receiver setContact(Contact value) { this.Contact = value; return this; }
    }

    public static class Parcel
    {
        @DataMember(Name="parcel_waybill")
        @SerializedName("parcel_waybill")
        public String ParcelWaybill = null;

        @DataMember(Name="parcel_reference")
        @SerializedName("parcel_reference")
        public String ParcelReference = null;

        @DataMember(Name="tracking_number")
        @SerializedName("tracking_number")
        public String TrackingNumber = null;

        @DataMember(Name="length_mm")
        @SerializedName("length_mm")
        public Long LengthMm = null;

        @DataMember(Name="width_mm")
        @SerializedName("width_mm")
        public Long WidthMm = null;

        @DataMember(Name="height_mm")
        @SerializedName("height_mm")
        public Long HeightMm = null;

        @DataMember(Name="weight_kg")
        @SerializedName("weight_kg")
        public Long WeightKg = null;
        
        public String getParcelWaybill() { return ParcelWaybill; }
        public Parcel setParcelWaybill(String value) { this.ParcelWaybill = value; return this; }
        public String getParcelReference() { return ParcelReference; }
        public Parcel setParcelReference(String value) { this.ParcelReference = value; return this; }
        public String getTrackingNumber() { return TrackingNumber; }
        public Parcel setTrackingNumber(String value) { this.TrackingNumber = value; return this; }
        public Long getLengthMm() { return LengthMm; }
        public Parcel setLengthMm(Long value) { this.LengthMm = value; return this; }
        public Long getWidthMm() { return WidthMm; }
        public Parcel setWidthMm(Long value) { this.WidthMm = value; return this; }
        public Long getHeightMm() { return HeightMm; }
        public Parcel setHeightMm(Long value) { this.HeightMm = value; return this; }
        public Long getWeightKg() { return WeightKg; }
        public Parcel setWeightKg(Long value) { this.WeightKg = value; return this; }
    }

    public static class PicUpCreateShipmentResponse
    {
        @DataMember(Name="is_success")
        @SerializedName("is_success")
        public Boolean IsSuccess = null;

        @DataMember(Name="courier_reference")
        @SerializedName("courier_reference")
        public String CourierReference = null;

        @DataMember(Name="error")
        @SerializedName("error")
        public String Error = null;

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

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

        /**
        * The 1Fetch Waybill reference for the shipment
        */
        @ApiMember(Description="The 1Fetch Waybill reference for the shipment")
        public String Waybill = null;
        
        public Boolean getIsSuccess() { return IsSuccess; }
        public PicUpCreateShipmentResponse setIsSuccess(Boolean value) { this.IsSuccess = value; return this; }
        public String getCourierReference() { return CourierReference; }
        public PicUpCreateShipmentResponse setCourierReference(String value) { this.CourierReference = value; return this; }
        public String getError() { return Error; }
        public PicUpCreateShipmentResponse setError(String value) { this.Error = value; return this; }
        public ArrayList<WaypointQuoteInformation> getWaypoints() { return Waypoints; }
        public PicUpCreateShipmentResponse setWaypoints(ArrayList<WaypointQuoteInformation> value) { this.Waypoints = value; return this; }
        public ArrayList<WaypointValidationInformation> getWaypointValidations() { return WaypointValidations; }
        public PicUpCreateShipmentResponse setWaypointValidations(ArrayList<WaypointValidationInformation> value) { this.WaypointValidations = value; return this; }
        public String getWaybill() { return Waybill; }
        public PicUpCreateShipmentResponse setWaybill(String value) { this.Waybill = value; return this; }
    }

    public static class WaypointQuoteInformation extends LinkedWaypoint
    {
        /**
        * Distance between waypoints as a number
        */
        @ApiMember(Description="Distance between waypoints as a number")
        public Double Distance = null;

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

        public Boolean WaypointValid = null;
        public String Message = null;
        public ArrayList<String> ErrorDetails = null;
        /**
        * Caculated price between waypoints excluding vat
        */
        @ApiMember(Description="Caculated price between waypoints excluding vat")
        public BigDecimal Price = null;

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

        /**
        * The price between waypoints including vat
        */
        @ApiMember(Description="The price between waypoints including vat")
        public BigDecimal PriceWithVAT = null;

        /**
        * The price including vat formatted as a rand value string
        */
        @ApiMember(Description="The price including vat formatted as a rand value string")
        public String PriceValueWithVAT = null;
        
        public Double getDistance() { return Distance; }
        public WaypointQuoteInformation setDistance(Double value) { this.Distance = value; return this; }
        public String getDistanceValue() { return DistanceValue; }
        public WaypointQuoteInformation setDistanceValue(String value) { this.DistanceValue = value; return this; }
        public Boolean isWaypointValid() { return WaypointValid; }
        public WaypointQuoteInformation setWaypointValid(Boolean value) { this.WaypointValid = value; return this; }
        public String getMessage() { return Message; }
        public WaypointQuoteInformation setMessage(String value) { this.Message = value; return this; }
        public ArrayList<String> getErrorDetails() { return ErrorDetails; }
        public WaypointQuoteInformation setErrorDetails(ArrayList<String> value) { this.ErrorDetails = value; return this; }
        public BigDecimal getPrice() { return Price; }
        public WaypointQuoteInformation setPrice(BigDecimal value) { this.Price = value; return this; }
        public String getPriceValue() { return PriceValue; }
        public WaypointQuoteInformation setPriceValue(String value) { this.PriceValue = value; return this; }
        public BigDecimal getPriceWithVAT() { return PriceWithVAT; }
        public WaypointQuoteInformation setPriceWithVAT(BigDecimal value) { this.PriceWithVAT = value; return this; }
        public String getPriceValueWithVAT() { return PriceValueWithVAT; }
        public WaypointQuoteInformation setPriceValueWithVAT(String value) { this.PriceValueWithVAT = value; return this; }
    }

    public static class LinkedWaypoint
    {
        public Integer FromWaypointNumber = null;
        public Integer ToWaypointNumber = null;
        public Double FromLatitude = null;
        public Double FromLongitude = null;
        public Double ToLatitude = null;
        public Double ToLongitude = null;
        
        public Integer getFromWaypointNumber() { return FromWaypointNumber; }
        public LinkedWaypoint setFromWaypointNumber(Integer value) { this.FromWaypointNumber = value; return this; }
        public Integer getToWaypointNumber() { return ToWaypointNumber; }
        public LinkedWaypoint setToWaypointNumber(Integer value) { this.ToWaypointNumber = value; return this; }
        public Double getFromLatitude() { return FromLatitude; }
        public LinkedWaypoint setFromLatitude(Double value) { this.FromLatitude = value; return this; }
        public Double getFromLongitude() { return FromLongitude; }
        public LinkedWaypoint setFromLongitude(Double value) { this.FromLongitude = value; return this; }
        public Double getToLatitude() { return ToLatitude; }
        public LinkedWaypoint setToLatitude(Double value) { this.ToLatitude = value; return this; }
        public Double getToLongitude() { return ToLongitude; }
        public LinkedWaypoint setToLongitude(Double value) { this.ToLongitude = value; return this; }
    }

    public static class WaypointValidationInformation
    {
        public Integer WaypointNumber = null;
        public Boolean IsValid = null;
        public ArrayList<String> ErrorMessages = null;
        
        public Integer getWaypointNumber() { return WaypointNumber; }
        public WaypointValidationInformation setWaypointNumber(Integer value) { this.WaypointNumber = value; return this; }
        public Boolean getIsValid() { return IsValid; }
        public WaypointValidationInformation setIsValid(Boolean value) { this.IsValid = value; return this; }
        public ArrayList<String> getErrorMessages() { return ErrorMessages; }
        public WaypointValidationInformation setErrorMessages(ArrayList<String> value) { this.ErrorMessages = value; return this; }
    }

}

Java PicUpCreateShipmentRequest 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 /picup/createshipment HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
Accept: text/csv
Content-Type: text/csv
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/csv
Content-Length: length

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