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.
PlaceOrder Parameters:
NameParameterData TypeRequiredDescription
ClientReferencebodystringNoOptionally provide your own reference identifier
CustomerReferencebodystringNoOptionally provide a reference for the customer/business
WaypointsbodyList<RequestQuoteWaypoint>YesArray of waypoints
IsScheduledbodyboolYesIs this a scheduled order?
ScheduleTypebodyScheduleTypeNoSpecify the scheduling type, required if IsScheduled is true

Allowable Values

  • NextAvailable
  • SpecificTime
ScheduledDatebodystringNoSpecify the scheduled date for this delivery in ISO 8601 string format, required if IsScheduled is true and ScheduleType is SpecificTime
TestbodyboolYesSet this to true to prevent creating an order and billing for it
IsUrgentbodyboolNoIs your account allows Urgent Orders, you can use this flag to indicate when an Order is urgent.
ApiServiceRequest Parameters:
NameParameterData TypeRequiredDescription
ApiKeyformstringYesThe API Key required for authentication
RequestQuoteWaypoint Parameters:
NameParameterData TypeRequiredDescription
WaypointNumberformintYesNumber of waypoint for ordering
LatitudeformdoubleYesWaypoint Latitude
LongitudeformdoubleYesWaypoint Longitude
ContactNameformstringYesName of contact person at waypoint
ContactNumberformstringYesTelephone number of contact person at waypoint
DeliveryInstructionsformstringYesInstructions for driver to follow at waypoint
AddressformstringYesWaypoint address
ScheduleType Enum:
NameValue
NextAvailable0
SpecificTime1
PlaceOrderResponse Parameters:
NameParameterData TypeRequiredDescription
OrderIdformGuidNoThe ID of the order.
WaypointIssueformboolNoWere there any validation issues for any waypoints
TotalDistanceformdoubleNoThe total distance for the order
TotalDistanceValueformstringNoThe total distance for the order, formatted as a string
ScheduledDateformstringNoThe date and time the order is scheduled for in ISO 8601 string format, will be set if IsScheduled is true
SubTotalformstringNoThe subtotal of the order before VAT
FinalPriceformstringNoThe total of the order after VAT
VATValueformstringNoThe amount of VAT
SchedulingNoticeformstringNoWill contain a message if there a problem with a scheduled order
SchedulingErrorformstringNoWill contain a message if there is a problem with a scheduled quote, if the order is scheduled to soon to opening times
WayBillformstringNoUser friendly waybill number
WaypointsformList<WaypointQuoteInformation>NoList of order information for pricing etc between each waypoint
WaypointValidationsformList<WaypointValidationInformation>NoList with validation information for each waypoint
ApiServiceResponse Parameters:
NameParameterData TypeRequiredDescription
DescriptionformstringYesInformation about the response.
HeadingformstringYesHeading or summary of the response.
WasSuccessfulformbooleanYesDid the intended operation for this response complete successfully?
WaypointQuoteInformation Parameters:
NameParameterData TypeRequiredDescription
DistanceformdoubleNoDistance between waypoints as a number
DistanceValueformstringNoString formatted distance
WaypointValidformboolNo
MessageformstringNo
ErrorDetailsformList<string>No
PriceformdecimalNoCaculated price between waypoints excluding vat
PriceValueformstringNoPrice excluding vat formatted as a string rand value
PriceWithVATformdecimalNoThe price between waypoints including vat
PriceValueWithVATformstringNoThe price including vat formatted as a rand value string
LinkedWaypoint Parameters:
NameParameterData TypeRequiredDescription
FromWaypointNumberformintNo
ToWaypointNumberformintNo
FromLatitudeformdoubleNo
FromLongitudeformdoubleNo
ToLatitudeformdoubleNo
ToLongitudeformdoubleNo
WaypointValidationInformation Parameters:
NameParameterData TypeRequiredDescription
WaypointNumberformintNo
IsValidformboolNo
ErrorMessagesformList<string>No

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

HTTP + JSV

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

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