Skip to content
Apha.
All projects

Fintech · Escrow

InstaSafe.

Production escrow backend for Nigerian social commerce. It secures buyer payments, automates vendor and rider payouts, and powers an AI-driven WhatsApp ordering chatbot on Azure infrastructure.

InstaSafe interface

The brief

InstaSafe is a production-grade escrow API for vendors selling over WhatsApp and Instagram. It holds buyer funds after successful Paystack payments, releases them after OTP- or rider-verified delivery, and manages disputes, refunds, and automated payouts end to end. I designed and built the backend from scratch with .NET 10 and ASP.NET Core using Clean Architecture, CQRS with MediatR, FluentValidation, AutoMapper, Entity Framework Core with PostgreSQL, and 222 passing unit, domain, and integration tests. The system integrates Paystack, OpenWA WhatsApp, Groq AI, and Brevo, and is deployed to Azure App Service with a self-hosted OpenWA gateway on an Azure virtual machine.

Capabilities

01Escrow Payment Lifecycle
Manages Draft, AwaitingPayment, Held, Delivered, and Released states, with Refunded, Disputed, and Cancelled exits. Amounts are handled in kobo to avoid floating-point errors.
02Dual Delivery Confirmation
Supports rider OTP confirmation with instant delivery-fee payout and a 24-hour vendor inspection window, plus buyer-code self-delivery with a 24-hour automatic-release backstop.
03WhatsApp Ordering Chatbot
Guides vendors through conversational order creation with intent classification, mid-flow corrections, resumable drafts, live bank-holder verification, and deterministic validation before any state changes.
04Paystack Financial Integration
Handles hosted checkout, webhook verification, vendor and rider transfers, refunds, real-time bank resolution, dedicated virtual accounts, and Nigeria’s bank list.
05Multi-Role Authentication
Provides JWT authentication for vendors, dispatch riders, and admins with role-scoped endpoints, audience-specific DTOs, reflection-tested PII controls, and server-side ownership enforcement.
06Background Workers
Uses a 15-second outbox publisher for WhatsApp and email notifications and a five-minute release worker for orders whose inspection or backstop windows have elapsed.
07Public Order Tracking
Offers anonymous credential-free tracking by order number or Paystack reference, showing status transitions while exposing only PII-stripped order data.
08Email Notifications
Sends payment receipts, order-status updates, and verification codes through Brevo SMTP.
09Admin Operations
Exposes statistics, vendor and order search, dispute management, manual refunds, force-release, payout retries, chat audits, webhook replay, and outbox-error inspection.
10Observability
Uses JSON-structured Serilog logging, file sinks on App Service, health checks, and optional Azure Application Insights telemetry and tracing.
Next projectAgroGuardian AI