| POST,OPTIONS | /v1/dispatch/courier/runs |
|---|
"use strict";
export class CourierItemView {
/** @param {{CourierItemID?:number,DispatchOdRequestID?:number,Seq?:number,TagCode?:string,Custody?:string,IsOpen?:boolean,IsMissing?:boolean,MissingReason?:string,IsManual?:boolean,ReTagFlag?:boolean,Scanned?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
CourierItemID;
/** @type {number} */
DispatchOdRequestID;
/** @type {number} */
Seq;
/** @type {string} */
TagCode;
/** @type {string} */
Custody;
/** @type {boolean} */
IsOpen;
/** @type {boolean} */
IsMissing;
/** @type {string} */
MissingReason;
/** @type {boolean} */
IsManual;
/** @type {boolean} */
ReTagFlag;
/** @type {boolean} */
Scanned;
}
export class CourierStopView {
/** @param {{Sequence?:number,Status?:string,DispatchOdRequestID?:number,Code?:string,CourierStep?:string,Address?:string,Unit?:string,City?:string,Zip?:string,Lat?:number,Lng?:number,CustomerName?:string,CustomerPhone?:string,Handoff?:string,GateCode?:string,Instructions?:string,Units?:number,DueText?:string,Note?:string,Needs?:string[],Items?:CourierItemView[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Sequence;
/** @type {string} */
Status;
/** @type {number} */
DispatchOdRequestID;
/** @type {string} */
Code;
/** @type {string} */
CourierStep;
/** @type {string} */
Address;
/** @type {string} */
Unit;
/** @type {string} */
City;
/** @type {string} */
Zip;
/** @type {?number} */
Lat;
/** @type {?number} */
Lng;
/** @type {string} */
CustomerName;
/** @type {string} */
CustomerPhone;
/** @type {string} */
Handoff;
/** @type {string} */
GateCode;
/** @type {string} */
Instructions;
/** @type {number} */
Units;
/** @type {string} */
DueText;
/** @type {string} */
Note;
/** @type {string[]} */
Needs = [];
/** @type {CourierItemView[]} */
Items = [];
}
export class CourierRunView {
/** @param {{CourierRunID?:number,Code?:string,Status?:string,CourierProfileId?:number,ProfileName?:string,CourierFacilityId?:number,FacilityName?:string,FacilityAddress?:string,DriverContactId?:number,DriverName?:string,EquipmentID?:number,VehicleUnit?:string,UnitOne?:string,UnitMany?:string,Units?:number,StopCount?:number,StopsDone?:number,Pay?:number,BuiltUtc?:string,StartedUtc?:string,CompletedUtc?:string,ToLoad?:number,ToReturn?:number,Stops?:CourierStopView[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
CourierRunID;
/** @type {string} */
Code;
/** @type {string} */
Status;
/** @type {number} */
CourierProfileId;
/** @type {string} */
ProfileName;
/** @type {number} */
CourierFacilityId;
/** @type {string} */
FacilityName;
/** @type {string} */
FacilityAddress;
/** @type {?number} */
DriverContactId;
/** @type {string} */
DriverName;
/** @type {?number} */
EquipmentID;
/** @type {string} */
VehicleUnit;
/** @type {string} */
UnitOne;
/** @type {string} */
UnitMany;
/** @type {number} */
Units;
/** @type {number} */
StopCount;
/** @type {number} */
StopsDone;
/** @type {?number} */
Pay;
/** @type {?string} */
BuiltUtc;
/** @type {?string} */
StartedUtc;
/** @type {?string} */
CompletedUtc;
/** @type {number} */
ToLoad;
/** @type {number} */
ToReturn;
/** @type {CourierStopView[]} */
Stops = [];
}
export class CourierRunResponse {
/** @param {{Runs?:CourierRunView[],Run?:CourierRunView,Message?:string,ResponseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {CourierRunView[]} */
Runs = [];
/** @type {CourierRunView} */
Run;
/** @type {string} */
Message;
/** @type {ResponseStatus} */
ResponseStatus;
}
export class CourierRunBuildRequest {
/** @param {{ProfileId?:number,FacilityCode?:string,Codes?:string[],DriverContactId?:number,EquipmentID?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
ProfileId;
/** @type {string} */
FacilityCode;
/** @type {string[]} */
Codes = [];
/** @type {?number} */
DriverContactId;
/** @type {?number} */
EquipmentID;
}
JavaScript CourierRunBuildRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/dispatch/courier/runs HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ProfileId: 0,
FacilityCode: String,
Codes:
[
String
],
DriverContactId: 0,
EquipmentID: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Runs:
[
{
CourierRunID: 0,
Code: String,
Status: String,
CourierProfileId: 0,
ProfileName: String,
CourierFacilityId: 0,
FacilityName: String,
FacilityAddress: String,
DriverContactId: 0,
DriverName: String,
EquipmentID: 0,
VehicleUnit: String,
UnitOne: String,
UnitMany: String,
Units: 0,
StopCount: 0,
StopsDone: 0,
Pay: 0,
BuiltUtc: 0001-01-01,
StartedUtc: 0001-01-01,
CompletedUtc: 0001-01-01,
ToLoad: 0,
ToReturn: 0,
Stops:
[
{
Sequence: 0,
Status: String,
DispatchOdRequestID: 0,
Code: String,
CourierStep: String,
Address: String,
Unit: String,
City: String,
Zip: String,
Lat: 0,
Lng: 0,
CustomerName: String,
CustomerPhone: String,
Handoff: String,
GateCode: String,
Instructions: String,
Units: 0,
DueText: String,
Note: String,
Needs:
[
String
],
Items:
[
{
CourierItemID: 0,
DispatchOdRequestID: 0,
Seq: 0,
TagCode: String,
Custody: String,
IsOpen: False,
IsMissing: False,
MissingReason: String,
IsManual: False,
ReTagFlag: False,
Scanned: False
}
]
}
]
}
],
Run:
{
CourierRunID: 0,
Code: String,
Status: String,
CourierProfileId: 0,
ProfileName: String,
CourierFacilityId: 0,
FacilityName: String,
FacilityAddress: String,
DriverContactId: 0,
DriverName: String,
EquipmentID: 0,
VehicleUnit: String,
UnitOne: String,
UnitMany: String,
Units: 0,
StopCount: 0,
StopsDone: 0,
Pay: 0,
BuiltUtc: 0001-01-01,
StartedUtc: 0001-01-01,
CompletedUtc: 0001-01-01,
ToLoad: 0,
ToReturn: 0,
Stops:
[
{
Sequence: 0,
Status: String,
DispatchOdRequestID: 0,
Code: String,
CourierStep: String,
Address: String,
Unit: String,
City: String,
Zip: String,
Lat: 0,
Lng: 0,
CustomerName: String,
CustomerPhone: String,
Handoff: String,
GateCode: String,
Instructions: String,
Units: 0,
DueText: String,
Note: String,
Needs:
[
String
],
Items:
[
{
CourierItemID: 0,
DispatchOdRequestID: 0,
Seq: 0,
TagCode: String,
Custody: String,
IsOpen: False,
IsMissing: False,
MissingReason: String,
IsManual: False,
ReTagFlag: False,
Scanned: False
}
]
}
]
},
Message: String,
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}