| POST | /quote/validatewaypoints | Validate the waypoints for a client. |
|---|
"use strict";
export class ApiServiceRequest {
/** @param {{ApiKey?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description The API Key required for authentication */
ApiKey;
}
export class ApiServiceResponse {
/** @param {{Description?:string,Heading?:string,WasSuccessful?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Information about the response. */
Description;
/**
* @type {string}
* @description Heading or summary of the response. */
Heading;
/**
* @type {boolean}
* @description Did the intended operation for this response complete successfully? */
WasSuccessful;
}
export class WaypointValidationInformation {
/** @param {{WaypointNumber?:number,IsValid?:boolean,ErrorMessages?:string[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
WaypointNumber;
/** @type {boolean} */
IsValid;
/** @type {string[]} */
ErrorMessages;
}
export class LinkedWaypoint {
/** @param {{FromWaypointNumber?:number,ToWaypointNumber?:number,FromLatitude?:number,FromLongitude?:number,ToLatitude?:number,ToLongitude?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
FromWaypointNumber;
/** @type {number} */
ToWaypointNumber;
/** @type {number} */
FromLatitude;
/** @type {number} */
FromLongitude;
/** @type {number} */
ToLatitude;
/** @type {number} */
ToLongitude;
}
export class WaypointQuoteInformation extends LinkedWaypoint {
/** @param {{Distance?:number,DistanceValue?:string,WaypointValid?:boolean,Message?:string,ErrorDetails?:string[],Price?:number,PriceValue?:string,PriceWithVAT?:number,PriceValueWithVAT?:string,FromWaypointNumber?:number,ToWaypointNumber?:number,FromLatitude?:number,FromLongitude?:number,ToLatitude?:number,ToLongitude?:number}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {number}
* @description Distance between waypoints as a number */
Distance;
/**
* @type {string}
* @description String formatted distance */
DistanceValue;
/** @type {boolean} */
WaypointValid;
/** @type {string} */
Message;
/** @type {string[]} */
ErrorDetails;
/**
* @type {number}
* @description Caculated price between waypoints excluding vat */
Price;
/**
* @type {string}
* @description Price excluding vat formatted as a string rand value */
PriceValue;
/**
* @type {number}
* @description The price between waypoints including vat */
PriceWithVAT;
/**
* @type {string}
* @description The price including vat formatted as a rand value string */
PriceValueWithVAT;
}
export class ValidateWaypointsResponse extends ApiServiceResponse {
/** @param {{WaypointValidations?:WaypointValidationInformation[],TotalDistance?:number,TotalDistanceValue?:string,Waypoints?:WaypointQuoteInformation[],WaypointIssue?:boolean,Description?:string,Heading?:string,WasSuccessful?:boolean}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {WaypointValidationInformation[]}
* @description List with validation information for each waypoint */
WaypointValidations;
/**
* @type {number}
* @description The total distance for the order */
TotalDistance;
/**
* @type {string}
* @description The total distance for the order, formatted as a string */
TotalDistanceValue;
/**
* @type {WaypointQuoteInformation[]}
* @description List of information for pricing etc between each waypoint */
Waypoints;
/**
* @type {boolean}
* @description Is there an issue for the waypoints details specified? */
WaypointIssue;
}
export class RequestQuoteWaypoint {
/** @param {{WaypointNumber?:number,Latitude?:number,Longitude?:number,ContactName?:string,ContactNumber?:string,DeliveryInstructions?:string,Address?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description Number of waypoint for ordering */
WaypointNumber;
/**
* @type {number}
* @description Waypoint Latitude */
Latitude;
/**
* @type {number}
* @description Waypoint Longitude */
Longitude;
/**
* @type {string}
* @description Name of contact person at waypoint */
ContactName;
/**
* @type {string}
* @description Telephone number of contact person at waypoint */
ContactNumber;
/**
* @type {string}
* @description Instructions for driver to follow at waypoint */
DeliveryInstructions;
/**
* @type {string}
* @description Waypoint address */
Address;
}
export class ValidateWaypoints extends ApiServiceRequest {
/** @param {{Waypoints?:RequestQuoteWaypoint[],Test?:boolean,ApiKey?:string}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {RequestQuoteWaypoint[]}
* @description Array of waypoints */
Waypoints;
/**
* @type {boolean}
* @description Set this to true to prevent while testing the API. */
Test;
}
JavaScript ValidateWaypoints DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /quote/validatewaypoints HTTP/1.1
Host: api.1fetch.co.za
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Waypoints":[{"WaypointNumber":0,"Latitude":0,"Longitude":0,"ContactName":"String","ContactNumber":"String","DeliveryInstructions":"String","Address":"String"}],"Test":false,"ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{Unable to show example output for type 'ValidateWaypointsResponse' using the custom 'csv' filter}One or more errors occurred. (Object reference not set to an instance of an object.)