Stallion Express API (3.0)

Download OpenAPI specification:Download

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".

Postage Types

Get Postage Types

Get a list of all available postage types

SecuritybearerAuth
Responses
200

Successful operation

401

Unauthenticated

500

Internal error

get/postage-types
Request samples
Response samples
application/json
{
  • "success": true,
  • "postage_types": [
    ]
}

Shipments

Get Rates

Validates shipment details and returns all available rates.

SecuritybearerAuth
Request
Request Body schema: application/json
required

Shipment details

name
required
string <= 40 characters
address1
required
string <= 35 characters
address2
string or null <= 35 characters
city
required
string <= 35 characters
province_code
required
string = 2 characters
postal_code
required
string <= 10 characters
country_code
required
string = 2 characters
email
string
phone
string
weight_unit
required
string (WeightUnit)
Enum: "lbs" "kg" "g" "oz"
weight
required
number
length
number
width
number
height
number
size_unit
required
string (SizeUnit)
Enum: "cm" "in"
package_contents
required
string
value
required
number
currency
required
string (Currency)
Enum: "CAD" "USD" "EUR" "AUD" "GBP"
required
PackageType (string) or PackageCode (string)
Array of PostageType (string) or PostageCode (string) or null

Limit the results to specific postage types

signature_confirmation
boolean or null
insured
boolean or null
region
string 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"
Responses
200

Successful operation

401

Unauthenticated

422

Validation Error

500

Internal error

post/rates
Request samples
application/json
{
  • "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
}
Response samples
application/json
{
  • "success": true,
  • "rates": [
    ]
}

Get Shipments

Get the list of paginated shipments by different search parameters.

SecuritybearerAuth
Request
query Parameters
from_date
string

return shipments with a created_at on or after the given date

to_date
string

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

ship_code
string

search by ship code

to_name
string

search by recipient

tracking_code
string

search by tracking code

order_id
string

search by order id

batch_id
string

search by batch id

closeout_id
string

search by closeout id

status
Array of strings

search by shipment statuses

Items Enum: "unpaid" "postage-expired" "pending" "incomplete" "ready" "received" "processing" "in-transit" "delivered" "exception" "void-requested" "voided" "complete"
limit
integer

number of records to return per page

page
integer

the current page number of the response

Responses
200

Successful operation

401

Unauthenticated

422

Validation Error

500

Internal error

get/shipments
Request samples
Response samples
application/json
{
  • "data": [
    ],
  • "links": null,
  • "meta": null
}

Create Shipment

Create a shipment and return the postage label.

SecuritybearerAuth
Request
Request Body schema: application/json

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

name
required
string <= 40 characters
address1
required
string <= 35 characters
address2
string <= 35 characters
city
required
string <= 35 characters
province_code
required
string = 2 characters
postal_code
required
string <= 10 characters
country_code
required
string = 2 characters
email
string
phone
string
order_id
string or null
weight_unit
required
string (WeightUnit)
Enum: "lbs" "kg" "g" "oz"
weight
required
number
length
number
width
number
height
number
size_unit
required
string (SizeUnit)
Enum: "cm" "in"
package_contents
required
string <= 255 characters
value
required
number
currency
required
string (Currency)
Enum: "CAD" "USD" "EUR" "AUD" "GBP"
required
PackageType (string) or PackageCode (string)
signature_confirmation
boolean or null

Default false.

required
PostageType (string) or PostageCode (string)
label_format
string
Default: "pdf"

Default pdf. Set the format of the returned label.

Enum: "pdf" "zpl" "png"
is_fba
boolean or null
Default: false

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

insured
boolean or null

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

Array of objects or null (ShipmentRequest_customs_lines)

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

region
string 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"
Responses
200

Successful operation

401

Unauthenticated

422

Validation Error

500

Internal error

post/shipments
Request samples
application/json
{
  • "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": [
    ],
  • "region": null
}
Response samples
application/json
{
  • "success": true,
  • "label": "base64_label",
  • "tracking_code": "9400111969000940000011",
  • "message": "Shipment successfully completed",
  • "shipment": null,
  • "rate": {
    }
}

Create Return Label

Create the return label for a previous shipment.

SecuritybearerAuth
Request
Request Body schema: application/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_code
required
string
tracking_code
required
string
order_id
required
string
Responses
200

Successful operation

401

Unauthenticated

422

Validation Error

500

Internal error

post/shipments/return-label
Request samples
application/json
{
  • "ship_code": "210907WY78",
  • "tracking_code": "940002312332",
  • "order_id": "40011"
}
Response samples
application/json
{
  • "success": true,
  • "label": "base64_label",
  • "tracking_code": "9400111969000940000011",
  • "message": "Shipment successfully completed",
  • "shipment": null,
  • "rate": {
    }
}

Track a Shipment

Fetch a shipment tracking details by different search parameters

SecuritybearerAuth
Request
query Parameters
ship_code
string

The ship_code or identifier of a shipment.

tracking_code
string

The tracking number of a shipment.

order_id
string

The order id of a shipment.

Responses
200

Successful operation

401

Unauthenticated

422

Validation Error

500

Internal error

get/track
Request samples
Response samples
application/json
{
  • "success": true,
  • "status": "Postage Expired",
  • "events": [
    ],
  • "details": {}
}

Get Shipment

Get a shipment

SecuritybearerAuth
Request
path Parameters
ship_code
required
string

The ship_code of a shipment.

Responses
200

Successful operation

401

Unauthenticated

404

Not Found

500

Internal error

get/shipments/{ship_code}
Request samples
Response samples
application/json
{
  • "success": true,
  • "label": "base64_label",
  • "tracking_code": "9400111969000940000011",
  • "message": "Shipment successfully completed",
  • "shipment": null,
  • "rate": {
    }
}

Void a Shipment

Requests a void for a shipment with the provided id.

SecuritybearerAuth
Request
path Parameters
ship_code
required
string

The ship_code of a shipment.

Responses
200

Successful operation

401

Unauthenticated

404

Not Found

422

Validation Error

500

Internal error

get/shipments/{ship_code}/void
Request samples
Response samples
application/json
{
  • "success": true,
  • "message": false
}

Batches

Create a batch

Creates a new batch to be used when creating shipments.

SecuritybearerAuth
Responses
200

Successful operation

401

Unauthenticated

500

Internal error

post/batches
Request samples
Response samples
application/json
{
  • "success": true,
  • "batch_id": "18179823"
}

Locations

Get Locations

Gets a list of all current Stallion Express locations.

SecuritybearerAuth
Responses
200

Successful operation

401

Unauthenticated

500

Internal error

get/locations
Request samples
Response samples
application/json
{
  • "success": true,
  • "locations": [
    ]
}

Credits

Get Credits

Return the current account balance

SecuritybearerAuth
Responses
200

successful operation

401

Unauthenticated

500

Internal error

get/credits
Request samples
Response samples
application/json
{
  • "success": true,
  • "amount": "0.00"
}

Add Credits

Add credits using hte account's default credit card

SecuritybearerAuth
Request
Request Body schema: application/json
required

Amount of credits to add

amount
integer <int64>
Responses
200

Successful operation

401

Unauthenticated

422

Validation Error

500

Internal error

post/credits
Request samples
application/json
{
  • "amount": 100
}
Response samples
application/json
{
  • "success": true,
  • "amount": "0.00"
}