Skip to content

Latest commit

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Zid SDK Demo

A minimal FastAPI starter showing how to integrate the Zid Python SDK.

Connect your store → See your data → Copy the code.

Quick Start

# Install the Zid SDK
pip install zid-client
# Install demo dependencies
uv sync
# Configure (add your Zid OAuth credentials)
cp .env.example .env
# Run
uvicorn app.main:app --reload

Open http://localhost:8000 and click "Install App".

What You'll See

After authenticating, you get a dashboard showing:

  • Your store profile
  • Recent orders
  • Customer data

Plus the exact SDK code that powers it:

fromzidimportZidClientclient=ZidClient(
authorization="...",
store_token="...",
)
store=client.stores.get_profile()
customers=client.customers.list()
orders=client.orders.list()

OAuth Setup (Public URL Required)

Zid OAuth requires a publicly accessible callback URL — localhost won't work.

Options:

  • ngrok — quick tunnel for local dev
  • Cloudflare Tunnel
  • Deploy to any cloud provider (Vercel, Railway, Render, etc.)
  • Any reverse proxy or tunnel that gives you a public HTTPS URL

Example with ngrok:

ngrok http 8000

Update .env:

ZID_REDIRECT_URI=https://your-url.ngrok.io/auth/callback

Then in the Zid Partner Dashboard under Application Details, set:

  • Redirection URLhttps://your-url.ngrok.io/auth/redirect
  • Callback URLhttps://your-url.ngrok.io/auth/callback

API Endpoints

EndpointSDK Method
GET /api/storeclient.stores.get_profile()
GET /api/customersclient.customers.list()
GET /api/ordersclient.orders.list()
GET /api/orders/{id}client.orders.get(id)
GET /api/webhooksclient.webhooks.list()
POST /api/webhooksclient.webhooks.create()
DELETE /api/webhooks/{id}client.webhooks.delete()

Project Structure

├── app/
│ ├── main.py # SDK examples + pages
│ ├── auth.py # OAuth flow
│ ├── config.py # Settings + token storage
│ ├── errors.py # SDK exception handlers
│ └── templates.py # HTML pages
├── .env.example
├── pyproject.toml
└── README.md

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages