Skip to main content

Official Python client for the ShedCloud Partner API

Project description

shedcloud-partner-api

Official Python client for the ShedCloud Partner API (/partner/v1/*).

Use this package from Python 3.10+ to call company-scoped Partner API endpoints with an API key (sc_live_…) or OAuth2 client credentials.

Install

pip install shedcloud-partner-api

For local development:

pip install -e ".[dev]"

Hosts

Environment Host
production (default) https://go.shedcloud.com
sandbox https://api.shedcloudtest.com

Pass environment="sandbox" for test, or base_url= for a custom/local override.

Quick start

API key (production)

from shedcloud_partner_api import ShedCloudPartnerClient

client = ShedCloudPartnerClient(
    auth={"type": "api_key", "api_key": "sc_live_..."},
)

stock = client.lot_stock.list({"limit": 50, "purchase_type": "Lot Stock"})
print(stock["total"], stock["data"][0]["title"])

Sandbox

client = ShedCloudPartnerClient(
    environment="sandbox",
    auth={"type": "api_key", "api_key": "sc_live_..."},
)

OAuth2 client credentials

client = ShedCloudPartnerClient(
    auth={
        "type": "oauth",
        "client_id": "...",
        "client_secret": "...",
    },
)

orders = client.orders.list({"status": "Unprocessed", "limit": 25})

Create credentials in the ShedCloud portal under Settings → Developer API.

Resources

Each attribute maps to a section of the hosted reference.

Client attribute Endpoints
client.lot_stock GET /partner/v1/lot-stock
client.stock_templates GET /partner/v1/stock-templates
client.leads leads CRUD + status
client.quotes quotes CRUD, convert, line items
client.orders orders CRUD, contract, payments, line items
client.work_orders work orders CRUD + status
client.locations locations CRUD
client.customers customers CRUD + merge
client.domains storefront domains (read-only)
client.agreements B2B agreements + state legal (read-only)
client.products catalog products + sizes
client.users users CRUD + roles
client.payments payments (read-only)
client.documents documents + download links
client.events event feed, iterator, redeliver, webhook deliveries
client.configurator_sessions 3D configurator launch sessions

Idempotency and optimistic concurrency

client.quotes.create(body, idempotency_key="uuid-here")
client.orders.update(order_id, body, if_match=record["version"])

Event feed iterator

for event in client.events.iterate({"types": ["order.created"]}):
    handle(event)

Webhook verification

from shedcloud_partner_api import verify_webhook_signature, WEBHOOK_SIGNATURE_HEADER

verify_webhook_signature(
    request.body,
    request.headers[WEBHOOK_SIGNATURE_HEADER],
    webhook_secret,
)

Python field names

Request params and bodies use snake_case in Python (e.g. location_id, default_for_store). The client serializes them to camelCase JSON automatically.

Scopes

See shedcloud_partner_api.PartnerScopes — kept in sync with the API's scope catalog.

Related SDKs

Publishing (maintainers)

Releases are automated via .github/workflows/publish.yml when a GitHub Release is published.

One-time PyPI trusted publisher setup:

  1. pypi.org → your project → PublishingAdd a new pending publisher
  2. Owner: Corland-Partners-LLC, repository: shedcloud-pypi, workflow: publish.yml, environment: pypi
  3. GitHub repo → Settings → Environments → create environment pypi (optional approval rules)

Cut a release:

  1. Bump version in pyproject.toml and src/shedcloud_partner_api/__init__.py
  2. Update CHANGELOG.md, commit, tag: git tag v0.5.0 && git push origin v0.5.0
  3. GitHub → Releases → Draft a new release from the tag → Publish release

CI runs lint + tests, builds sdist/wheel, and uploads to PyPI.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shedcloud_partner_api-0.5.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shedcloud_partner_api-0.5.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file shedcloud_partner_api-0.5.0.tar.gz.

File metadata

  • Download URL: shedcloud_partner_api-0.5.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shedcloud_partner_api-0.5.0.tar.gz
Algorithm Hash digest
SHA256 3e7896c0af74253a18231e44ee76577f9fdee9cf7dfaae75c626f857b763bb2a
MD5 f3217e08b872a8bef0b8906209dad804
BLAKE2b-256 7f5b647fc68426eecf6b2b2ace348a0fbe2b4a2037327692abcd44e29f88e98c

See more details on using hashes here.

Provenance

The following attestation bundles were made for shedcloud_partner_api-0.5.0.tar.gz:

Publisher: publish.yml on Corland-Partners-LLC/shedcloud-pypi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shedcloud_partner_api-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for shedcloud_partner_api-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcc41767d3743782320a0a88677049391b10de46b1d30cd41f420f8fa36e0ac7
MD5 e26abd04a3b110ef581ef6eed39a39bf
BLAKE2b-256 553eb48860bc29112e243cdc372131406a4dedc0a730f513d2e988e20dc1038b

See more details on using hashes here.

Provenance

The following attestation bundles were made for shedcloud_partner_api-0.5.0-py3-none-any.whl:

Publisher: publish.yml on Corland-Partners-LLC/shedcloud-pypi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page