Context tile for pidge notification library v3 - async API with NotificationClient, Message, and dispatch pattern
99
Quality
99%
Does it follow best practices?
Impact
100%
2.85xAverage score across 3 eval scenarios
Passed
No known issues
An e-commerce platform is building a post-checkout flow. When a customer completes a purchase, a backend service needs to send them an order confirmation notification via the pidge notification library (v3). The team has a FastAPI service already running order processing logic, and they need a new /notify/order-confirmed endpoint added to it.
The endpoint receives the order details and customer email, then dispatches a notification. Since this endpoint is hit in the critical checkout path, it must be resilient: delivery failures should not crash the endpoint or surface as server errors to the caller. The caller (frontend checkout service) may take follow-up actions based on the result, so the response should be informative.
The pidge library is available via pip install pidge. The team's API key will be available at runtime via an environment variable.
Produce a Python file order_notify.py containing a FastAPI app (or router) with the /notify/order-confirmed POST endpoint implemented. The endpoint should:
customer_email, order_id, and order_total fieldsInclude any necessary imports. The file should be runnable (e.g., uvicorn order_notify:app).