1Fetch Client API

<back to all web services

PlaceOrder

The following routes are available for this service:
POST/orderProvide waypoints for a route and place an order. This will bill the order to your account.
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 Partial Class LinkedWaypoint
            Public Overridable Property FromWaypointNumber As Integer
            Public Overridable Property ToWaypointNumber As Integer
            Public Overridable Property FromLatitude As Double
            Public Overridable Property FromLongitude As Double
            Public Overridable Property ToLatitude As Double
            Public Overridable Property ToLongitude As Double
        End Class
    End Namespace

    Namespace WebService.ClientServiceModel

        Public Partial Class PlaceOrder
            Inherits ApiServiceRequest
            Implements ILogRequest
            Public Sub New()
                Waypoints = New List(Of RequestQuoteWaypoint)
            End Sub

            '''<Summary>
            '''Optionally provide your own reference identifier
            '''</Summary>
            <ApiMember(Description:="Optionally provide your own reference identifier")>
            Public Overridable Property ClientReference As String

            '''<Summary>
            '''Optionally provide a reference for the customer/business
            '''</Summary>
            <ApiMember(Description:="Optionally provide a reference for the customer/business")>
            Public Overridable Property CustomerReference As String

            '''<Summary>
            '''Array of waypoints
            '''</Summary>
            <ApiMember(Description:="Array of waypoints", IsRequired:=true)>
            Public Overridable Property Waypoints As List(Of RequestQuoteWaypoint)

            '''<Summary>
            '''Is this a scheduled order?
            '''</Summary>
            <ApiMember(Description:="Is this a scheduled order?", IsRequired:=true)>
            Public Overridable Property IsScheduled As Boolean

            '''<Summary>
            '''Specify the scheduling type, required if IsScheduled is true
            '''</Summary>
            <ApiMember(Description:="Specify the scheduling type, required if IsScheduled is true")>
            Public Overridable Property ScheduleType As ScheduleType

            '''<Summary>
            '''Specify the scheduled date for this delivery in ISO 8601 string format, required if IsScheduled is true and ScheduleType is SpecificTime
            '''</Summary>
            <ApiMember(Description:="Specify the scheduled date for this delivery in ISO 8601 string format, required if IsScheduled is true and ScheduleType is SpecificTime")>
            Public Overridable Property ScheduledDate As String

            '''<Summary>
            '''Set this to true to prevent creating an order and billing for it
            '''</Summary>
            <ApiMember(Description:="Set this to true to prevent creating an order and billing for it", IsRequired:=true)>
            Public Overridable Property Test As Boolean

            '''<Summary>
            '''Is your account allows Urgent Orders, you can use this flag to indicate when an Order is urgent.
            '''</Summary>
            <ApiMember(Description:="Is your account allows Urgent Orders, you can use this flag to indicate when an Order is urgent.")>
            Public Overridable Property IsUrgent As Boolean
        End Class

        Public Partial Class PlaceOrderResponse
            Inherits ApiServiceResponse
            Public Sub New()
                Waypoints = New List(Of WaypointQuoteInformation)
                WaypointValidations = New List(Of WaypointValidationInformation)
            End Sub

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

            '''<Summary>
            '''Were there any validation issues for any waypoints
            '''</Summary>
            <ApiMember(Description:="Were there any validation issues for any waypoints")>
            Public Overridable Property WaypointIssue As Boolean

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

            '''<Summary>
            '''The total distance for the order, formatted as a string
            '''</Summary>
            <ApiMember(Description:="The total distance for the order, formatted as a string")>
            Public Overridable Property TotalDistanceValue 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>
            '''The subtotal of the order before VAT
            '''</Summary>
            <ApiMember(Description:="The subtotal of the order before VAT")>
            Public Overridable Property SubTotal As String

            '''<Summary>
            '''The total of the order after VAT
            '''</Summary>
            <ApiMember(Description:="The total of the order after VAT")>
            Public Overridable Property FinalPrice As String

            '''<Summary>
            '''The amount of VAT 
            '''</Summary>
            <ApiMember(Description:="The amount of VAT ")>
            Public Overridable Property VATValue As String

            '''<Summary>
            '''Will contain a message if there a problem with a scheduled order
            '''</Summary>
            <ApiMember(Description:="Will contain a message if there a problem with a scheduled order")>
            Public Overridable Property SchedulingNotice As String

            '''<Summary>
            '''Will contain a message if there is a problem with a scheduled quote, if the order is scheduled to soon to opening times
            '''</Summary>
            <ApiMember(Description:="Will contain a message if there is a problem with a scheduled quote, if the order is scheduled to soon to opening times")>
            Public Overridable Property SchedulingError As String

            '''<Summary>
            '''User friendly waybill number
            '''</Summary>
            <ApiMember(Description:="User friendly waybill number")>
            Public Overridable Property WayBill As String

            '''<Summary>
            '''List of order information for pricing etc between each waypoint
            '''</Summary>
            <ApiMember(Description:="List of order information for pricing etc between each waypoint")>
            Public Overridable Property Waypoints As List(Of WaypointQuoteInformation)

            '''<Summary>
            '''List with validation information for each waypoint
            '''</Summary>
            <ApiMember(Description:="List with validation information for each waypoint")>
            Public Overridable Property WaypointValidations As List(Of WaypointValidationInformation)
        End Class

        Public Partial Class RequestQuoteWaypoint
            Implements IRequestWaypoint
            '''<Summary>
            '''Number of waypoint for ordering
            '''</Summary>
            <ApiMember(Description:="Number of waypoint for ordering", IsRequired:=true)>
            Public Overridable Property WaypointNumber As Integer

            '''<Summary>
            '''Waypoint Latitude
            '''</Summary>
            <ApiMember(Description:="Waypoint Latitude", IsRequired:=true)>
            Public Overridable Property Latitude As Double

            '''<Summary>
            '''Waypoint Longitude
            '''</Summary>
            <ApiMember(Description:="Waypoint Longitude", IsRequired:=true)>
            Public Overridable Property Longitude As Double

            '''<Summary>
            '''Name of contact person at waypoint
            '''</Summary>
            <ApiMember(Description:="Name of contact person at waypoint", IsRequired:=true)>
            Public Overridable Property ContactName As String

            '''<Summary>
            '''Telephone number of contact person at waypoint
            '''</Summary>
            <ApiMember(Description:="Telephone number of contact person at waypoint", IsRequired:=true)>
            Public Overridable Property ContactNumber As String

            '''<Summary>
            '''Instructions for driver to follow at waypoint
            '''</Summary>
            <ApiMember(Description:="Instructions for driver to follow at waypoint", IsRequired:=true)>
            Public Overridable Property DeliveryInstructions As String

            '''<Summary>
            '''Waypoint address
            '''</Summary>
            <ApiMember(Description:="Waypoint address", IsRequired:=true)>
            Public Overridable Property Address As String
        End Class

        Public Enum ScheduleType
            NextAvailable = 0
            SpecificTime = 1
        End Enum

        Public Partial Class WaypointQuoteInformation
            Inherits LinkedWaypoint
            Public Sub New()
                ErrorDetails = New List(Of String)
            End Sub

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

            '''<Summary>
            '''String formatted distance
            '''</Summary>
            <ApiMember(Description:="String formatted distance")>
            Public Overridable Property DistanceValue As String

            Public Overridable Property WaypointValid As Boolean
            Public Overridable Property Message As String
            Public Overridable Property ErrorDetails As List(Of String)
            '''<Summary>
            '''Caculated price between waypoints excluding vat
            '''</Summary>
            <ApiMember(Description:="Caculated price between waypoints excluding vat")>
            Public Overridable Property Price As Decimal

            '''<Summary>
            '''Price excluding vat formatted as a string rand value
            '''</Summary>
            <ApiMember(Description:="Price excluding vat formatted as a string rand value")>
            Public Overridable Property PriceValue As String

            '''<Summary>
            '''The price between waypoints including vat
            '''</Summary>
            <ApiMember(Description:="The price between waypoints including vat")>
            Public Overridable Property PriceWithVAT As Decimal

            '''<Summary>
            '''The price including vat formatted as a rand value string
            '''</Summary>
            <ApiMember(Description:="The price including vat formatted as a rand value string")>
            Public Overridable Property PriceValueWithVAT As String
        End Class

        Public Partial Class WaypointValidationInformation
            Public Sub New()
                ErrorMessages = New List(Of String)
            End Sub

            Public Overridable Property WaypointNumber As Integer
            Public Overridable Property IsValid As Boolean
            Public Overridable Property ErrorMessages As List(Of String)
        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 PlaceOrder DTOs

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

HTTP + OTHER

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

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

{"ClientReference":"String","CustomerReference":"String","Waypoints":[{"WaypointNumber":0,"Latitude":0,"Longitude":0,"ContactName":"String","ContactNumber":"String","DeliveryInstructions":"String","Address":"String"}],"IsScheduled":false,"ScheduleType":0,"ScheduledDate":"String","Test":false,"IsUrgent":false,"ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"OrderId":"00000000-0000-0000-0000-000000000000","WaypointIssue":false,"TotalDistance":0,"TotalDistanceValue":"0","ScheduledDate":"String","SubTotal":"String","FinalPrice":"String","VATValue":"String","SchedulingNotice":"String","SchedulingError":"String","WayBill":"String","Waypoints":[{}],"WaypointValidations":[{}],"Description":"String","Heading":"String","WasSuccessful":false}