Stallion Express API (3.0)

Download OpenAPI specification:Download

Shipments

Get Rates

Validates shipment details and returns all available rates.

SecuritybearerAuth
Request
Request Body schema: application/json

Shipment details

name
required
string
address1
required
string
address2
string
city
required
string
province_code
required
string
postal_code
required
string
country_code
required
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"
required
PackageType (string) or PackageCode (string)
signature_confirmation
boolean
purchase_label
boolean
insured
boolean
region
string (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: "BC" "ON" "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",
  • "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": true,
  • "purchase_label": true,
  • "insured": true,
  • "region": "BC"
}
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
address1
required
string
address2
string
city
required
string
province_code
required
string
postal_code
required
string
country_code
required
string
order_id
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"
required
PackageType (string) or PackageCode (string)
signature_confirmation
boolean

Default false.

required
PostageType (string) or PostageCode (string)
label_format
string

Default pdf. Set the format of the returned label.

Enum: "pdf" "zpl" "png"
purchase_label
boolean

Default true. Set to false to not generate a shipping label but to manifest a third party label with Stallion.

is_fba
boolean

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

insured
boolean

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

Array of objects (ShipmentRequest_customs_lines)

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

region
string (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: "BC" "ON" "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",
  • "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",
  • "purchase_label": true,
  • "is_fba": false,
  • "insured": true,
  • "customs_lines": [
    ],
  • "region": "BC"
}
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": false,
  • "events": [
    ]
}

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

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