Skip to main content

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:

  1. start_payment - create a repayment operation and receive sandbox wallets.
  2. confirm_usdt - confirm the test payment credit with tx_hash and confirmations.
  3. run_kyt - simulate a KYT check for the payment.
  4. complete_settlement - settle interest or principal debt.
  5. 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

Updated Sandbox loan state