1Fetch Client API

<back to all web services

Order

The following routes are available for this service:
GET/orderGet order information.If you do not specify an OrderId, the results will be paged.

export class ApiServiceRequest implements IServiceRequest, IHasApiKey
{
    /** @description The API Key required for authentication */
    // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
    public ApiKey: string;

    public constructor(init?: Partial<ApiServiceRequest>) { (Object as any).assign(this, init); }
}

export class ApiServiceResponse implements IServiceResponse
{
    /** @description Information about the response. */
    // @ApiMember(Description="Information about the response.", IsRequired=true)
    public Description: string;

    /** @description Heading or summary of the response. */
    // @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
    public Heading: string;

    /** @description Did the intended operation for this response complete successfully? */
    // @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
    public WasSuccessful: boolean;

    public constructor(init?: Partial<ApiServiceResponse>) { (Object as any).assign(this, init); }
}

export enum OrderStatus
{
    AwaitingPayment = 0,
    ProcessingPayment = 1,
    AwaitingDispatch = 2,
    DriverDispatched = 3,
    PackageEnRoute = 4,
    Completed = 5,
    Cancelled = 6,
    DeliveryFailed = 7,
}

export class ScanDetail
{
    /** @description List of URLs for images captured at the waypoint */
    // @ApiMember(Description="List of URLs for images captured at the waypoint")
    public PhotoUrls: string[];

    /** @description List of URLs for images of signatures captured at the waypoint */
    // @ApiMember(Description="List of URLs for images of signatures captured at the waypoint")
    public SignatureUrls: string[];

    /** @description Name of person the driver interacted with at the waypoint */
    // @ApiMember(Description="Name of person the driver interacted with at the waypoint")
    public ReceivedBy: string;

    /** @description The date the driver interacted with the person */
    // @ApiMember(Description="The date the driver interacted with the person")
    public ReceivedDate: string;

    /** @description Number of packages collected by the driver */
    // @ApiMember(Description="Number of packages collected by the driver")
    public PackagesCollected: number;

    public constructor(init?: Partial<ScanDetail>) { (Object as any).assign(this, init); }
}

export class OrderItemWaypoint
{
    /** @description Has the driver completed this waypoint */
    // @ApiMember(Description="Has the driver completed this waypoint")
    public Completed: boolean;

    public Latitude: number;
    public Longitude: number;
    public Address: string;
    public ContactName: string;
    public ContactNumber: string;
    public DeliveryInstructions: string;
    /** @description Details captured at waypoint */
    // @ApiMember(Description="Details captured at waypoint")
    public ScanDetail: ScanDetail;

    public constructor(init?: Partial<OrderItemWaypoint>) { (Object as any).assign(this, init); }
}

export class OrderTransitPoint
{
    /** @description Origin waypoint number */
    // @ApiMember(Description="Origin waypoint number")
    public FromWaypointNumber: number;

    /** @description Destination waypoint number */
    // @ApiMember(Description="Destination waypoint number")
    public ToWaypointNumber: number;

    /** @description Distance between waypoints */
    // @ApiMember(Description="Distance between waypoints")
    public Distance: number;

    /** @description Distance between waypoints rounded and converted to a string */
    // @ApiMember(Description="Distance between waypoints rounded and converted to a string")
    public DistanceValue: string;

    /** @description Price calculated between waypoints */
    // @ApiMember(Description="Price calculated between waypoints")
    public Price: number;

    /** @description Price calculated between waypoints formatted as ZA currency */
    // @ApiMember(Description="Price calculated between waypoints formatted as ZA currency")
    public PriceValue: string;

    public constructor(init?: Partial<OrderTransitPoint>) { (Object as any).assign(this, init); }
}

export class EventDetail
{
    public Description: string;
    public Time: string;
    public EventDateTime: string;

    public constructor(init?: Partial<EventDetail>) { (Object as any).assign(this, init); }
}

export class OrderDetail
{
    /** @description ID of quote attached to the order */
    // @ApiMember(Description="ID of quote attached to the order")
    public QuoteId: string;

    /** @description ID of order */
    // @ApiMember(Description="ID of order")
    public OrderId: string;

    /** @description User friendly order identifier */
    // @ApiMember(Description="User friendly order identifier")
    public Waybill: string;

    /** @description Invoice number for the order */
    // @ApiMember(Description="Invoice number for the order")
    public InvoiceNumber: string;

    /** @description The date and time the order is scheduled for in ISO 8601 string format, will be set if IsScheduled is true */
    // @ApiMember(Description="The date and time the order is scheduled for in ISO 8601 string format, will be set if IsScheduled is true")
    public ScheduledDate: string;

    /** @description Order status number */
    // @ApiMember(Description="Order status number")
    public OrderStatus: OrderStatus;

    /** @description String value of order status */
    // @ApiMember(Description="String value of order status")
    public OrderStatusValue: string;

    /** @description List of waypoints for this order */
    // @ApiMember(Description="List of waypoints for this order")
    public Waypoints: OrderItemWaypoint[];

    /** @description List of sections between waypoints */
    // @ApiMember(Description="List of sections between waypoints")
    public TransitPoints: OrderTransitPoint[];

    /** @description Order Final price including VAT */
    // @ApiMember(Description="Order Final price including VAT")
    public FinalPrice: number;

    /** @description Final price formatted as ZA currency */
    // @ApiMember(Description="Final price formatted as ZA currency")
    public FinalPriceValue: string;

    /** @description Total distance for the order in km */
    // @ApiMember(Description="Total distance for the order in km")
    public TotalDistance: number;

    /** @description Total distance for the order formatted as a string */
    // @ApiMember(Description="Total distance for the order formatted as a string")
    public TotalDistanceValue: string;

    /** @description Date order was placed */
    // @ApiMember(Description="Date order was placed")
    public Date: string;

    /** @description Google encoded maps polyline path for drawing route on a google map */
    // @ApiMember(Description="Google encoded maps polyline path for drawing route on a google map")
    public EncodedPolyPath: string;

    /** @description List of events as they occurred while the order was in progress */
    // @ApiMember(Description="List of events as they occurred while the order was in progress")
    public Events: EventDetail[];

    public constructor(init?: Partial<OrderDetail>) { (Object as any).assign(this, init); }
}

export class OrderResponse extends ApiServiceResponse
{
    /** @description List with order details, will only contain one item if requested with order id */
    // @ApiMember(Description="List with order details, will only contain one item if requested with order id")
    public OrderItems: OrderDetail[];

    /** @description Total number of items in order collection */
    // @ApiMember(Description="Total number of items in order collection")
    public TotalCount: number;

    /** @description Used to indicate if there are more items available */
    // @ApiMember(Description="Used to indicate if there are more items available")
    public LastPage: boolean;

    public constructor(init?: Partial<OrderResponse>) { super(init); (Object as any).assign(this, init); }
}

export class Order extends ApiServiceRequest implements ILogRequest
{
    /** @description The ID if getting specific order */
    // @ApiMember(Description="The ID if getting specific order")
    public OrderId: string;

    /** @description The amount of elements to offset the index by */
    // @ApiMember(Description="The amount of elements to offset the index by")
    public Offset: number;

    /** @description The number of elements to be returned, defaults to 10 */
    // @ApiMember(Description="The number of elements to be returned, defaults to 10")
    public Count: number;

    public constructor(init?: Partial<Order>) { super(init); (Object as any).assign(this, init); }
}

TypeScript Order DTOs

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.

GET /order HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	OrderItems: 
	[
		{
			QuoteId: 00000000-0000-0000-0000-000000000000,
			OrderId: 00000000-0000-0000-0000-000000000000,
			Waybill: String,
			InvoiceNumber: String,
			ScheduledDate: String,
			OrderStatus: 0,
			OrderStatusValue: String,
			Waypoints: 
			[
				{
					
				}
			],
			TransitPoints: 
			[
				{
					
				}
			],
			FinalPrice: 0,
			FinalPriceValue: String,
			TotalDistance: 0,
			TotalDistanceValue: String,
			Date: String,
			EncodedPolyPath: String,
			Events: 
			[
				{
					
				}
			]
		}
	],
	TotalCount: 0,
	LastPage: False,
	Description: String,
	Heading: String,
	WasSuccessful: False
}