Skip to main content

shippingboapy

PyPI version Python versions License: MIT

An async Python SDK for the ShippingBo API.

shippingboapy is a faithful, low-level wrapper around the ShippingBo REST API. The SDK structure mirrors the actual API endpoints rather than introducing ergonomic abstractions that hide them.

⚠️ Alpha: this SDK is in early development. The public API may change before v1.0.

Installation

pip install shippingboapy

Requirements

  • Python 3.10+

Usage

Initialization

If you already have an access token and refresh token:

from shippingboapy import Client

client = Client(
    access_token="your_access_token",
    refresh_token="your_refresh_token",
    app_id="your_app_id",
    api_version="your_api_version",
    client_id="your_client_id",
    client_secret="your_client_secret",
)

OAuth — first-time authentication

If you don't have tokens yet, use the OAuth flow with an authorization code:

from shippingboapy import Client

client = await Client.from_auth_code(
    auth_code="your_auth_code",
    app_id="your_app_id",
    api_version="your_api_version",
    client_id="your_client_id",
    client_secret="your_client_secret",
    redirect_uri="your_redirect_uri",
)

Context manager

async with Client(...) as client:
    products = await client.products.list()

Or with explicit cleanup:

client = Client(...)
try:
    products = await client.products.list()
finally:
    await client.close()

Configuration

client.set_config(
    timeout=30,
    max_retries=3,
    retry_backoff_factor=0.5,
    api_url="https://app.shippingbo.com",
)

Products

List products

products = await client.products.list()

With filters:

products = await client.products.list(
    limit=50,
    offset=0,
    is_pack=False,
    search=[("user-ref", "eq", "123456")],
    sort=[("updated_at": "asc")],
)

Get a product

product = await client.products.get(product_id=123)

Create a product

from shippingboapy import ProductCreate

product = await client.products.create(
    ProductCreate(
        user_ref="MY-REF-001",
        title="My Product",
        weight=500,
        width=200,
        length=300,
        height=100,
    )
)

Orders

List orders

orders = await client.orders.list(limit=50)

Get an order

order = await client.orders.get(order_id=456)

Create an order

from shippingboapy import OrderCreate, OrderItemCreate

order = await client.orders.create(
    OrderCreate(
        product_source= "product_src_str",
        source="source"
        title="Order Title"
        ...
    )
)

Token refresh

Token refresh is handled automatically on 401 responses. After any request, the current tokens are accessible on the client:

client.token.access_token
client.token.refresh_token

Persisting refreshed tokens

To persist tokens after an automatic refresh, register a callback at init:

async def save_tokens(access_token: str, refresh_token: str):
    # Persist to your database, file, or any storage
    await db.save(access_token=access_token, refresh_token=refresh_token)

client = Client(
    access_token="your_access_token",
    refresh_token="your_refresh_token",
    ...,
    on_token_refresh=save_tokens,
)

Token storage is intentionally left to the caller, the SDK does not persist tokens itself.


Error handling

The SDK raises typed exceptions for predictable failure modes:

ShippingboAPYException
├── AuthenticationError
│   ├── TokenExpiredError
│   └── TokenRefreshError
└── APIRequestError          # exposes .status_code and .message
    ├── BadRequestError      # 400
    ├── UnauthorizedError    # 401
    ├── ForbiddenError       # 403
    ├── NotFoundError        # 404
    ├── RateLimitError       # 429
    ├── ServerError          # 5xx
    └── UnexpectedError      # any other status
from shippingboapy import TokenRefreshError, ShippingBoAPIError

try:
    await client.products.get(product_id=123)
except TokenRefreshError:
    # Re-authenticate the user
    ...
except ShippingBoAPIError as e:
    print(e.status_code, e.message)

Available Resources

Resource Status
Products ✅ Available
Orders ✅ Available
Addresses ✅ Available
Address Labels ✅ Available
Order Tags ✅ Available
Order Documents ✅ Available
Stock Variations 🚧 Planned
Suppliers 🚧 Planned

Missing a resource? Contributions are welcome — see CONTRIBUTING.md.


License

MIT — see LICENSE.

Metadata

Release files for shippingboapy 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shippingboapy 0.1.4
File Size Uploaded
shippingboapy-0.1.4.tar.gz 44.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shippingboapy 0.1.4
File Interpreter ABI Platform
shippingboapy-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 102.4 kB

Release files / shippingboapy-0.1.4.tar.gz

Download URL shippingboapy-0.1.4.tar.gz
Size 44.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c2641cdf90b25b815a4700825e2ae6295b3c7d4b43baa7fff5d4084b33ada7aa
BLAKE2b-256 checksum
How to use checksums
a64bb541949f0629238e75f72bb75ffce95cde0b239aea49885a398d0bfa571a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 8, 2026.

Transparency log

Release files / shippingboapy-0.1.4-py3-none-any.whl

Download URL shippingboapy-0.1.4-py3-none-any.whl
Size 58.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8a5302ab2274dbb241573ab174c600424cfb31963422224f7a84acb5b669669
BLAKE2b-256 checksum
How to use checksums
61263d09b5d0a060cc21fb45ceb47fa44e18e0caaa24c86dfd6a47bf4705a746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page