feat(escrow): marketplace escrow workflows with milestones - #990
Merged
github-actions[bot] merged 2 commits intoSep 28, 2026
Conversation
…17#915) Adds held-funds order escrow for marketplaces: funding, shipping and delivery tracking, a buyer inspection window that auto-releases to the seller, milestone-based partial releases, commission-aware payout splitting, buyer-protection disputes resolved to buyer/seller/split, refunds, and per-marketplace settlement reporting. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@davidsoniaudin2-oss is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@davidsoniaudin2-oss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #915.
Adds escrow payment workflows for marketplaces: the marketplace holds the buyer's funds until delivery is confirmed, then settles the order by paying the seller and taking a platform commission.
What changed
backend/src/services/marketplace-escrow.ts—MarketplaceEscrowServicecovering thecreated → funded → shipped → delivered → releasedlifecycle, a buyer inspection window with auto-release, milestone-based partial releases, commission-aware payout splitting, buyer-protection disputes (buyer/seller/split), refunds, cancellation, and an event audit trail.backend/src/routes/marketplace-escrow.ts— REST API mounted at/api/v1/marketplace-escrow.backend/src/index.ts— router registration.docs/MARKETPLACE_ESCROW.md— feature documentation.Behaviour notes
releasedonce every milestone is out (partially_releasedin between).inspectionPeriodMs(default 7 days).amount - platformFee; a split dispute refundsbuyerPercentof the distributable amount and pays the rest to the seller.Tests
backend/src/services/__tests__/marketplace-escrow.test.ts— 30 tests covering creation/validation, the full lifecycle, state-machine guards, auto-release timing, milestones, disputes (all resolutions), refunds/cancellation, and settlement reporting. All passing; typecheck and lint clean for the new files.Verification