1Fetch Client API

<back to all web services

Order

The following routes are available for this service:
GET/orderGet order information.If you do not specify an OrderId, the results will be paged.
namespace WebService.ClientServiceModel

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type ApiServiceResponse() = 
        ///<summary>
        ///Information about the response.
        ///</summary>
        [<ApiMember(Description="Information about the response.", IsRequired=true)>]
        member val Description:String = null with get,set

        ///<summary>
        ///Heading or summary of the response.
        ///</summary>
        [<ApiMember(Description="Heading or summary of the response.", IsRequired=true)>]
        member val Heading:String = null with get,set

        ///<summary>
        ///Did the intended operation for this response complete successfully?
        ///</summary>
        [<ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)>]
        member val WasSuccessful:Boolean = new Boolean() with get,set

    type OrderStatus =
        | AwaitingPayment = 0
        | ProcessingPayment = 1
        | AwaitingDispatch = 2
        | DriverDispatched = 3
        | PackageEnRoute = 4
        | Completed = 5
        | Cancelled = 6
        | DeliveryFailed = 7

    [<AllowNullLiteral>]
    type ScanDetail() = 
        ///<summary>
        ///List of URLs for images captured at the waypoint
        ///</summary>
        [<ApiMember(Description="List of URLs for images captured at the waypoint")>]
        member val PhotoUrls:ResizeArray<String> = new ResizeArray<String>() with get,set

        ///<summary>
        ///List of URLs for images of signatures captured at the waypoint
        ///</summary>
        [<ApiMember(Description="List of URLs for images of signatures captured at the waypoint")>]
        member val SignatureUrls:ResizeArray<String> = new ResizeArray<String>() with get,set

        ///<summary>
        ///Name of person the driver interacted with at the waypoint
        ///</summary>
        [<ApiMember(Description="Name of person the driver interacted with at the waypoint")>]
        member val ReceivedBy:String = null with get,set

        ///<summary>
        ///The date the driver interacted with the person
        ///</summary>
        [<ApiMember(Description="The date the driver interacted with the person")>]
        member val ReceivedDate:String = null with get,set

        ///<summary>
        ///Number of packages collected by the driver
        ///</summary>
        [<ApiMember(Description="Number of packages collected by the driver")>]
        member val PackagesCollected:Int32 = new Int32() with get,set

    [<AllowNullLiteral>]
    type OrderItemWaypoint() = 
        ///<summary>
        ///Has the driver completed this waypoint
        ///</summary>
        [<ApiMember(Description="Has the driver completed this waypoint")>]
        member val Completed:Boolean = new Boolean() with get,set

        member val Latitude:Double = new Double() with get,set
        member val Longitude:Double = new Double() with get,set
        member val Address:String = null with get,set
        member val ContactName:String = null with get,set
        member val ContactNumber:String = null with get,set
        member val DeliveryInstructions:String = null with get,set
        ///<summary>
        ///Details captured at waypoint
        ///</summary>
        [<ApiMember(Description="Details captured at waypoint")>]
        member val ScanDetail:ScanDetail = null with get,set

    [<AllowNullLiteral>]
    type OrderTransitPoint() = 
        ///<summary>
        ///Origin waypoint number
        ///</summary>
        [<ApiMember(Description="Origin waypoint number")>]
        member val FromWaypointNumber:Int32 = new Int32() with get,set

        ///<summary>
        ///Destination waypoint number
        ///</summary>
        [<ApiMember(Description="Destination waypoint number")>]
        member val ToWaypointNumber:Int32 = new Int32() with get,set

        ///<summary>
        ///Distance between waypoints
        ///</summary>
        [<ApiMember(Description="Distance between waypoints")>]
        member val Distance:Double = new Double() with get,set

        ///<summary>
        ///Distance between waypoints rounded and converted to a string
        ///</summary>
        [<ApiMember(Description="Distance between waypoints rounded and converted to a string")>]
        member val DistanceValue:String = null with get,set

        ///<summary>
        ///Price calculated between waypoints
        ///</summary>
        [<ApiMember(Description="Price calculated between waypoints")>]
        member val Price:Decimal = new Decimal() with get,set

        ///<summary>
        ///Price calculated between waypoints formatted as ZA currency
        ///</summary>
        [<ApiMember(Description="Price calculated between waypoints formatted as ZA currency")>]
        member val PriceValue:String = null with get,set

    [<AllowNullLiteral>]
    type EventDetail() = 
        member val Description:String = null with get,set
        member val Time:String = null with get,set
        member val EventDateTime:DateTime = new DateTime() with get,set

    [<AllowNullLiteral>]
    type OrderDetail() = 
        ///<summary>
        ///ID of quote attached to the order
        ///</summary>
        [<ApiMember(Description="ID of quote attached to the order")>]
        member val QuoteId:Guid = new Guid() with get,set

        ///<summary>
        ///ID of order
        ///</summary>
        [<ApiMember(Description="ID of order")>]
        member val OrderId:Guid = new Guid() with get,set

        ///<summary>
        ///User friendly order identifier
        ///</summary>
        [<ApiMember(Description="User friendly order identifier")>]
        member val Waybill:String = null with get,set

        ///<summary>
        ///Invoice number for the order
        ///</summary>
        [<ApiMember(Description="Invoice number for the order")>]
        member val InvoiceNumber:String = null with get,set

        ///<summary>
        ///The date and time the order is scheduled for in ISO 8601 string format, will be set if IsScheduled is true
        ///</summary>
        [<ApiMember(Description="The date and time the order is scheduled for in ISO 8601 string format, will be set if IsScheduled is true")>]
        member val ScheduledDate:String = null with get,set

        ///<summary>
        ///Order status number
        ///</summary>
        [<ApiMember(Description="Order status number")>]
        member val OrderStatus:OrderStatus = new OrderStatus() with get,set

        ///<summary>
        ///String value of order status
        ///</summary>
        [<ApiMember(Description="String value of order status")>]
        member val OrderStatusValue:String = null with get,set

        ///<summary>
        ///List of waypoints for this order
        ///</summary>
        [<ApiMember(Description="List of waypoints for this order")>]
        member val Waypoints:ResizeArray<OrderItemWaypoint> = new ResizeArray<OrderItemWaypoint>() with get,set

        ///<summary>
        ///List of sections between waypoints
        ///</summary>
        [<ApiMember(Description="List of sections between waypoints")>]
        member val TransitPoints:ResizeArray<OrderTransitPoint> = new ResizeArray<OrderTransitPoint>() with get,set

        ///<summary>
        ///Order Final price including VAT
        ///</summary>
        [<ApiMember(Description="Order Final price including VAT")>]
        member val FinalPrice:Decimal = new Decimal() with get,set

        ///<summary>
        ///Final price formatted as ZA currency
        ///</summary>
        [<ApiMember(Description="Final price formatted as ZA currency")>]
        member val FinalPriceValue:String = null with get,set

        ///<summary>
        ///Total distance for the order in km
        ///</summary>
        [<ApiMember(Description="Total distance for the order in km")>]
        member val TotalDistance:Double = new Double() with get,set

        ///<summary>
        ///Total distance for the order formatted as a string
        ///</summary>
        [<ApiMember(Description="Total distance for the order formatted as a string")>]
        member val TotalDistanceValue:String = null with get,set

        ///<summary>
        ///Date order was placed
        ///</summary>
        [<ApiMember(Description="Date order was placed")>]
        member val Date:String = null with get,set

        ///<summary>
        ///Google encoded maps polyline path for drawing route on a google map
        ///</summary>
        [<ApiMember(Description="Google encoded maps polyline path for drawing route on a google map")>]
        member val EncodedPolyPath:String = null with get,set

        ///<summary>
        ///List of events as they occurred while the order was in progress
        ///</summary>
        [<ApiMember(Description="List of events as they occurred while the order was in progress")>]
        member val Events:ResizeArray<EventDetail> = new ResizeArray<EventDetail>() with get,set

    [<AllowNullLiteral>]
    type OrderResponse() = 
        inherit ApiServiceResponse()
        ///<summary>
        ///List with order details, will only contain one item if requested with order id
        ///</summary>
        [<ApiMember(Description="List with order details, will only contain one item if requested with order id")>]
        member val OrderItems:ResizeArray<OrderDetail> = new ResizeArray<OrderDetail>() with get,set

        ///<summary>
        ///Total number of items in order collection
        ///</summary>
        [<ApiMember(Description="Total number of items in order collection")>]
        member val TotalCount:Int32 = new Int32() with get,set

        ///<summary>
        ///Used to indicate if there are more items available
        ///</summary>
        [<ApiMember(Description="Used to indicate if there are more items available")>]
        member val LastPage:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type ApiServiceRequest() = 
        ///<summary>
        ///The API Key required for authentication
        ///</summary>
        [<ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)>]
        member val ApiKey:String = null with get,set

    [<AllowNullLiteral>]
    type Order() = 
        inherit ApiServiceRequest()
        ///<summary>
        ///The ID if getting specific order
        ///</summary>
        [<ApiMember(Description="The ID if getting specific order")>]
        member val OrderId:String = null with get,set

        ///<summary>
        ///The amount of elements to offset the index by
        ///</summary>
        [<ApiMember(Description="The amount of elements to offset the index by")>]
        member val Offset:Int32 = new Int32() with get,set

        ///<summary>
        ///The number of elements to be returned, defaults to 10
        ///</summary>
        [<ApiMember(Description="The number of elements to be returned, defaults to 10")>]
        member val Count:Int32 = new Int32() with get,set

F# Order 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.

GET /order HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"OrderItems":[{"QuoteId":"00000000-0000-0000-0000-000000000000","OrderId":"00000000-0000-0000-0000-000000000000","Waybill":"String","InvoiceNumber":"String","ScheduledDate":"String","OrderStatus":0,"OrderStatusValue":"String","Waypoints":[{}],"TransitPoints":[{}],"FinalPrice":0,"FinalPriceValue":"String","TotalDistance":0,"TotalDistanceValue":"String","Date":"String","EncodedPolyPath":"String","Events":[{}]}],"TotalCount":0,"LastPage":false,"Description":"String","Heading":"String","WasSuccessful":false}