| POST | /order | Provide waypoints for a route and place an order. This will bill the order to your account. |
|---|
"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 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 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 PlaceOrderResponse extends ApiServiceResponse {
/** @param {{OrderId?:string,WaypointIssue?:boolean,TotalDistance?:number,TotalDistanceValue?:string,ScheduledDate?:string,SubTotal?:string,FinalPrice?:string,VATValue?:string,SchedulingNotice?:string,SchedulingError?:string,WayBill?:string,Waypoints?:WaypointQuoteInformation[],WaypointValidations?:WaypointValidationInformation[],Description?:string,Heading?:string,WasSuccessful?:boolean}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {string}
* @description The ID of the order. */
OrderId;
/**
* @type {boolean}
* @description Were there any validation issues for any waypoints */
WaypointIssue;
/**
* @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 {string}
* @description The date and time the order is scheduled for in ISO 8601 string format, will be set if IsScheduled is true */
ScheduledDate;
/**
* @type {string}
* @description The subtotal of the order before VAT */
SubTotal;
/**
* @type {string}
* @description The total of the order after VAT */
FinalPrice;
/**
* @type {string}
* @description The amount of VAT */
VATValue;
/**
* @type {string}
* @description Will contain a message if there a problem with a scheduled order */
SchedulingNotice;
/**
* @type {string}
* @description Will contain a message if there is a problem with a scheduled quote, if the order is scheduled to soon to opening times */
SchedulingError;
/**
* @type {string}
* @description User friendly waybill number */
WayBill;
/**
* @type {WaypointQuoteInformation[]}
* @description List of order information for pricing etc between each waypoint */
Waypoints;
/**
* @type {WaypointValidationInformation[]}
* @description List with validation information for each waypoint */
WaypointValidations;
}
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;
}
/** @typedef {number} */
export var ScheduleType;
(function (ScheduleType) {
ScheduleType[ScheduleType["NextAvailable"] = 0] = "NextAvailable"
ScheduleType[ScheduleType["SpecificTime"] = 1] = "SpecificTime"
})(ScheduleType || (ScheduleType = {}));
export class PlaceOrder extends ApiServiceRequest {
/** @param {{ClientReference?:string,CustomerReference?:string,Waypoints?:RequestQuoteWaypoint[],IsScheduled?:boolean,ScheduleType?:ScheduleType,ScheduledDate?:string,Test?:boolean,IsUrgent?:boolean,ApiKey?:string}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {string}
* @description Optionally provide your own reference identifier */
ClientReference;
/**
* @type {string}
* @description Optionally provide a reference for the customer/business */
CustomerReference;
/**
* @type {RequestQuoteWaypoint[]}
* @description Array of waypoints */
Waypoints;
/**
* @type {boolean}
* @description Is this a scheduled order? */
IsScheduled;
/**
* @type {ScheduleType}
* @description Specify the scheduling type, required if IsScheduled is true */
ScheduleType;
/**
* @type {string}
* @description Specify the scheduled date for this delivery in ISO 8601 string format, required if IsScheduled is true and ScheduleType is SpecificTime */
ScheduledDate;
/**
* @type {boolean}
* @description Set this to true to prevent creating an order and billing for it */
Test;
/**
* @type {boolean}
* @description Is your account allows Urgent Orders, you can use this flag to indicate when an Order is urgent. */
IsUrgent;
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=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}