Skip to content

ApexDataLabs/multi-platform-api-syncmulti-platform-api-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Multi-Platform API Orchestrator

A production-style Python service that listens for e-commerce order webhooks (Stripe/Shopify-style) and automatically syncs each new order to a project board (Trello-style), so a business owner sees new orders appear as cards in real time — no manual copy-paste between tools.

Why this exists

Businesses running on multiple SaaS tools (payments, CRM, project boards) constantly need "glue code" to keep them in sync. This project demonstrates that integration pattern end-to-end: webhook ingestion, validation, transformation, and a rate-limited, retry-safe push to a downstream API.

What it demonstrates

  • Webhook security — HMAC signature verification on incoming payloads
  • Data validation & normalization — turning a messy provider-specific payload into a clean internal schema, with explicit error handling for malformed data
  • Resilient outbound API calls — automatic retries with exponential backoff, and graceful handling of 429 Too Many Requests
  • Rate limiting — a custom async token-bucket limiter so bursts of incoming orders never exceed the target API's rate limit
  • Secure config — API keys and secrets loaded from environment variables via python-dotenv, never hardcoded
  • Dry-run mode — the whole pipeline runs and is fully testable with zero live credentials, logging exactly what it would do

Tech stack

FastAPI · aiohttp · python-dotenv · pytest

Project structure

api-orchestrator/
├── app.py                      # FastAPI app + webhook endpoint
├── services/
│   ├── source_orders.py        # Validates & normalizes incoming order payloads
│   └── target_board.py         # Pushes normalized orders to the board API
├── utils/
│   ├── rate_limiter.py         # Async token-bucket rate limiter
│   └── logger.py                # Structured logging
├── tests/
│   ├── test_pipeline.py        # Automated unit tests
│   └── send_test_webhook.py    # Manual demo script
├── .env.example
└── requirements.txt

Setup

git clone https://github.com/<your-username>/multi-platform-api-sync.git
cd multi-platform-api-sync
pip install -r requirements.txt
cp .env.example .env   # fill in real credentials, or leave blank for dry-run mode

Run it

uvicorn app:app --reload --port 8000

In another terminal, fire a sample webhook at it:

python tests/send_test_webhook.py

You'll see the pipeline receive, validate, and sync the order — logged to the console in real time.

Run the test suite

pytest -v

Adapting this to real platforms

  • Swap services/source_orders.py for the real Stripe/Shopify webhook payload shape (their SDKs provide signature verification helpers too).
  • Swap services/target_board.py's base_url and payload format for Trello, Asana, HubSpot, or any REST API — the retry/rate-limit/dry-run scaffolding stays the same.

License

MIT — free to use as a starting point for your own integration projects.

About

A Python service that syncs e-commerce orders (Stripe/Shopify) to a project board (Trello) in real time — with webhook validation, rate limiting, and retry logic.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages