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.
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports WebService.ClientServiceModel
Imports WebService.ClientServiceModel.Base
Imports BusinessLogic.Entities

Namespace Global

    Namespace BusinessLogic.Entities

        Public Enum OrderStatus
            AwaitingPayment = 0
            ProcessingPayment = 1
            AwaitingDispatch = 2
            DriverDispatched = 3
            PackageEnRoute = 4
            Completed = 5
            Cancelled = 6
            DeliveryFailed = 7
        End Enum
    End Namespace

    Namespace WebService.ClientServiceModel

        Public Partial Class EventDetail
            Public Overridable Property Description As String
            Public Overridable Property Time As String
            Public Overridable Property EventDateTime As Date
        End Class

        Public Partial Class Order
            Inherits ApiServiceRequest
            Implements ILogRequest
            '''<Summary>
            '''The ID if getting specific order
            '''</Summary>
            <ApiMember(Description:="The ID if getting specific order")>
            Public Overridable Property OrderId As String

            '''<Summary>
            '''The amount of elements to offset the index by
            '''</Summary>
            <ApiMember(Description:="The amount of elements to offset the index by")>
            Public Overridable Property Offset As Integer

            '''<Summary>
            '''The number of elements to be returned, defaults to 10
            '''</Summary>
            <ApiMember(Description:="The number of elements to be returned, defaults to 10")>
            Public Overridable Property Count As Integer
        End Class

        Public Partial Class OrderDetail
            Public Sub New()
                Waypoints = New List(Of OrderItemWaypoint)
                TransitPoints = New List(Of OrderTransitPoint)
                Events = New List(Of EventDetail)
            End Sub

            '''<Summary>
            '''ID of quote attached to the order
            '''</Summary>
            <ApiMember(Description:="ID of quote attached to the order")>
            Public Overridable Property QuoteId As Guid

            '''<Summary>
            '''ID of order
            '''</Summary>
            <ApiMember(Description:="ID of order")>
            Public Overridable Property OrderId As Guid

            '''<Summary>
            '''User friendly order identifier
            '''</Summary>
            <ApiMember(Description:="User friendly order identifier")>
            Public Overridable Property Waybill As String

            '''<Summary>
            '''Invoice number for the order
            '''</Summary>
            <ApiMember(Description:="Invoice number for the order")>
            Public Overridable Property InvoiceNumber As String

            '''<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")>
            Public Overridable Property ScheduledDate As String

            '''<Summary>
            '''Order status number
            '''</Summary>
            <ApiMember(Description:="Order status number")>
            Public Overridable Property OrderStatus As OrderStatus

            '''<Summary>
            '''String value of order status
            '''</Summary>
            <ApiMember(Description:="String value of order status")>
            Public Overridable Property OrderStatusValue As String

            '''<Summary>
            '''List of waypoints for this order
            '''</Summary>
            <ApiMember(Description:="List of waypoints for this order")>
            Public Overridable Property Waypoints As List(Of OrderItemWaypoint)

            '''<Summary>
            '''List of sections between waypoints
            '''</Summary>
            <ApiMember(Description:="List of sections between waypoints")>
            Public Overridable Property TransitPoints As List(Of OrderTransitPoint)

            '''<Summary>
            '''Order Final price including VAT
            '''</Summary>
            <ApiMember(Description:="Order Final price including VAT")>
            Public Overridable Property FinalPrice As Decimal

            '''<Summary>
            '''Final price formatted as ZA currency
            '''</Summary>
            <ApiMember(Description:="Final price formatted as ZA currency")>
            Public Overridable Property FinalPriceValue As String

            '''<Summary>
            '''Total distance for the order in km
            '''</Summary>
            <ApiMember(Description:="Total distance for the order in km")>
            Public Overridable Property TotalDistance As Double

            '''<Summary>
            '''Total distance for the order formatted as a string
            '''</Summary>
            <ApiMember(Description:="Total distance for the order formatted as a string")>
            Public Overridable Property TotalDistanceValue As String

            '''<Summary>
            '''Date order was placed
            '''</Summary>
            <ApiMember(Description:="Date order was placed")>
            Public Overridable Property [Date] As String

            '''<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")>
            Public Overridable Property EncodedPolyPath As String

            '''<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")>
            Public Overridable Property Events As List(Of EventDetail)
        End Class

        Public Partial Class OrderItemWaypoint
            '''<Summary>
            '''Has the driver completed this waypoint
            '''</Summary>
            <ApiMember(Description:="Has the driver completed this waypoint")>
            Public Overridable Property Completed As Boolean

            Public Overridable Property Latitude As Double
            Public Overridable Property Longitude As Double
            Public Overridable Property Address As String
            Public Overridable Property ContactName As String
            Public Overridable Property ContactNumber As String
            Public Overridable Property DeliveryInstructions As String
            '''<Summary>
            '''Details captured at waypoint
            '''</Summary>
            <ApiMember(Description:="Details captured at waypoint")>
            Public Overridable Property ScanDetail As ScanDetail
        End Class

        Public Partial Class OrderResponse
            Inherits ApiServiceResponse
            Public Sub New()
                OrderItems = New List(Of OrderDetail)
            End Sub

            '''<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")>
            Public Overridable Property OrderItems As List(Of OrderDetail)

            '''<Summary>
            '''Total number of items in order collection
            '''</Summary>
            <ApiMember(Description:="Total number of items in order collection")>
            Public Overridable Property TotalCount As Integer

            '''<Summary>
            '''Used to indicate if there are more items available
            '''</Summary>
            <ApiMember(Description:="Used to indicate if there are more items available")>
            Public Overridable Property LastPage As Boolean
        End Class

        Public Partial Class OrderTransitPoint
            '''<Summary>
            '''Origin waypoint number
            '''</Summary>
            <ApiMember(Description:="Origin waypoint number")>
            Public Overridable Property FromWaypointNumber As Integer

            '''<Summary>
            '''Destination waypoint number
            '''</Summary>
            <ApiMember(Description:="Destination waypoint number")>
            Public Overridable Property ToWaypointNumber As Integer

            '''<Summary>
            '''Distance between waypoints
            '''</Summary>
            <ApiMember(Description:="Distance between waypoints")>
            Public Overridable Property Distance As Double

            '''<Summary>
            '''Distance between waypoints rounded and converted to a string
            '''</Summary>
            <ApiMember(Description:="Distance between waypoints rounded and converted to a string")>
            Public Overridable Property DistanceValue As String

            '''<Summary>
            '''Price calculated between waypoints
            '''</Summary>
            <ApiMember(Description:="Price calculated between waypoints")>
            Public Overridable Property Price As Decimal

            '''<Summary>
            '''Price calculated between waypoints formatted as ZA currency
            '''</Summary>
            <ApiMember(Description:="Price calculated between waypoints formatted as ZA currency")>
            Public Overridable Property PriceValue As String
        End Class

        Public Partial Class ScanDetail
            Public Sub New()
                PhotoUrls = New List(Of String)
                SignatureUrls = New List(Of String)
            End Sub

            '''<Summary>
            '''List of URLs for images captured at the waypoint
            '''</Summary>
            <ApiMember(Description:="List of URLs for images captured at the waypoint")>
            Public Overridable Property PhotoUrls As List(Of String)

            '''<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")>
            Public Overridable Property SignatureUrls As List(Of String)

            '''<Summary>
            '''Name of person the driver interacted with at the waypoint
            '''</Summary>
            <ApiMember(Description:="Name of person the driver interacted with at the waypoint")>
            Public Overridable Property ReceivedBy As String

            '''<Summary>
            '''The date the driver interacted with the person
            '''</Summary>
            <ApiMember(Description:="The date the driver interacted with the person")>
            Public Overridable Property ReceivedDate As String

            '''<Summary>
            '''Number of packages collected by the driver
            '''</Summary>
            <ApiMember(Description:="Number of packages collected by the driver")>
            Public Overridable Property PackagesCollected As Integer
        End Class
    End Namespace

    Namespace WebService.ClientServiceModel.Base

        Public Partial Class ApiServiceRequest
            Implements IServiceRequest
            Implements IHasApiKey
            '''<Summary>
            '''The API Key required for authentication
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The API Key required for authentication", IsRequired:=true)>
            Public Overridable Property ApiKey As String
        End Class

        Public Partial Class ApiServiceResponse
            Implements IServiceResponse
            '''<Summary>
            '''Information about the response.
            '''</Summary>
            <ApiMember(Description:="Information about the response.", IsRequired:=true)>
            Public Overridable Property Description As String

            '''<Summary>
            '''Heading or summary of the response.
            '''</Summary>
            <ApiMember(Description:="Heading or summary of the response.", IsRequired:=true)>
            Public Overridable Property Heading As String

            '''<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)>
            Public Overridable Property WasSuccessful As Boolean
        End Class
    End Namespace
End Namespace

VB.NET 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: api.1fetch.co.za 
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}