POST /api/sandbox/loans/{id}/repayment-flow
POST/api/sandbox/loans/:id/repayment-flow
Advances one step of the cabinet-compatible repayment flow. Use it to simulate full, partial, or interest-only repayment with a test payment wallet, KYT, settlement, and collateral return.
Actions must be executed in strict order:
start_payment- create a repayment operation and receive sandbox wallets.confirm_usdt- confirm the test payment credit withtx_hashandconfirmations.run_kyt- simulate a KYT check for the payment.complete_settlement- settle interest or principal debt.complete_collateral_return- return collateral after full repayment.
You cannot execute a step too early. API returns 409 FLOW_CONFLICT when the state does not allow the requested action. To recover, call GET /api/sandbox/state.
Response wallets are located at sandboxFlow.repaymentOperations[].wallets: repayment for the payment and collateralReturn for collateral return after full repayment. Sandbox does not require external chain polling: confirmation is simulated by the confirm_usdt POST action.
POST requests must include Idempotency-Key so a retry does not create a second repayment operation or duplicate a state transition.
Example:
curl https://partner.fundora.capital/api/sandbox/loans/LOAN_ID/repayment-flow \
-H "Authorization: Bearer sk_sandbox_YOUR_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: b6dc3b48-8a3b-4c19-9c7c-365809712665" \
-d '{"action":"start_payment","repayment_kind":"full_principal","full_repayment":true}'
Request
Responses
- 200
- 400
- 401
- 404
- 409
- 429
Updated Sandbox loan state
Invalid request: invalid body, missing Idempotency-Key for POST, unknown action, or invalid amount
Sandbox API key is missing or invalid
Loan was not found
The flow cannot continue from the current state, a balance/limit is insufficient, or Idempotency-Key conflicts
Sandbox API rate limit exceeded