Description
Implement the POST /invoices/:id/release-escrow endpoint that enables an admin to trigger release_escrow on a paid invoice, transitioning it to the Released state. The endpoint enforces admin-only access and returns the updated status on success.
Requirements and context
- Enforce admin-only authorization before submitting the transaction
- Call release_escrow on the invoice contract via Soroban RPC
- Handle Unauthorized(1) from the contract with a 403 response
- Return updated invoice status (Released) and transaction hash on success
- Follow existing project conventions
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/backend-post-invoice-release-escrow
- Implement changes
- Test and commit
Example commit message
feat: add backend REST endpoint POST /invoices/:id/release-escrow
Guidelines
- Assignment required before starting
- PR description must include:
Closes #[issue_id]
- Keep PR description professional and detailed
Description
Implement the POST /invoices/:id/release-escrow endpoint that enables an admin to trigger release_escrow on a paid invoice, transitioning it to the Released state. The endpoint enforces admin-only access and returns the updated status on success.
Requirements and context
Suggested execution
Example commit message
feat: add backend REST endpoint POST /invoices/:id/release-escrowGuidelines
Closes #[issue_id]