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.
Order Parameters:
NameParameterData TypeRequiredDescription
OrderIdquerystringNoThe ID if getting specific order
OffsetqueryintNoThe amount of elements to offset the index by
CountqueryintNoThe number of elements to be returned, defaults to 10
ApiServiceRequest Parameters:
NameParameterData TypeRequiredDescription
ApiKeyformstringYesThe API Key required for authentication
OrderResponse Parameters:
NameParameterData TypeRequiredDescription
OrderItemsformList<OrderDetail>NoList with order details, will only contain one item if requested with order id
TotalCountformintNoTotal number of items in order collection
LastPageformboolNoUsed to indicate if there are more items available
ApiServiceResponse Parameters:
NameParameterData TypeRequiredDescription
DescriptionformstringYesInformation about the response.
HeadingformstringYesHeading or summary of the response.
WasSuccessfulformbooleanYesDid the intended operation for this response complete successfully?
OrderDetail Parameters:
NameParameterData TypeRequiredDescription
QuoteIdformGuidNoID of quote attached to the order
OrderIdformGuidNoID of order
WaybillformstringNoUser friendly order identifier
InvoiceNumberformstringNoInvoice number for the order
ScheduledDateformstringNoThe date and time the order is scheduled for in ISO 8601 string format, will be set if IsScheduled is true
OrderStatusformOrderStatusNoOrder status number

Allowable Values

  • AwaitingPayment
  • ProcessingPayment
  • AwaitingDispatch
  • DriverDispatched
  • PackageEnRoute
  • Completed
  • Cancelled
  • DeliveryFailed
OrderStatusValueformstringNoString value of order status
WaypointsformList<OrderItemWaypoint>NoList of waypoints for this order
TransitPointsformList<OrderTransitPoint>NoList of sections between waypoints
FinalPriceformdecimalNoOrder Final price including VAT
FinalPriceValueformstringNoFinal price formatted as ZA currency
TotalDistanceformdoubleNoTotal distance for the order in km
TotalDistanceValueformstringNoTotal distance for the order formatted as a string
DateformstringNoDate order was placed
EncodedPolyPathformstringNoGoogle encoded maps polyline path for drawing route on a google map
EventsformList<EventDetail>NoList of events as they occurred while the order was in progress
OrderStatus Enum:
NameValue
AwaitingPayment0
ProcessingPayment1
AwaitingDispatch2
DriverDispatched3
PackageEnRoute4
Completed5
Cancelled6
DeliveryFailed7
OrderItemWaypoint Parameters:
NameParameterData TypeRequiredDescription
CompletedformboolNoHas the driver completed this waypoint
LatitudeformdoubleNo
LongitudeformdoubleNo
AddressformstringNo
ContactNameformstringNo
ContactNumberformstringNo
DeliveryInstructionsformstringNo
ScanDetailformScanDetailNoDetails captured at waypoint
ScanDetail Parameters:
NameParameterData TypeRequiredDescription
PhotoUrlsformList<string>NoList of URLs for images captured at the waypoint
SignatureUrlsformList<string>NoList of URLs for images of signatures captured at the waypoint
ReceivedByformstringNoName of person the driver interacted with at the waypoint
ReceivedDateformstringNoThe date the driver interacted with the person
PackagesCollectedformintNoNumber of packages collected by the driver
OrderTransitPoint Parameters:
NameParameterData TypeRequiredDescription
FromWaypointNumberformintNoOrigin waypoint number
ToWaypointNumberformintNoDestination waypoint number
DistanceformdoubleNoDistance between waypoints
DistanceValueformstringNoDistance between waypoints rounded and converted to a string
PriceformdecimalNoPrice calculated between waypoints
PriceValueformstringNoPrice calculated between waypoints formatted as ZA currency
EventDetail Parameters:
NameParameterData TypeRequiredDescription
DescriptionformstringNo
TimeformstringNo
EventDateTimeformDateTimeNo

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.

GET /order HTTP/1.1 
Host: api.1fetch.co.za 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
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}