scripts.shared.shopify ====================== .. py:module:: scripts.shared.shopify .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: scripts.shared.shopify.REQUIRED_SCOPES Exceptions ---------- .. autoapisummary:: scripts.shared.shopify.ShopifyCredentialsError Classes ------- .. autoapisummary:: scripts.shared.shopify.ShopifyToken Functions --------- .. autoapisummary:: scripts.shared.shopify.exchange_from_env Module Contents --------------- .. py:data:: REQUIRED_SCOPES .. py:exception:: ShopifyCredentialsError Bases: :py:obj:`RuntimeError` Missing configuration, or Shopify refused the exchange. .. py:class:: ShopifyToken .. py:attribute:: domain :type: str .. py:attribute:: access_token :type: str .. py:attribute:: scopes :type: frozenset[str] .. py:attribute:: expires_in :type: int .. py:method:: missing_scopes() -> frozenset[str] .. py:function:: exchange_from_env() -> ShopifyToken Exchanges SHOPIFY_CLIENT_ID/SHOPIFY_CLIENT_SECRET from the environment for an access token for SHOPIFY_SHOP_DOMAIN.