POST Shipments to send a shipment to Pacejet
From the main menu, click Tools, API, and then API Samples.
Select the Shipments endpoint, and, from ADDITIONAL SAMPLES, choose sample "21".
Enter a value like "PackList030901" for both a "TransactionID" and "ExternalTransactionID" that you add to the sample.
Click Run It.
A response with a returned URL and response header information will be displayed as shown.
The request sent to Shipments for this example includes minimal data fields for a shipment such as the location, TransactionID, ExternalTransactionID, origin facility, and destination address. Notice that this example referenced a facility ID for origin address rather than providing the optional address details (see the "Using Facilities…" section for more on this best practice).
{
"Location": "DemoAPI",
"TransactionID": "PackList030901",
"ExternalTransactionID": "PackList030901",
"Origin": {
"LocationType": "Facility",
"LocationSite": "MAIN",
"LocationCode": "1",
},
"Destination": {
"CompanyName": "Buysalot, Inc",
"Address1": "3185 Main Ave",
"City": "Fargo",
"StateOrProvinceCode": "ND",
"PostalCode": "58103",
"CountryCode": "US",
"ContactName": "Bob Buyers",
"Email": "bob.buyers@buysalot.com",
"Phone": "877-722-3538"
}
}The response returned by Shipments includes a URL for integrated applications to "pop-up" the Pacejet rate and ship page for interactive quoting or shipping. Also, note that a standard HTTP Response Code of "200 OK" is returned when a request is successfully processed.
{
"result":
"http://appn.pacejet.cc/DemoAPI/Content/Transactions/RateShip.aspx?RateQuoteName=~PackLi st030901"
}For this example, the next step is for the calling application to forward the user (i.e. pop-up) to the Pacejet Rate & Ship screen using the returned URL. Perform this step manually:
Login to Pacejet.
Enter a few containers with weights, and click the Rate icon to rate-shop and select a carrier.
Click the Ship icon to process the sample shipment with a carrier.
After your shipment processing is complete, the Ship Confirmation page will be displayed. The shipment is considered Complete but has NOT yet been marked as updated in your ERP.
GET ShipmentConfirms to retrieve data after shipping with a carrier
From the API Samples, screen, select ShipmentConfirms.
Replace the token {TransactionID} in the sample code with your transaction ID (e.g. PackList030901 as shown below).
Click Run It.
The response returned by ShipmentConfirms includes a wide range of detail about the processed shipment. The example below has been edited to focus on showing key fields including cost, price, list price, addresses, and package level detail such as tracking numbers, weight, and dimensions.
{
"notifications": {
"highestSeverity": "Success",
"highestSeverityNotification": null
},
"transactionID": "PackList030901",
"externalTransactionID": "PackList030901",
"location": "DemoAPI",
"carrierClassOfService": "Ground",
"carrier": "FedEx",
"shipVia": "FEDGRO",
"freightTerms": "",
"origin": {
"address1": "1075 4th St.",
"address2": "",
"address3": "",
"address4": "",
"address5": null,
"city": "Boston",
"stateOrProvinceCode": "MA",
"postalCode": "02127",
"urbanizationCode": null,
"countryCode": "US",
"locationType": "Facility",
"locationSite": "MAIN",
"locationCode": "1",
"companyName": "Wolfe East",
"contactName": "Bob Eastman",
"email": "bob.eastman@wolfe.com",
"phone": "877-722-3538"
},
"destination": {
"address1": "3185 Main Ave",
"address2": "",
"address3": "",
"address4": "",
"address5": null,
"city": "Fargo",
"stateOrProvinceCode": "ND",
"postalCode": "58103",
"countryCode": "US",
"residential": false,
"locationType": "Customer",
"locationSite": "",
"locationCode": "PJCU_000746",
"companyName": "Buysalot, Inc",
"contactName": "Bob Buyers",
"email": "bob.buyers@buysalot.com",
"phone": "877-722-3538"
},
"routingDetail": {
"shipTimestamp": "2017-03-09T03:14:52.41Z",
"arrivalEstimate": "2017-04-03T00:00:00",
"transitTime": 3,
"arrivalEstimateString": "Monday, April 3, 2017"
},
"rateDetail": {
"freightTotalCost": {
"currency": "USD",
"amount": 58.73
},
"freightTotalPrice": {
"currency": "USD",
"amount": 68.73
},
"freightListPrice": {
"currency": "USD",
"amount": 58.73
}
},
"completedPackageDetailsList": [
{
"packingListNumber": "PackList030-001",
"trackingUrl": "http://www.fedex.com/Tracking?tracknumbers=900804315262624",
"trackingNumber": "900804315262624"
"weight": {
"units": 1,
"value": 15
},
"dimensions": {
"length": "16",
"width": "16",
"height": "16",
"units": 1
},
},
{
"packingListNumber": "PackList030-002",
"trackingUrl": "http://www.fedex.com/Tracking?tracknumbers=900804315262631",
"trackingNumber": "900804315262631",
"weight": {
"units": 1,
"value": 25
},
"dimensions": {
"length": "20",
"width": "16",
"height": "14",
"units": 1
}
}
]
} PUT ShipmentConfirms to notify Pacejet of a successful ERP update
Pacejet helps synchronize shipping with other applications by providing visibility of updates as they are applied successfully to ERP or other software.
From the main menu, click Transactions, and then click Search Shipments.
Select the Delivery Order drop-down in the Search For box.
Enter the Delivery Order number assigned to your sample shipment (e.g. PackList030901), locate the shipment, and notice the ERP Status of New which indicates that this shipment has not yet been updated in an integrated application.
From the API Samples screen, select ShipmentConfirms again, click the PUT tab, replace the token {TransactionID} in the sample code with your transaction ID (e.g. PackList030901 as below).
Click the Run It button.
Notice the Success response message along with the standard HTTP response code.Return to the Search Shipments page, locate your shipment again, and notice the ERP Status of Success which indicates that this shipment has been updated in an integrated application.