ShipStation Interaction / Automation
Async Python client for ShipStation v1 and v2 APIs with an emphasis on typing.
Install
pip
pip install AsyncShipStation
Manual
git clone git@github.com:sudoDeVinci/AsyncShipStation.git
cd AsyncShipStation
pip install -r requirements.txt
Quick Start
Create a connection, then pass it to the portal you want to use.
import asyncio
from AsyncShipStation import ShipStationClient, ShipmentPortal
async def main() -> None:
connection = await ShipStationClient.configure(
v2_key="your_v2_api_key",
v1_key="your_v1_api_key",
v1_secret="your_v1_secret",
)
async with ShipStationClient.scoped_client(connection=connection, version="v2"):
status, shipments = await ShipmentPortal.list(
connection,
page_size=10,
page=1,
)
print(status, shipments)
if __name__ == "__main__":
asyncio.run(main())
Client Lifecycle
Use the async context manager
Use scoped_client() when you want the connection lifecycle handled for you.
import asyncio
import os
from dotenv import load_dotenv
from AsyncShipStation import ShipStationClient, ShipmentPortal
load_dotenv()
V2_API_KEY: str | None = os.getenv("SHIP_STATION_V2")
V1_API_KEY: str | None = os.getenv("SHIP_STATION_V1")
V1_SECRET: str | None = os.getenv("SHIP_STATION_SECRET")
async def main() -> None:
connection = await ShipStationClient.configure(
v2_key=V2_API_KEY or "",
v1_key=V1_API_KEY,
v1_secret=V1_SECRET,
)
async with ShipStationClient.scoped_client(connection=connection, version="v2"):
status, shipments = await ShipmentPortal.list(connection, page_size=10, page=1)
print(status, shipments)
if __name__ == "__main__":
asyncio.run(main())
Start and close explicitly
Use start() and close() if you want to manage the lifecycle yourself.
import asyncio
import os
from dotenv import load_dotenv
from AsyncShipStation import ShipStationClient, ShipmentPortal
load_dotenv()
V2_API_KEY: str | None = os.getenv("SHIP_STATION_V2")
V1_API_KEY: str | None = os.getenv("SHIP_STATION_V1")
V1_SECRET: str | None = os.getenv("SHIP_STATION_SECRET")
async def main() -> None:
connection = await ShipStationClient.configure(
v2_key=V2_API_KEY or "",
v1_key=V1_API_KEY,
v1_secret=V1_SECRET,
)
await ShipStationClient.start(connection=connection, version="v2")
try:
status, shipments = await ShipmentPortal.list(connection, page_size=10, page=1)
print(status, shipments)
finally:
await ShipStationClient.close(connection=connection, version="v2")
if __name__ == "__main__":
asyncio.run(main())
Concurrent Requests
A single connection can be shared across concurrent requests.
import asyncio
from AsyncShipStation import (
BatchPortal,
LabelPortal,
ShipmentPortal,
ShipStationClient,
)
async def main() -> None:
connection = await ShipStationClient.configure(
v2_key="your_v2_api_key",
v1_key="your_v1_api_key",
v1_secret="your_v1_secret",
)
async with ShipStationClient.scoped_client(connection=connection, version="v2"):
results = await asyncio.gather(
ShipmentPortal.list(connection, page_size=10, page=1),
BatchPortal.list(connection, page_size=10, page=1),
LabelPortal.list(connection, page_size=10, page=1),
)
for status, data in results:
if status in (200, 201, 207):
print(f"Success :: {data}")
else:
print(f"Error :: {data}")
if __name__ == "__main__":
asyncio.run(main())
Connection Lookup
If you need to retrieve a connection from the pool later, use connection.pool_key.
import asyncio
from AsyncShipStation import ShipStationClient, ShipmentPortal
async def main() -> None:
connection = await ShipStationClient.configure(
v2_key="your_v2_api_key",
v1_key="your_v1_api_key",
v1_secret="your_v1_secret",
)
async with ShipStationClient.scoped_client(
connection_hash=connection.pool_key,
version="v2",
) as scoped_connection:
status, shipments = await ShipmentPortal.list(
scoped_connection,
page_size=10,
page=1,
)
print(status, shipments)
if __name__ == "__main__":
asyncio.run(main())
Rate Limiting
Accounts that send too many requests in quick succession will receive a 429 Too Many Requests response with a Retry-After header that tells you how long to wait.
ShipStation bulk operation endpoints count as a single request.
Endpoints
/batches
Process labels in bulk and receive labels and customs forms in bulk responses.
/carriers
Retrieve details about the carriers connected to your account, including carrier IDs, service IDs, advanced options, and package types.
/fulfillments
Manage fulfillments that represent completed shipments.
/inventory
Manage inventory, adjust quantities, and work with warehouses and locations.
/labels
Purchase and print shipping labels, create return labels, void labels, and retrieve label details.
/manifests
Retrieve and work with shipment manifests.
/rates (v2)
Calculate and estimate shipping rates across multiple carriers.
/shipments (v2)
Create, retrieve, and manage shipments.
/tags (v2)
Manage tags for organizing shipments and orders.
/warehouses (v2)
Retrieve warehouse information, including shipment origin addresses.
Metadata
Release files for AsyncShipStation 0.2.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asyncshipstation-0.2.0.8.tar.gz | 49.8 kB | Without provenance | Details for asyncshipstation-0.2.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asyncshipstation-0.2.0.8-py3-none-any.whl | Python 3 | none | any | Details for asyncshipstation-0.2.0.8-py3-none-any.whl |
Total release size: 155.3 kB
Release files / asyncshipstation-0.2.0.8.tar.gz
| Download URL | asyncshipstation-0.2.0.8.tar.gz |
|---|---|
| Size | 49.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
414cd32909ad24e4e1c86eb69eaa8bdc9968640db2733695dc21b0aaa38f0502
|
|
BLAKE2b-256 checksum How to use checksums |
cb5090655905c2d3c119c5d0331c5cd97c1511a03c2e8d93fdac420be87c6c5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / asyncshipstation-0.2.0.8-py3-none-any.whl
| Download URL | asyncshipstation-0.2.0.8-py3-none-any.whl |
|---|---|
| Size | 105.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
752b4149881bcae3e00adf28b4d724c4b7ed11e1ae60d832a3f10122f58f9493
|
|
BLAKE2b-256 checksum How to use checksums |
fef85419779afc1ec3fd9ec05cf1a82e01656caef951681a06698c7a204fc2ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for AsyncShipStation 0.2.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.