Skip to content

Stallion Express API (3.0)

Access to the sandbox environment can be provided upon request. (Not all rates are available in the Sandbox environment). API token can be found under "Account Settings > API Token".

Languages
Servers
Mock server
https://stallionexpress.redocly.app/_mock/stallionexpress-v3
Production server (uses live data)
https://ship.stallionexpress.ca/api/v3
Sandbox server (uses test data)
https://sandbox.stallionexpress.ca/api/v3
Operations
Operations

Request

Validates shipment details and returns all available rates.

Security
bearerAuth
Bodyapplication/jsonrequired

Shipment details

namestring<= 40 charactersrequired
Example: "Pramod Thomson"
address1string<= 35 charactersrequired
Example: "30 Clearview Dr"
address2string or null<= 35 characters
Example: "Lot 2"
citystring<= 35 charactersrequired
Example: "Rock Springs"
province_codestring= 2 charactersrequired
Example: "WY"
postal_codestring<= 10 charactersrequired
Example: "82901"
country_codestring= 2 charactersrequired
Example: "US"
emailstring
Example: "test@stallionexpress.ca"
phonestring
Example: 11231231234
weight_unitstring(WeightUnit)required
Enum"lbs""kg""g""oz"
weightnumberrequired
Example: 0.6
lengthnumber
Example: 9
widthnumber
Example: 12
heightnumber
Example: 1
size_unitstring(SizeUnit)required
Enum"cm""in"
package_contentsstringrequired
Example: "Two pair of socks"
valuenumberrequired
Example: 10
currencystring(Currency)required
Enum"CAD""USD""EUR""AUD""GBP"
package_typePackageType (string) or PackageCode (string)required
One of:
string(PackageType)
Enum"Parcel""Legal Flat Rate Envelope""Flat Rate PAdded Envelope""Small Flat Rate Box""Medium Flat Rate Box 1""Medium Flat Rate Box 2""Large Flat Rate Box""Regional Rate Box A1""Regional Rate Box A2""Regional Rate Box B1"
postage_typesArray of PostageType (string) or PostageCode (string) or null

Limit the results to specific postage types

Example: []
signature_confirmationboolean or null
Example: true
insuredboolean or null
Example: true
regionstring or null(RegionCode)

Default account region. The region where the shipment will be delivered to Stallion. Ability to change this is needs to be enabled by Stallion.

Enum"ON""BC""QC"
Example: null
curl -i -X POST \
  https://stallionexpress.redocly.app/_mock/stallionexpress-v3/rates \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Pramod Thomson",
    "address1": "30 Clearview Dr",
    "address2": "Lot 2",
    "city": "Rock Springs",
    "province_code": "WY",
    "postal_code": "82901",
    "country_code": "US",
    "email": "test@stallionexpress.ca",
    "phone": 11231231234,
    "weight_unit": "lbs",
    "weight": 0.6,
    "length": 9,
    "width": 12,
    "height": 1,
    "size_unit": "cm",
    "package_contents": "Two pair of socks",
    "value": 10,
    "currency": "CAD",
    "package_type": "Parcel",
    "postage_types": [],
    "signature_confirmation": true,
    "insured": true,
    "region": null
  }'

Responses

Successful operation

Bodyapplication/json
successboolean
Example: true
ratesArray of objects(Rate)
Response
application/json
{ "success": true, "rates": [ { … } ] }

Request

Get the list of paginated shipments by different search parameters.

Security
bearerAuth
Query
from_datestring

return shipments with a created_at on or after the given date

to_datestring

return shipments with a created_at greater than or equal to the given date.

ship_codestring

search by ship code

to_namestring

search by recipient

tracking_codestring

search by tracking code

order_idstring

search by order id

batch_idstring

search by batch id

closeout_idstring

search by closeout id

statusArray of strings

search by shipment statuses

Items Enum"unpaid""postage-expired""pending""incomplete""ready""received""processing""in-transit""delivered""exception"
limitinteger

number of records to return per page

pageinteger

the current page number of the response

curl -i -X GET \
  'https://stallionexpress.redocly.app/_mock/stallionexpress-v3/shipments?from_date=string&to_date=string&ship_code=string&to_name=string&tracking_code=string&order_id=string&batch_id=string&closeout_id=string&status=unpaid&limit=0&page=0' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/json
dataArray of objects(ShipmentsResponse_data)
Example: [null]
linksobject(ShipmentsResponse_links)
Example: null
metaobject(ShipmentsResponse_meta)
Example: null
Response
application/json
{ "data": [ null ], "links": null, "meta": null }

Request

Create a shipment and return the postage label.

Security
bearerAuth
Bodyapplication/json

The shipment object that needs to be created. Note that size fields are required for any shipments with the package type of Parcel.

namestring<= 40 charactersrequired
Example: "Pramod Thomson"
address1string<= 35 charactersrequired
Example: "30 Clearview Dr"
address2string<= 35 characters
Example: "Lot 2"
citystring<= 35 charactersrequired
Example: "Rock Springs"
province_codestring= 2 charactersrequired
Example: "WY"
postal_codestring<= 10 charactersrequired
Example: "82901"
country_codestring= 2 charactersrequired
Example: "US"
emailstring
Example: "test@stallionexpress.ca"
phonestring
Example: 11231231234
order_idstring or null
Example: "1234-1233"
weight_unitstring(WeightUnit)required
Enum"lbs""kg""g""oz"
weightnumberrequired
Example: 0.6
lengthnumber
Example: 9
widthnumber
Example: 12
heightnumber
Example: 1
size_unitstring(SizeUnit)required
Enum"cm""in"
package_contentsstring<= 255 charactersrequired
Example: "Two pair of socks"
valuenumberrequired
Example: 10
currencystring(Currency)required
Enum"CAD""USD""EUR""AUD""GBP"
package_typePackageType (string) or PackageCode (string)required
One of:
string(PackageType)
Enum"Parcel""Legal Flat Rate Envelope""Flat Rate PAdded Envelope""Small Flat Rate Box""Medium Flat Rate Box 1""Medium Flat Rate Box 2""Large Flat Rate Box""Regional Rate Box A1""Regional Rate Box A2""Regional Rate Box B1"
signature_confirmationboolean or null

Default false.

Example: false
postage_typePostageType (string) or PostageCode (string)required
One of:
string(PostageType)
Enum"USPS First Class Mail""USPS Priority Mail""USPS Priority Mail Express""USPS Parcel Select Ground""USPS Media Mail""USPS Library Mail""USPS Express Mail International""USPS Priority Mail International""USPS First Class Mail International""FedEx Ground"
label_formatstring

Default pdf. Set the format of the returned label.

Default "pdf"
Enum"pdf""zpl""png"
is_fbaboolean or null

Default false. Set to true to create a Stallion FBA label.

Default false
Example: false
insuredboolean or null

Set to true to apply Stallion Protection for tracked shipments only.

Example: true
customs_linesArray of objects or null(ShipmentRequest_customs_lines)

Optional field. Can be used to explicitly set customs declaration for international shipments. Leave empty if unsure.

Example: [null]
regionstring or null(RegionCode)

Default account region. The region where the shipment will be delivered to Stallion. Ability to change this is needs to be enabled by Stallion.

Enum"ON""BC""QC"
Example: null
curl -i -X POST \
  https://stallionexpress.redocly.app/_mock/stallionexpress-v3/shipments \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Pramod Thomson",
    "address1": "30 Clearview Dr",
    "address2": "Lot 2",
    "city": "Rock Springs",
    "province_code": "WY",
    "postal_code": "82901",
    "country_code": "US",
    "email": "test@stallionexpress.ca",
    "phone": 11231231234,
    "order_id": "1234-1233",
    "weight_unit": "lbs",
    "weight": 0.6,
    "length": 9,
    "width": 12,
    "height": 1,
    "size_unit": "cm",
    "package_contents": "Two pair of socks",
    "value": 10,
    "currency": "CAD",
    "package_type": "Parcel",
    "signature_confirmation": false,
    "postage_type": "USPS First Class Mail",
    "label_format": "pdf",
    "is_fba": false,
    "insured": true,
    "customs_lines": [
      null
    ],
    "region": null
  }'

Responses

Successful operation

Bodyapplication/json
successboolean
labelstring

Base 64 encoded label.

Example: "base64_label"
tracking_codestring
Example: "9400111969000940000011"
messagestring
Example: "Shipment successfully completed"
shipmentobject(ShipmentResponse_shipment)
Example: null
rateobject(Rate)
Response
application/json
{ "success": true, "label": "base64_label", "tracking_code": "9400111969000940000011", "message": "Shipment successfully completed", "shipment": null, "rate": { "postage_type": "USPS First Class Mail", "package_type": "Parcel", "trackable": true, "base_rate": 10, "add_ons": [ … ], "rate": 10, "tax": 0, "total": 0, "currency": "CAD", "delivery_days": "2" } }

Request

Create the return label for a previous shipment.

Security
bearerAuth
Bodyapplication/json

Send one or all of: ship_code, tracking_code, and order_id as a post parameter to create the return label for a previous shipment.

ship_codestringrequired
Example: "210907WY78"
tracking_codestringrequired
Example: "940002312332"
order_idstringrequired
Example: "40011"
curl -i -X POST \
  https://stallionexpress.redocly.app/_mock/stallionexpress-v3/shipments/return-label \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "ship_code": "210907WY78",
    "tracking_code": "940002312332",
    "order_id": "40011"
  }'

Responses

Successful operation

Bodyapplication/json
successboolean
labelstring

Base 64 encoded label.

Example: "base64_label"
tracking_codestring
Example: "9400111969000940000011"
messagestring
Example: "Shipment successfully completed"
shipmentobject(ShipmentResponse_shipment)
Example: null
rateobject(Rate)
Response
application/json
{ "success": true, "label": "base64_label", "tracking_code": "9400111969000940000011", "message": "Shipment successfully completed", "shipment": null, "rate": { "postage_type": "USPS First Class Mail", "package_type": "Parcel", "trackable": true, "base_rate": 10, "add_ons": [ … ], "rate": 10, "tax": 0, "total": 0, "currency": "CAD", "delivery_days": "2" } }

Request

Fetch a shipment tracking details by different search parameters

Security
bearerAuth
Query
ship_codestring

The ship_code or identifier of a shipment.

tracking_codestring

The tracking number of a shipment.

order_idstring

The order id of a shipment.

curl -i -X GET \
  'https://stallionexpress.redocly.app/_mock/stallionexpress-v3/track?ship_code=string&tracking_code=string&order_id=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/json
successboolean
Example: true
statusstring(ShipmentStatus)
Enum"Postage Expired""Pending""Incomplete""Ready""Received""Processing""In Transit""Delivered""Exception""Void Requested"
eventsArray of objects(TrackResponse_events)
Example: [null]
detailsobject
Response
application/json
{ "success": true, "status": "Postage Expired", "events": [ null ], "details": { "ship_code": 2012121234, "destination": "Toronto ON, CA", "tracking": "123123123123123123", "url": "https://carrier.com/track/9400111969000940000011", "carrier_phone": "12312341234" } }

Request

Get a shipment

Security
bearerAuth
Path
ship_codestringrequired

The ship_code of a shipment.

curl -i -X GET \
  'https://stallionexpress.redocly.app/_mock/stallionexpress-v3/shipments/{ship_code}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/json
successboolean
labelstring

Base 64 encoded label.

Example: "base64_label"
tracking_codestring
Example: "9400111969000940000011"
messagestring
Example: "Shipment successfully completed"
shipmentobject(ShipmentResponse_shipment)
Example: null
rateobject(Rate)
Response
application/json
{ "success": true, "label": "base64_label", "tracking_code": "9400111969000940000011", "message": "Shipment successfully completed", "shipment": null, "rate": { "postage_type": "USPS First Class Mail", "package_type": "Parcel", "trackable": true, "base_rate": 10, "add_ons": [ … ], "rate": 10, "tax": 0, "total": 0, "currency": "CAD", "delivery_days": "2" } }

Request

Requests a void for a shipment with the provided id.

Security
bearerAuth
Path
ship_codestringrequired

The ship_code of a shipment.

curl -i -X GET \
  'https://stallionexpress.redocly.app/_mock/stallionexpress-v3/shipments/{ship_code}/void' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/json
successboolean
Example: true
messageboolean
Example: false
Response
application/json
{ "success": true, "message": false }
Operations