Skip to main content

API Sandbox

Sandbox API is used for partner test integrations. It lets you walk through the full loan journey: calculate terms, receive a test BTC collateral address, confirm collateral, complete a payout simulation, accept USDT repayment, and return collateral. Sandbox does not perform real blockchain transfers: addresses are test addresses, and credits are confirmed by API actions such as confirm_btc and confirm_usdt.

Base URL: https://partner.fundora.capital. Authorization: Authorization: Bearer sk_sandbox_YOUR_KEY. All POST requests require Idempotency-Key. Rate limit: 120 requests per 60 seconds per Sandbox API key.

Sandbox OpenAPI

Use Sandbox OpenAPI for the full generated API catalog with request parameters, request bodies, schemas, and response blocks by HTTP status code (200, 400, 401, 404, 409, 429, and 500 where applicable).

The machine-readable OpenAPI file is available as fundora-sandbox-api.openapi.json.

How Sandbox Works

Sandbox mirrors the main Fundora borrower dashboard flow without real transfers. The partner calls API methods step by step and receives state that can be shown in the partner interface.

  1. Get configuration: rates, FX, limits, fees, and risk parameters.
  2. Create a test loan application and receive addresses needed for the flow.
  3. Instead of waiting for a blockchain event, send a confirming API action.
  4. After payout, read the loan state and start repayment.
  5. After full repayment, the API shows the collateral return step.

Steps cannot be executed in arbitrary order. If an action is sent too early, the API returns 409 FLOW_CONFLICT. In that case, call GET State, inspect the current step, and continue from there.

Quick Start

  1. Get a Sandbox API key in the Fundora partner dashboard.
  2. Call GET Config to load rates, FX, fees, and calculator limits.
  3. Call GET State to check whether the key already has an active application or loan.
  4. Create an application through POST Loans with action=start_collateral_transfer.
  5. Continue the flow through POST Loans, changing action to the next allowed step.
  6. After payout, read the loan through GET Loans or GET State.
  7. Start repayment through POST Repayments.
  8. Configure Webhooks if your backend needs push events instead of polling.
curl https://partner.fundora.capital/api/sandbox/config \
-H "Authorization: Bearer sk_sandbox_YOUR_KEY"

Environment and Rules

ParameterValue
Base URLhttps://partner.fundora.capital
Partner Dashboardpartner.fundora.capital
EnvironmentSandbox, no real blockchain transfers
API description version0.3.0
AuthorizationAuthorization: Bearer sk_sandbox_YOUR_KEY
POST requestsAlways send Idempotency-Key
Rate limit120 requests per 60 seconds per Sandbox API key
Request logrequest_id, error_code, and Idempotency-Key are visible in the partner dashboard

Breaking changes will be released as a new API description version and announced separately to partners. During testing, the URL remains /api/sandbox/*.

Test Wallets

The API returns wallet data in sandboxFlow. These are not real custody wallets: isRealWallet=false, network is sandbox, and confirmation is done through the API.

For a loan application, wallets are located in sandboxFlow.loanApplications[].wallets.

FieldAssetPurpose
collateralDepositBTCAddress shown to the client for the test collateral transfer.
loanPayoutUSDTTest wallet for the USDT payout scenario.
collateralReturnBTCAddress used in the future collateral return scenario.

For repayment, wallets are located in sandboxFlow.repaymentOperations[].wallets.

FieldAssetPurpose
repaymentUSDTAddress for test interest, partial principal, or full principal repayment.
collateralReturnBTCCollateral return address after full repayment. It can be null for interest-only or partial repayments.

Each wallet contains asset, chainCode, address, requiredConfirmations, isRealWallet, and confirmationMode.

Loan Scenario from Application to Payout

StepWhat to callWhat happens
1GET ConfigLoad rates, LTV, liquidation threshold, fees, and FX for the calculator.
2GET StateCheck whether the current API key already has an active application or loan.
3POST Loans with action=start_collateral_transferCreate an application draft, calculate loan parameters, and receive test wallets.
4POST Loans with action=confirm_btcSimulate BTC collateral credit. In production, this is blockchain verification.
5POST Loans with action=run_kytSimulate collateral KYT checks.
6POST Loans with action=complete_payoutComplete the application and convert it into an active loan.
7GET State or GET LoansRead loan ID, status, debt, collateral, LTV, and history.

Repayment and Collateral Return Scenario

StepWhat to callWhat happens
1GET Loans or GET StateSelect an active loan and check the debt amount.
2POST Repayments with action=start_paymentCreate a repayment operation. The API returns operation_id and the test USDT wallet repayment. Full repayment also returns collateralReturn.
3POST Repayments with action=confirm_usdtSimulate USDT payment credit. Send operation_id on this and following steps.
4POST Repayments with action=run_kytSimulate payment KYT checks.
5POST Repayments with action=complete_settlementInterest or principal is settled in the test loan state.
6POST Repayments with action=complete_collateral_returnOn full repayment, complete the BTC collateral return.
7GET StateConfirm that the loan is closed, repayment is settled, and collateral return is shown in history.

If the repayment is interest-only or partial principal, the collateral return step is not required.

Webhooks

Sandbox webhooks send push events to the partner HTTPS endpoint when the loan flow, repayment flow, or sandbox partner profile changes. The same delivery model is planned for LIVE API: the endpoint is configured per API key, delivery is signed with HMAC SHA-256, attempts are logged, and failed attempts can be retried.

Configure the endpoint through POST Webhooks. The first response and every response with rotate_secret=true returns signingSecret; store it on your side. Later responses show only secretPreview. To test delivery, call POST Webhook Test.

Webhook requests are sent as POST with JSON body and these headers:

HeaderValue
x-fundora-webhook-idEvent ID.
x-fundora-webhook-eventEvent type, for example sandbox.loan.issued.
x-fundora-webhook-timestampUnix timestamp in seconds.
x-fundora-webhook-signaturev1= + HMAC SHA-256 of ${timestamp}.${rawBody} using signing_secret.

The endpoint should return any 2xx status. Non-2xx responses, timeouts, or network errors move delivery to retry or failed state. Retry delivery through POST Webhook Retry.

Sandbox events:

EventWhen it is sent
sandbox.loan_application.updatedApplication is created, BTC collateral is confirmed, or KYT is completed.
sandbox.loan.issuedSandbox application is completed and becomes an active loan.
sandbox.loan.updatedActive loan is changed directly through an action endpoint.
sandbox.repayment.updatedRepayment operation is created or advanced toward settlement.
sandbox.repayment.settledInterest or principal is settled in sandbox state.
sandbox.collateral.returnedCollateral is returned or released through a sandbox action.
sandbox.partner.updatedSandbox partner profile is created or updated.
sandbox.webhook.testTest event from the API.

Errors

All errors return the same format: request_id, error_code, and error. Use error_code for integration logic and show error to humans.

HTTPError codeWhen it happensWhat to do
401SANDBOX_API_KEY_REQUIREDAuthorization header is missing.Send Authorization: Bearer sk_sandbox_....
401SANDBOX_API_KEY_INVALIDThe key is invalid, revoked, or expired.Check the key or create a new Sandbox API key.
500SANDBOX_API_KEY_DATABASE_REQUIREDSandbox API is not configured in the environment.Send request_id to Fundora support.
401SANDBOX_SESSION_REQUIREDThe sandbox session could not be resolved.Retry with a valid key or send request_id to support.
429SANDBOX_RATE_LIMIT_EXCEEDEDThe 120 requests per 60 seconds limit was exceeded.Wait for the next window and retry.
400INVALID_JSONRequest body is not valid JSON.Check Content-Type: application/json and the body.
400INVALID_ACTIONThe action is unknown or not valid for the method.Compare action with the method documentation.
400INVALID_AMOUNTAmount, collateral, or repayment parameters are invalid.Check limits from GET Config.
404LOAN_NOT_FOUNDLoan was not found for the current API key.Refresh state through GET State or GET Loans.
409FLOW_CONFLICTA step was called too early or from the wrong status.Call GET State and continue from the current step.
400IDEMPOTENCY_KEY_REQUIREDPOST request has no Idempotency-Key.Send a new UUID in Idempotency-Key.
409IDEMPOTENCY_KEY_CONFLICTThis key was already used with another body or API method.Use a new UUID for a new operation; retry with the same request for a repeat.
409IDEMPOTENCY_KEY_IN_PROGRESSThe same key is already being processed.Retry later with the same key and same body.
400WEBHOOK_URL_REQUIREDWebhook endpoint was not sent.Send a public HTTPS URL.
400WEBHOOK_URL_INVALIDEndpoint is not HTTPS or points to local/private host.Use a public HTTPS URL without credentials.
400WEBHOOK_EVENTS_INVALIDEvent list is empty or contains an unknown event.Send supported events from the Webhooks section.
409WEBHOOK_ENDPOINT_REQUIREDTest event was sent before webhook setup.Call POST Webhooks first.
404WEBHOOK_DELIVERY_NOT_FOUNDDelivery was not found or was already delivered.Check deliveries through GET Webhooks.

Retries and request_id

  • All POST requests require Idempotency-Key, usually a UUID.
  • Use a new key for every new operation.
  • After a network error, retry with the same key, same API method, and same request body.
  • If the same key is sent with another body, the API returns IDEMPOTENCY_KEY_CONFLICT.
  • Every response contains request_id. It is visible in the partner dashboard request log and helps support investigate issues quickly.

Where to Find Fields

  • GET Config: rates, FX, fees, payment terms, and risk parameters.
  • GET State: full snapshot with loans, current flows, wallets, history, and partner block.
  • POST Loans: loan creation and payout flow steps.
  • POST Repayments: repayment and collateral return flow steps.
  • GET Partner: partner profile, links, levels, and rewards.
  • GET Webhooks: webhook endpoint, signing secret preview, and recent delivery attempts.