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.
"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 RequestQuoteResponse extends ApiServiceResponse {
    /** @param {{WaypointIssue?:boolean,QuoteReady?:boolean,QuoteExpired?:boolean,TotalDistance?:number,TotalDistanceValue?:string,ScheduledDate?:string,SubTotal?:string,FinalPrice?:string,VATValue?:string,SchedulingNotice?:string,SchedulingError?:string,QuoteId?:string,WayBill?:string,DateCreated?:string,LastUpdated?:string,Waypoints?:WaypointQuoteInformation[],WaypointValidations?:WaypointValidationInformation[],Description?:string,Heading?:string,WasSuccessful?:boolean}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {boolean}
     * @description Is there an issue for the waypoints details specified? */
    WaypointIssue;
    /**
     * @type {boolean}
     * @description Is the quote created successfully and ready to be placed as an order? */
    QuoteReady;
    /**
     * @type {boolean}
     * @description Is the quote expired? */
    QuoteExpired;
    /**
     * @type {number}
     * @description The total distance for the quote */
    TotalDistance;
    /**
     * @type {string}
     * @description The total distance for the quote, 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 might be a problem with a scheduled quote */
    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 The ID of the generated quote, needed when you want to change this quote later */
    QuoteId;
    /**
     * @type {string}
     * @description User friendly waybill number */
    WayBill;
    /**
     * @type {string}
     * @description The date this order was created */
    DateCreated;
    /**
     * @type {string}
     * @description The date this quote was last changed */
    LastUpdated;
    /**
     * @type {WaypointQuoteInformation[]}
     * @description List of quote 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 RequestQuote extends ApiServiceRequest {
    /** @param {{Waypoints?:RequestQuoteWaypoint[],IsScheduled?:boolean,ScheduleType?:ScheduleType,ScheduledDate?:string,QuoteId?:string,Test?:boolean,ApiKey?:string}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @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 {string}
     * @description Specify a quote Id to amend a quote. Required when amending an existing quote. */
    QuoteId;
    /**
     * @type {boolean}
     * @description Set this to true to prevent creating the quote */
    Test;
}

JavaScript RequestQuote DTOs

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

HTTP + CSV

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

POST /quote HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
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"}],"IsScheduled":false,"ScheduleType":0,"ScheduledDate":"String","QuoteId":"00000000-0000-0000-0000-000000000000","Test":false,"ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

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