scripts.shared.shopify

Shopify client-credentials exchange for the operator scripts.

The API does the same at runtime (api/integrations/shopify/auth.py, with a shared Redis cache); scripts stay independent of the api package, so this is a deliberately small standalone copy: one exchange per script run, nothing cached or written to disk.

Attributes

Exceptions

ShopifyCredentialsError

Missing configuration, or Shopify refused the exchange.

Classes

Functions

exchange_from_env() → ShopifyToken

Exchanges SHOPIFY_CLIENT_ID/SHOPIFY_CLIENT_SECRET from the environment

Module Contents

scripts.shared.shopify.REQUIRED_SCOPES
exception scripts.shared.shopify.ShopifyCredentialsError

Bases: RuntimeError

Missing configuration, or Shopify refused the exchange.

class scripts.shared.shopify.ShopifyToken
domain: str
access_token: str
scopes: frozenset[str]
expires_in: int
missing_scopes() → frozenset[str]
scripts.shared.shopify.exchange_from_env() → ShopifyToken

Exchanges SHOPIFY_CLIENT_ID/SHOPIFY_CLIENT_SECRET from the environment for an access token for SHOPIFY_SHOP_DOMAIN.