Skip to main content

Official Python SDK for the Shoppex Developer API

Project description

shoppexio

Official Python SDK for the Shoppex Developer API.

Install

pip install shoppexio

Quick start

from shoppexio import ShoppexClient

client = ShoppexClient(api_key="shx_your_api_key")
me = client.me.get()
print(me.data.get("store_name"))

products = client.products.list({"page": 1, "limit": 20})
for product in products.data:
    print(product.uniqid or product.id, product.name)

The SDK returns small response objects instead of raw nested dicts:

response = client.products.list({"limit": 20})
print(response.pagination.has_more)
print(response.data[0].to_dict())

Pagination helpers

all_products = client.products.list_all({"limit": 100})
all_logs = client.webhooks.logs_all({"page": 1, "limit": 100})

for product in client.iterate_cursor("/dev/v1/products/", {"limit": 100}):
    print(product.uniqid)

Mutations

completed = client.orders.complete(
    "ord_123",
    {"notify_customer": True},
    idempotency_key="complete-ord-123",
)

print(completed.data.get("status"))

Other core resources are typed too:

payments = client.payments.list({"limit": 20})
print(payments.data[0].status)

coupon = client.coupons.get("coupon_123")
print(coupon.data.code)

webhook = client.webhooks.get("wh_123")
print(webhook.data.url)

Error handling

from shoppexio import ShoppexApiError

try:
    client.products.get("missing-id")
except ShoppexApiError as error:
    print(error.status, error.code, error.doc_url)
    print(error.details)

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

shoppexio-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

shoppexio-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file shoppexio-0.1.0.tar.gz.

File metadata

  • Download URL: shoppexio-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for shoppexio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ce92e1148add7250763cd8d62dcca4a5775daec358d0b31ffdead2208152302
MD5 e649bb3c950417c486d66f08bce3de78
BLAKE2b-256 c0867ff894837cdeecfc8024c3336f6daa9380187de3c974127444696bde85ff

See more details on using hashes here.

File details

Details for the file shoppexio-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shoppexio-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for shoppexio-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68d5d995b63424d0cde6bb6f18b6ee08f88013ace50b1851e9d4518963d66bbc
MD5 2a70930600a0cf735bf1feed6fca6fd1
BLAKE2b-256 d1b751196b46adabe4bb26e9488d086b23e197cd3645cf82b146e0a569b6de52

See more details on using hashes here.

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