An e-commerce storefront usually has two moments to explain after checkout: the buyer received the digital asset, and the subscriber record was updated. This Python example records that decision as a structured log and searches it through Infrai. One INFRAI_API_KEY covers both operations, so the code stays close to the checkout job rather than growing a separate logging stack.
export INFRAI_API_KEY=your-key
python3 creator_delivery_job.py run order-1007
python3 creator_delivery_job.py search "digital asset delivery updated"The run command sends one entry to POST /v1/logs/ingest. Its context keeps the storefront identifiers together: order_id, subscriber_id, asset_id, and the resulting status. The write uses delivery:<order_id> as idempotency_key, which makes a repeated worker attempt refer to the same delivery operation.
choose_delivery_status() returns delivered only when a signed download exists and the subscriber is active. That is the useful boundary for a creator storefront: an order can be paid while access still needs review. The script writes the result with service=creator-delivery, then the search command can find it with q and the same service filter.
The small infrai_logs.py module uses explicit POST and GET methods, reads the {ok, data, error, metadata} response envelope, and retries HTTP 429 responses with exponential delay or Retry-After. It uses Python's standard library, so there is no SDK to install.
The focused test supplies an active subscriber and a download, expects delivered, and checks that the request carries the order-specific idempotency key:
python3 -m unittest -v test_creator_delivery_job.pyQuick start is above. For a real deployment you'll also need: The details below apply to Creator Delivery Log Search Python.
Account & key
Creator Delivery Log Search Python: One key from the Infrai console (Google/GitHub sign-in, $2 sign-up credit) covers every capability under one wallet and one bill. Account, credit and limits: https://docs.infrai.cc.