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)

Automated via .github/workflows/publish.yml:

Trigger PyPI version Who gets it
Push to main 0.5.0.dev42 (base + run number) pip install --pre shedcloud-partner-api
Tag v0.6.0 or GitHub Release 0.6.0 (from tag) pip install shedcloud-partner-api

PyPI rejects duplicate versions, so every main commit gets a unique .dev suffix. Bump the base version in pyproject.toml when cutting the next stable line.

Stable release:

  1. Bump version in pyproject.toml and src/shedcloud_partner_api/__init__.py
  2. Update CHANGELOG.md, commit to main, tag: git tag v0.6.0 && git push origin v0.6.0

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.dev2.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.dev2-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for shedcloud_partner_api-0.5.0.dev2.tar.gz
Algorithm Hash digest
SHA256 d46a7413348f82103a45e537e3a129da4240221700d299c7cf59a5239580ce66
MD5 430d7b49a1d7b218d45c68231baef60a
BLAKE2b-256 dd06d3acec3972ab05c15b7a6f1f9a236229063450f10431be265624acb6fae4

See more details on using hashes here.

Provenance

The following attestation bundles were made for shedcloud_partner_api-0.5.0.dev2.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.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for shedcloud_partner_api-0.5.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b47e87d95e2b6cc06bd75ab54fd53e4ca5d9822edfb86c9bd47aa12386ac1b
MD5 ca4c99b3df77ae6ed298ca1a1aa722d8
BLAKE2b-256 89bdfb9034cc35bdd13871dc695214f1b639840039b0c0eff53bd5a0712d409b

See more details on using hashes here.

Provenance

The following attestation bundles were made for shedcloud_partner_api-0.5.0.dev2-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