1Fetch Client API

<back to all web services

RequestQuote

The following routes are available for this service:
POST/quoteProvide waypoints for a route and return a quote.
RequestQuote Parameters:
NameParameterData TypeRequiredDescription
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
QuoteIdbodyGuidNoSpecify a quote Id to amend a quote. Required when amending an existing quote.
TestbodyboolYesSet this to true to prevent creating the quote
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
RequestQuoteResponse Parameters:
NameParameterData TypeRequiredDescription
WaypointIssueformboolNoIs there an issue for the waypoints details specified?
QuoteReadyformboolNoIs the quote created successfully and ready to be placed as an order?
QuoteExpiredformboolNoIs the quote expired?
TotalDistanceformdoubleNoThe total distance for the quote
TotalDistanceValueformstringNoThe total distance for the quote, 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 might be a problem with a scheduled quote
SchedulingErrorformstringNoWill contain a message if there is a problem with a scheduled quote, if the order is scheduled to soon to opening times
QuoteIdformGuidNoThe ID of the generated quote, needed when you want to change this quote later
WayBillformstringNoUser friendly waybill number
DateCreatedformstringNoThe date this order was created
LastUpdatedformstringNoThe date this quote was last changed
WaypointsformList<WaypointQuoteInformation>NoList of quote 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 .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 /quote HTTP/1.1 
Host: api.1fetch.co.za 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

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

{Unable to show example output for type 'RequestQuoteResponse' using the custom 'other' filter}One or more errors occurred. (Object reference not set to an instance of an object.)