This project fetches Shopify orders via Shopify Admin GraphQL API, applies filtering + tag rules, transforms them into an Everstox-style order payload, and builds a dry-run HTTP request (it does not send the request).
- Fetch orders from the last 14 days
- Filter: paid and not fully fulfilled
- Supports GraphQL pagination
- Logs GraphQL cost/throttle status and uses a simple backoff retry on throttling
- Tag processing:
- Whitelist / Blacklist (case-insensitive substring match)
- Priority parsed from tags into
order_priority(1..99)
- Partial fulfillment policy:
- Imports only remaining quantities per line item:
remaining = quantity - fulfilledQuantity
- Imports only remaining quantities per line item:
- Outputs:
- Summary counts
- Prints a sample dry-run request payload for inspection
src/shopify_connector/ # application code
tests/ # unit tests
Create a .env file (or copy .env.example):
cp .env.example .env #please replace SHOPIFY_API_TOKEN with correct tokenSet at least:
SHOPIFY_SHOP_URLSHOPIFY_API_TOKENEVERSTOX_SHOP_ID
Optional:
ORDER_TAG_WHITELIST(comma-separated)ORDER_TAG_BLACKLIST(comma-separated)SHOPIFY_API_VERSIONLOG_LEVEL
Note on secrets: Keep
.envout of git.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
PYTHONPATH=src python -m shopify_connector.cliPYTHONPATH=src pytest -qThis repo includes Dockerfile and compose.yaml.
cp .env.example .env
# edit valuesdocker compose run --rm shopify-connectordocker compose run --rm testsmake test
make run
make docker-run
make docker-test- CLI output provides the “visual feedback”.
- Uses
shopMoneycurrency amounts; tax/discount handling is simplified and documented in code. - Uses conservative throttling backoff using
restoreRateand available points. - Payload fields that cannot be derived reliably are set as explicit placeholders (e.g.,
shop_instance_id).
- More complete mapping (payment methods, attachments, shipment options)
- Better tax breakdown per line (and shipping tax)
- Stronger throttling logic based on required query cost vs currentlyAvailable
- Optional small web UI