Skip to main content

ControlResell Python SDK

Python client for the ControlResell public API (Python 3.11+).

Install

From the 1.0.0 release, on PyPI:

pip install controlresell-sdk
from controlresell import ControlResell

client = ControlResell(api_key="cr_live_...")  # or set CONTROLRESELL_API_KEY
me = client.me.get()
for item in client.items.iter(sold=False):
    print(item.name)
for order in client.orders.iter(bucket="to_send"):  # needs the orders:read scope; also orders.get(id), orders.labels(id)
    print(order.id)
for brand in client.catalogs.iter_brands(q="nik"):  # the identifiers an item is written with (items:read): categories, category, category_fields, brands, sizes, colors, conditions, package_sizes, materials
    print(brand.id, brand.name)

for favorite in client.favorites.iter(item_id=42):  # the buyers who favorited a listing (items:read); also favorites.iter_item(42), list, list_item
    print(favorite.buyer_id)
client.conversations.list(buyer_id="<buyer id>", offer_status="PENDING")  # buyer_id, item_id and offer_status filter the conversations

# Writes (API key with `items:write` / `conversations:write`); `idempotency_key=` chooses the key.
from controlresell.generated.models import ItemCreateRequest, ItemUpdateRequest, PublishRequest, SendMessageRequest

client.items.create(ItemCreateRequest(name="Jacket"))  # client.items.update(42, ItemUpdateRequest(...)) patches

client.items.publish(42, PublishRequest(account_ids=["<account id>"]))
client.conversations.send_message("<conversation id>", SendMessageRequest(text="Hello!"))

# Webhooks (`webhooks:read` / `webhooks:write`): endpoints, endpoint, create_endpoint, update_endpoint, delete_endpoint,
# secret, rotate_secret, test, deliveries, retry_delivery, recover, event_types; iter_events catches up the last 7 days.
from controlresell.generated.models import WebhookEndpointCreateRequest

created = client.webhooks.create_endpoint(WebhookEndpointCreateRequest(url="https://example.com/hooks", event_types=["item.sold"]))
print(created.endpoint.id, created.secret)  # the signing secret, shown once (client.webhooks.secret(id) reads it again)
for event in client.webhooks.iter_events(types=["item.sold"]):
    print(event.type_, event.data["itemId"])

Retries (rate limits, 502/503/504, network errors), Idempotency-Key on every POST, cursor pagination with plain iterators and typed errors (NotFoundError, RateLimitError...) are built in. The client is generated from the API's OpenAPI document (scripts/generate.sh, code in src/controlresell/generated).

pip install -e ".[test]"
pytest

Licensed under the Apache License 2.0.

Metadata

Release files for controlresell-sdk 1.0.0

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

Source distribution (sdist)

Source distribution for controlresell-sdk 1.0.0
File Size Uploaded Provenance Actions
controlresell_sdk-1.0.0.tar.gz 143.5 kB Without provenance Details for controlresell_sdk-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for controlresell-sdk 1.0.0
File Interpreter ABI Platform Actions
controlresell_sdk-1.0.0-py3-none-any.whl Python 3 none any Details for controlresell_sdk-1.0.0-py3-none-any.whl

Total release size: 314.5 kB

Release files / controlresell_sdk-1.0.0.tar.gz

Download URL controlresell_sdk-1.0.0.tar.gz
Size 143.5 kB
Tags Source
SHA-256 checksum
How to use checksums
22f11a3024ad9c2d5234dca15ce34cf54934fbf235e7eb9c12e924b29abccb84
BLAKE2b-256 checksum
How to use checksums
b48b280d9c0240ae5ed0d96ed692a1d58cf1021c4d30ecdbb05b5e0faf6439e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / controlresell_sdk-1.0.0-py3-none-any.whl

Download URL controlresell_sdk-1.0.0-py3-none-any.whl
Size 171.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f8b5f233482da6418a03fcb82fc234eea1891dcbc0976250befcac9d82cc5e7
BLAKE2b-256 checksum
How to use checksums
a8a2e422ef9c89b778dfb76d3396f2ef3ef35dbbe88185a9d7afa6ab9b38842a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for controlresell-sdk 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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