Sunset Web API — Specification

Integration reference for the Sunset Pacific Transportation API: authentication, quoting, tendering, tracking and document retrieval.

Download Postman collection

Prerequisites

Before you can call any endpoint, you need an active account. Follow these steps once; afterwards you only authenticate to obtain a token.

1

Create an account

Register at the account registration page. During registration you define your username and password.

  • Your username is not your email — choose a short identifier such as tms89.
  • The username must be at least 5 characters long and include a minimum of 1 number and 1 letter.
  • Complete the remaining company / billing information requested by the form.
2

Wait for administrator approval

A Sunset Pacific administrator must enable your account before it can be used. Until it is approved, authentication will fail even with valid credentials.

3

Authenticate

Once your account is enabled, request a token from the Login endpoint using your username (not email) and password. Include the returned access_token in the Authorization header of every subsequent request.

Summary: Create account → administrator enables it → authenticate with your username and password to get the token.

Postman collection

Prefer Postman? Download the ready-made collection plus a pre-configured environment and skip the manual setup. The baseUrl is already set in each environment — you never copy a URL.

Download collection Production environment Test environment

  1. In Postman: Import → select the collection and the environment you need (Production or Test).
  2. In the top-right environment selector, choose the imported environment. The baseUrl is already set for that environment — nothing to copy.
  3. Open the environment (eye icon → Edit) and set username and password (your API username, not your email). Your account must already be enabled by an administrator.
  4. Run “1. Login (Get Token)”. A test script stores the access_token automatically.
  5. Run any other request — they all inherit Authorization: Bearer {{access_token}}, so no copy/paste of the token is needed. Create Quote also auto-fills the quoteId variable used by Get Quote, Tender and Upload Tender File.

1. Login

Authenticate the user with the system and obtain the access_token.

Request

POST Production https://api.sunsetpacific.com/token
POST Test https://apisunsetpacificstage.azurewebsites.net/token
LocationParamValue
HeaderAcceptapplication/json
HeaderContent-Typeapplication/x-www-form-urlencoded
Bodygrant_typepassword
BodyusernameYour username here (not email)
BodypasswordYour password here

Response

200 — token issued. All further API calls must include this key in the Authorization header.

{
    "access_token": <auth_key>,
    "token_type": "bearer",
    "expires_in": <int>,
    "userName": <string>,
    ".issued": "Thu, 30 Mar 2017 18:16:49 GMT",
    ".expires": "Thu, 30 Mar 2017 19:16:49 GMT"
}

400{ "error": "invalid_grant", "error_description": "The user name or password is incorrect." }

500{ "error": "Internal Server Error" }

The token is valid for 60 minutes from the time of its generation. After this period the token automatically expires and a new one must be generated to continue.

2. Create Quote

Create a new quote.

Tip: if you already have the origin ZIP code, use Create Quote By Zip Code (section 3) instead. It is the evolution of this endpoint and lets you send the origin as a ZIP code rather than the numeric origin.

Request

POST Production https://api.sunsetpacific.com/api/Quotes
POST Test https://apisunsetpacificstage.azurewebsites.net/api/Quotes
LocationParamType
HeaderAcceptapplication/json
HeaderContent-Typeapplication/json
HeaderAuthorizationBearer <auth_key>
BodyOriginint
BodyPickUpDatestring
BodyDestinationint
BodyLinealFootageKnownfloat
BodyWeightint
BodyIsFloorLoadedbool?
BodyShippingRemarksstring (incidental codes, see glossary)
BodyMeasurementLFTint?
BodyNonFloorLoadedsarray
BodyFloorLoadedsarray

Sample Request — Lineal Footage known

{
    "Origin": 1,
    "Destination": 30401,
    "PickUpDate": "2016-01-01",
    "LinealFootageKnown": 33.66,
    "Weight": 10000,
    "IsFloorLoaded": null,
    "NonFloorLoadeds": [],
    "FloorLoadeds": [],
    "ShippingRemarks": null,
    "MeasurementLFT": 2
}

Sample Request — Non Floor Loaded freights

{
    "Origin": 1,
    "Destination": 30401,
    "PickUpDate": "2016-01-01",
    "LinealFootageKnown": 0,
    "Weight": 11000,
    "IsFloorLoaded": false,
    "NonFloorLoadeds": [
        { "Quantity": 12, "Turned": true, "width": 11, "Length": 11, "Height": 11, "Stacking": 1 },
        { "Quantity": 12, "Turned": true, "width": 12, "Length": 12, "Height": 11, "Stacking": 2 }
    ],
    "FloorLoadeds": [],
    "ShippingRemarks": null,
    "MeasurementLFT": null
}

Sample Request — Floor Loaded freights

{
    "Origin": 1,
    "Destination": 30401,
    "PickUpDate": "2016-01-01",
    "LinealFootageKnown": 0,
    "Weight": 11000,
    "IsFloorLoaded": true,
    "FloorLoadeds": [
        { "Quantity": 12, "Measurement": true, "width": 11, "Length": 11, "Height": 11 },
        { "Quantity": 12, "Measurement": true, "width": 12, "Length": 12, "Height": 11 }
    ],
    "NonFloorLoadeds": [],
    "ShippingRemarks": "DA",
    "MeasurementLFT": null
}

Sample Response

200 — an object containing the quote information.

{
    "QuoteId": 2,
    "Origin": 1,
    "PickUpDate": "2017-01-26",
    "Destination": 30301,
    "LinealFootageKnown": 0,
    "Weight": 12,
    "IsFloorLoaded": true,
    "ShippingRemarks": "DA / SAT",
    "LinealFootRate": 695.65,
    "Surcharge": 69.56,
    "Total": 765.21,
    "TotalOriginal": 765.21,
    "Discount": 0,
    "EstimatedDays": 5,
    "Status": "Tendered",
    "DueDateType": 0,
    "Created": "2017-01-11"
}

400{ "error": "An Exception occurred" }

401{ "error": "Authorization has been denied for this request." }

Glossary — Rules and restrictions

AttributeTypeRequiredPossible valueDescription / Error codes
OriginintYes1–8 1 = S. California (90000–93099), 2 = N. California (93100–96199), 3 = Arizona (85000–85799), 4 = Las Vegas (88900–89199), 5 = Chicago (60000–60899), 6 = Northeast IN (46300–46499), 7 = Southeast WI (53100–53499), 8 = Greater Chicago (60900–61199). 999: Invalid Origin value.
PickUpDatestringYes2016-01-01 Date the freight will be picked up. 998: Pickup date must be within the next 30 days. 997: cannot be empty. 996: invalid format.
DestinationintYes30301 ZIP Code of the destination, within a range provided by Sunset Pacific. 995: destination not allowed by the origin.
IsFloorLoadedbool?Nonull / true / false null if lineal foot is known, true if freights are floor loaded, false if non floor loaded (pallets). 994: only true, false or null allowed.
MeasurementLFTint?Nonull, 0, 1, 2 Unit of the lineal foot rate: 0 = lineal feet, 1 = cubic feet, 2 = cubic meters. 993: required (0,1,2) when IsFloorLoaded is not null.
LinealFootageKnownfloatNoMax depends on MeasurementLFT 40 max lineal feet, 2000 cubic feet, 57 cubic meters. 992/991/990/989: range validations.
ShippingRemarksstringNo"DA / MIL" Incidental codes separated by " / ". See incidental codes below.
WeightintYesMax 25000 lbs Total freight weight. 988: must be an integer between 1 and 37000 lbs.
QuantityintYes32 Belongs to both freight arrays. 987: must be an integer greater than 0.
LengthintYes1–500 Value in inches. 986: must be between 1 and 500.
HeightintYes1–108 Value in inches. 985: must be between 1 and 108.
WidthintYes1–100 Value in inches. 984: must be between 1 and 100.
TurnedboolYes if non floor loadedtrue / false Non Floor Loaded only. Default: true. 983: only true or false.
StackingintYes if non floor loaded1, 2, 3 1 = no stacking, 2 = double, 3 = triple (108" max pallet spot height). Default: 1. 982: only 1, 2 or 3.
MeasurementboolYes if floor loadedtrue / false Floor Loaded only. false = inches, true = centimeters. Default: true. 981: only true or false.
NonFloorLoadedsarrayYes if IsFloorLoaded = false 980: at least one item required. 979: must be empty/null when floor loaded. 977: total lineal footage max 40.
FloorLoadedsarrayYes if IsFloorLoaded = true 978: at least one item required. 976: must be empty/null when non floor loaded. 977: total lineal footage max 40.
Incidental codes (for ShippingRemarks): DA – Delivery Appointment, CFS – Container Freight Station pick up, LAX – LAX Airport pick up, MIL – Military/Prison/Camp delivery, CH – Church / place of worship, SAT – Saturday pickup, SCH – School delivery.
Note: when both LinealFootageKnown and dimensions are sent, the system takes the biggest lineal feet.

3. Create Quote By Zip Code

Evolution of Create Quote: create a quote using the origin ZIP code instead of the numeric origin. Use this endpoint when you know the origin ZIP.

Request

POST Production https://api.sunsetpacific.com/api/Quotes/QuoteByZipCode
POST Test https://apisunsetpacificstage.azurewebsites.net/api/Quotes/QuoteByZipCode

Headers and body are identical to Create Quote, except Origin is replaced by OriginZipCode (int) and Destination is a numeric destination id.

Sample Request — Lineal Footage known

{
    "OriginZipCode": 85001,
    "Destination": 1588,
    "PickUpDate": "2016-01-01",
    "LinealFootageKnown": 33.66,
    "Weight": 10000,
    "IsFloorLoaded": null,
    "NonFloorLoadeds": [],
    "FloorLoadeds": [],
    "ShippingRemarks": null,
    "MeasurementLFT": 2
}

Sample Response

200

{
    "QuoteId": 2,
    "Origin": 3,
    "OriginZipCode": 85001,
    "PickUpDate": "2017-01-26",
    "Destination": 1588,
    "Weight": 12,
    "IsFloorLoaded": true,
    "ShippingRemarks": "DA / SAT",
    "LinealFootRate": 695.65,
    "Surcharge": 69.56,
    "Total": 765.21,
    "EstimatedDays": 5,
    "Status": "Tendered",
    "Created": "2017-01-11"
}

400An Exception occurred

401Authorization has been denied for this request.

4. Get Quote

Retrieve an existing quote. id is the integer returned when the quote was created.

Request

GET Production https://api.sunsetpacific.com/api/Quotes/{id}
GET Test https://apisunsetpacificstage.azurewebsites.net/api/Quotes/{id}
LocationParamValue
HeaderAcceptapplication/json
HeaderContent-Typeapplication/json
HeaderAuthorizationBearer <auth_key>

Sample Response

200 — the quote object (same structure as Create Quote).

400 — user info not found / QuoteID {id} has expired / QuoteID {id} was not found / An Exception occurred.

401{ "error": "Authorization has been denied for this request." }

5. Tender

Tender an existing quote.

Request

POST Production https://api.sunsetpacific.com/api/tender
POST Test https://apisunsetpacificstage.azurewebsites.net/api/tender

Headers: Accept: application/json, Content-Type: application/json, Authorization: Bearer <auth_key>.

Sample Request

{
    "quoteId": 1234,
    "shipper": {
        "shipperName": "Alberth Einstein",
        "contactName": "Pablo James",
        "city": "Chino Hills",
        "state": "CA",
        "address": "5378 Buttonwood Court",
        "zip": "91709",
        "email": "any@any.com",
        "phone": "9096067899"
    },
    "finalDestination": {
        "consigneeName": "CEGA Security HQ - Test",
        "contactName": "Tania Lopez",
        "city": "Tustin",
        "state": "NY",
        "address": "1234 Test Ave",
        "zip": "30331",
        "email": "any@any.com",
        "phone": "9096067899"
    },
    "shippingRemarks": "DA / SAT",
    "commodityDescription": "any text",
    "billingReference": "billing reference number: LL0524",
    "pickupInformation": {
        "pickupDate": "2017-01-26",
        "pickUpTimeFrom": 0,
        "pickUpTimeTo": 0
    },
    "numberReference": "My number 198223",
    "deliveryInformation": {
        "dueDateType": 1,
        "dueMustDelivery": "2017-01-26",
        "duePreSetAppt": "2017-01-26",
        "dueDateInit": "2017-01-26",
        "dueDateEnd": "2017-01-26",
        "dueDateEndTime": 0,
        "dueDateEndTimeSelector": 0
    },
    "deliveryReference": "any text"
}

Sample Response

200

{
    "tenderDate": "2018-01-11",
    "infoMessages": [
        { "severity": "ERROR", "message": "string", "diagnostic": "string", "source": "SYSTEM" }
    ]
}

400{ "error": { Error list } }

401{ "error": "Authorization has been denied for this request." }

500ERRORGETQUOTE / ERRORSENDMAIL / ERROR

Rules and restrictions

AttributeTypeRequiredDescription / Error codes
quoteIdintYesID of a quote previously created. 1000: doesn't exist.
shipperNamestringYesSender's name. 1001: empty. 1002: already in use.
shipper.contactNamestringNoContact's name.
shipper.citystringYes1003: City cannot be empty.
shipper.addressstringYes1004: Shipper Address cannot be empty.
shipper.zipstringYes1005: invalid format. 1022: must be between zipinitialcode and zipendcode.
shipper.emailstringNo1006: invalid format.
shipper.phonestringNo1007: invalid format.
consigneeNamestringYesReceiver's consignee. 1008: empty. 1009: already in use.
finalDestination.citystringYes1010: City cannot be empty.
finalDestination.addressstringYes1011: Consignee Address cannot be empty.
finalDestination.zipstringYes1012: invalid format. 1013: must be between zipinitialcode and zipendcode.
finalDestination.emailstringNo1014: invalid format.
finalDestination.phonestringNo1015: invalid format.
pickupDatestringYesIf pickup is today, the value must be 4 hours later. 1016: empty. 1017: cannot be before today.
pickUpTimeFromintYesIndex of the aHours array (24-hour). 1018: invalid value. 1019: 4-hour window required.
pickUpTimeTointYesIndex of the aHours array. 1020: invalid value. 1021: must be greater than pickUpTimeFrom.
dueDateTypeintYes0 NoDueDate, 1 NoAppointment, 2 DueDate, 3 DeliveryWindow, 4 PreSetAppointment. 1023: invalid.
dueMustDeliverystringCond.Required if dueDateType = DueDate. 1025: invalid.
duePreSetApptstringCond.Required if dueDateType = PreSetAppointment. 1026: invalid.
dueDateInitstringCond.Required if dueDateType = DeliveryWindow. 1027: invalid.
dueDateEndstringCond.Required if dueDateType = DeliveryWindow. 1028: invalid.
dueDateEndTimeintCond.Index of aHours; required when dueDateType = PreSetAppointment. 1029: invalid.
commodityDescriptionstringYes1016: cannot be empty.
Array of hours (aHours): a numeric index represents time slots. Index 0 = 00:00 (midnight) and each increment of 1 adds 30 minutes (1 = 00:30, 2 = 01:00, … up to 23:30). Use the index number to specify a time.

6. Upload Tender File

Upload documents for a tendered quote.

Request

POST Production https://api.sunsetpacific.com/api/tender/{quoteId}/UploadFile
POST Test https://apisunsetpacificstage.azurewebsites.net/api/tender/{quoteId}/UploadFile
LocationParamValue
HeaderAcceptmultipart/form-data
HeaderContent-Typemultipart/form-data
HeaderAuthorizationBearer <auth_key>

Send the file(s) as form-data in the request body. The response confirms the upload of the documents for the given quoteId.

7. Tracking

Track an existing order number. orderNumber is the integer generated with the order.

Request

GET Production https://api.sunsetpacific.com/api/Tracking/{orderNumber}
GET Test https://apisunsetpacificstage.azurewebsites.net/api/Tracking/{orderNumber}

Headers: Accept: application/json, Content-Type: application/json, Authorization: Bearer <auth_key>.

Sample Response

200

{
    "OrderNumber": "256894",
    "Status": "Completed",
    "GPS": "",
    "DateTime": "01-20-2019 07:06:13",
    "Location": "DENVER,CO",
    "TrailerType": "UNKNOWN",
    "Move": "270705",
    "FinETA": "01-28-19 14:00",
    "CurrentSegment": {
        "Tractor": "UNKNOWN",
        "Carrier": "LOGISTIC",
        "Driver 1": "UNKNOWN",
        "Trailer 1": "UNKNOWN",
        "SegMls": "276"
    },
    "MovementHistory": [
        { "Dispatcher": "Rita", "BillToName": "NUTRI-BON", "City": "RIVERSIDE", "State": "CA", "OutStatus": "Completed", "ArrivalDate": "01-23-19 01:00", "Carrier": "LOGISTIC", "CompanyName": "NUTRI-BON" }
    ],
    "Shipper": { "ShipperName": "LIDO CONNECTION/EXOTIC", "City": "CHINO", "State": "CA" },
    "Consignee": { "ConsigneeName": "KEHE DISTRIBUTORS LLC", "City": "AURORA", "State": "CO" },
    "TotalPieces": "10",
    "TotalWeight": "7,5000",
    "TotalCharge": "5,718.58",
    "TotalLHM": "5,413.58",
    "TotalAC": "305.00"
}

400ProNumber does not exist, please enter another

401Authorization has been denied for this request.

500Something went wrong. Please try again later.

8. Document

Retrieve the documents of an order. orderNumber is the integer generated with the order.

Request

GET Production https://api.sunsetpacific.com/api/Document/{orderNumber}
GET Test https://apisunsetpacificstage.azurewebsites.net/api/Document/{orderNumber}

Headers: Accept: application/json, Content-Type: application/json, Authorization: Bearer <auth_key>.

Sample Response

200

{
    "OrderNumber": "256894",
    "Status": "Completed",
    "Documents": [
        { "Name": "Document01", "Type": "pdf", "Document": "VBORw0KGgoAAAANSUhEUT3ZOBKHi==" },
        { "Name": "Document02", "Type": "pdf", "Document": "VBORw0KGgoAAAANSUhEUT3ZOBKHi==" }
    ]
}

400An Exception occurred

401Authorization has been denied for this request.

404The order number does not exist / Order number not completed

AttributeTypeDescription
OrderNumberintThe ID of an order previously created.
StatusstringTracking status (e.g. Completed).
NamestringName of the document.
TypestringType of document (e.g. "pdf").
DocumentbytesReturns a base64 string of bytes.

9. Tracking by ProNumber

Track an order by ProNumber, an integer provided by Sunset Pacific when the order is generated.

Request

GET Production https://api.sunsetpacific.com/api/TrackingByPRONumber/{proNumber}
GET Test https://apisunsetpacificstage.azurewebsites.net/api/TrackingByPRONumber/{proNumber}

Headers: Accept: application/json, Content-Type: application/json, Authorization: Bearer <auth_key>.

Note: the first time a proNumber is sent the API responds with Status: Pending. Wait 5 minutes before making a second request.

Sample Response — Pending

{
    "OrderNumber": 375914,
    "Status": "Pending",
    "DateTime": "0001-01-01T00:00:00",
    "Location": null,
    "FinETA": "0001-01-01T00:00:00",
    "Shipper": null,
    "Consignee": null,
    "TotalPieces": 0,
    "TotalWeight": 0,
    "TotalMiles": 0
}

Sample Response — In Transit

{
    "OrderNumber": 377341,
    "Status": "In Transit",
    "DateTime": "2022-12-29T07:00:25",
    "Location": "FULTONVILLE,NY",
    "FinETA": "2022-12-28T14:00:00",
    "Shipper": { "ShipperName": "CAL CARTAGE", "City": "City of Industry", "State": "CA" },
    "Consignee": { "ConsigneeName": "ALB", "City": "Castleton On Hudson", "State": "NY" },
    "TotalPieces": 0,
    "TotalWeight": 0,
    "TotalMiles": 0
}

400ProNumber does not exist, please enter another

401Authorization has been denied for this request.

500Something went wrong. Please try again later.

10. Document by ProNumber

Retrieve the documents of an order by ProNumber.

Request

GET Production https://api.sunsetpacific.com/api/DocumentByPRONumber/{proNumber}
GET Test https://apisunsetpacificstage.azurewebsites.net/api/DocumentByPRONumber/{proNumber}

Headers: Accept: application/json, Content-Type: application/json, Authorization: Bearer <auth_key>.

Sample Response

200

{
    "OrderNumber": "256894",
    "Status": "Completed",
    "Documents": [
        { "Name": "Document01", "Type": "pdf", "Document": "VBORw0KGgoAAAANSUhEUT3ZOBKHi==" },
        { "Name": "Document02", "Type": "pdf", "Document": "VBORw0KGgoAAAANSUhEUT3ZOBKHi==" }
    ]
}

400Invalid proNumber

401Authorization has been denied for this request.

500Something went wrong. Please try again later.

11. Tender — 24-hour pickup date format

Version 2 of the tender endpoint. The pickup time fields use a 24-hour string format instead of the aHours index.

Request

POST Production https://api.sunsetpacific.com/api/v2/tender
POST Test https://apisunsetpacificstage.azurewebsites.net/api/v2/tender

Headers: Accept: application/json, Content-Type: application/json, Authorization: Bearer <auth_key>.

Sample Request

{
    "quoteId": 1234,
    "shipper": {
        "shipperName": "Alberth Einstein",
        "city": "Chino Hills",
        "state": "CA",
        "address": "5378 Buttonwood Court",
        "zip": "91709",
        "email": "any@any.com",
        "phone": "9096067899"
    },
    "finalDestination": {
        "consigneeName": "CEGA Security HQ - Test",
        "city": "Tustin",
        "state": "NY",
        "address": "1234 Test Ave",
        "zip": "30331",
        "email": "any@any.com",
        "phone": "9096067899"
    },
    "shippingRemarks": "DA / SAT",
    "commodityDescription": "any text",
    "billingReference": "billing reference number: LL0524",
    "pickupInformation": {
        "pickupDate": "2017-01-26",
        "pickUpTimeFrom": "00:00",
        "pickUpTimeTo": "13:00"
    },
    "numberReference": "My number 198223",
    "deliveryInformation": {
        "dueDateType": 1,
        "dueMustDelivery": "2017-01-26",
        "duePreSetAppt": "2017-01-26",
        "dueDateInit": "2017-01-26",
        "dueDateEnd": "2017-01-26",
        "dueDateEndTime": 0,
        "dueDateEndTimeSelector": 0
    },
    "deliveryReference": "any text"
}

Sample Response

200

{
    "tenderDate": "2018-01-11",
    "infoMessages": [
        { "severity": "ERROR", "message": "string", "diagnostic": "string", "source": "SYSTEM" }
    ]
}

400{ "error": { Error list } }

401Authorization has been denied for this request.

500ERRORGETQUOTE / ERRORSENDMAIL / ERROR

Difference from v1: pickUpTimeFrom and pickUpTimeTo are strings in 24-hour format (e.g. "09:00"). A minimum 4-hour difference between them is required. 1018/1020: must be 24-hour format (00:00–23:59). 1019: 4-hour difference required. 1021: To must be greater than From.

Conventions & Status Codes

  • Status — HTTP status code of the response.
  • All possible responses are listed under each method.

All status codes are standard HTTP status codes:

RangeMeaning
2XXSuccess of some kind.
4XXError occurred on the client's part.
5XXError occurred on the server's part.

Version History

VersionDateAuthorDescription
1.024-Mar-2017Angel GuemezInitial
1.109-May-2017Angel GuemezAdded link to the development site
1.211-Jul-2017Angel GuemezUpdated "IsFloorLoaded" / URL production
2.001-Feb-2018Angel GuemezTender documentation
2.128-Aug-2018Hebert PeñaUpdate URL production and test
3.022-Feb-2019Jesus GutierrezTracking order number information
3.117-Oct-2019Hebert PeñaFix with DueDateType
3.205-Oct-2022Jesus GutierrezTracking by ProNumber and Document by ProNumber
3.325-Jan-2024Xaviero CerveraAdded Chicago region, incidental codes and instructions
4.013-Mar-2025Abraham SolísQuoteByZipCode endpoint added
4.107-Apr-2025Abraham SolísVersion 2 of Tender 24-hour pickup date format
4.230-Apr-2025Abraham SolísContent-types of some endpoints corrected
4.325-Jul-2025Abraham SolísaHours array added for the tender