Skip to content

Sandbox

Sandbox test endpoints. Also: optional sandboxScenario on POST /api/calculate and /api/calculate/estimate (calculation_not_possible).

POST/api/sandbox/financing_cases/{id}/finance-decision

Sandbox only: trigger a finance decision for a test financing case

Sandbox-only endpoint for integration partners: drives the quote of a test financing case to FINANCE_ACCEPTED or FINANCE_REJECTED end-to-end, without an HMAC signature, response hash or Kairos call. Requires a sandbox API key (ROLE_API_USER) and only operates on financing cases owned by the calling partner. The quote state machine is driven directly, so the same downstream subscribers (partner mails, webhooks) fire as for a real decision. Responds 204 on success, 422 when the quote is in a non-decidable state, and 404 outside the sandbox environment (where the endpoint is inactive).

Parameters

Path and query parameters for POST /api/sandbox/financing_cases/{id}/finance-decision
Name In Type Required Description
id path string yes FinancingCase identifier

Request body

Request body properties for POST /api/sandbox/financing_cases/{id}/finance-decision
Name Type Required Description
decision string|null yes

Code samples

curl -X POST 'https://sandbox.partner.miete24.com/api/sandbox/financing_cases/{id}/finance-decision' \
  -H 'X-Api-Key: YOUR_API_KEY'

Responses

Responses for POST /api/sandbox/financing_cases/{id}/finance-decision
Status Description Schema
204 FinancingCase resource created —
400 Invalid input —
403 Forbidden —
422 Unprocessable entity —

POST/api/sandbox/financing_cases/{id}/simulate

Sandbox only: simulate a financing-case scenario

Sandbox-only generic simulation endpoint for integration partners: drives a test financing case into a named state via real quote/contract state-machine transitions or creates real document-request entities, without HMAC, response hash or live Kairos/GRENKE/DocuSign calls. Request body: {"scenario":"<value>","data":{...}} where data is optional. Supported scenario values: finance_review (REQUEST_FINANCE_REVIEW with skip_financing_submission, synthesises an active FinancingResponse), manual_finance_review (START_MANUAL_FINANCE_REVIEW), finance_accepted (same path as finance-decision accepted, including an active FinancingResponse so start-esignature works), finance_rejected (same path as finance-decision rejected; optional data.rejectionReason is stored and exposed as rejectionReason on GET /financing_cases/{id}), canceled (same cancellation rules as POST /financing_cases/{id}/cancel, including CancelOverridePolicy), information_requested (creates RequestedInformation from data.question or data.items[].question; appears in GET document-requests and is answerable via the regular information respond endpoint), requested_document (creates RequestedDocument from data.label+data.category or data.items[]; financing-stage document categories only; invalid category → 422 listing allowed values), requested_fill_and_return (same shape for fill-and-return financing-stage categories), change_requested (Quote REQUEST_CHANGES from in_review only with required data.message; otherwise 422), document_rejected (rejects a PENDING_REVIEW FinancingDocument via required data.documentId; optional data.reason; linked request reappears open in GET document-requests for re-upload; foreign documentId → 404; already rejected / not rejectable → 422), upload_rejected_type / upload_rejected_size (require data.documentId of an open RequestedDocument or RequestedFillAndReturn; return the same HTTP 400 Bad Request payload as a real MIME-/size-rejected upload — no special sandbox format; missing / foreign / closed documentId → 422), wait_for_signing / signed / post_processing_required / delivery_approved / invoice_checked / completed (Contract SM places; creates a Contract at wait_for_signing when missing without DocuSign; signed attaches an idempotent SIGNED_CONTRACT FinancingDocument that is listable and PDF-downloadable; completed requires a contract number else 422; unreachable transitions → 422 naming current and desired status), signature_sent / signature_signed / signature_declined (e-signature intermediate envelope states without DocuSign API; require Contract at wait_for_signing — created when missing; create/update a local DocuSignEnvelope + customer recipient; optional data.reason for signature_declined; unreachable → 422 naming current and desired status), reset (data.targetStatus required; rewinds to an earlier quote/contract place with cleanup of open requests and simulated SIGNED_CONTRACT docs; does not delete the case; allowed targetStatus: accepted_by_customer, finance_review, manual_finance_review, finance_accepted, finance_rejected, wait_for_signing, signed, post_processing_required, delivery_approved, invoice_checked; missing/invalid → 422 listing allowed values). Created request entities have no sandbox marker in the payload. Requires a sandbox API key (ROLE_API_USER) and only operates on financing cases owned by the calling partner. Responds 204 on success (or HTTP 400 with the production upload error payload for upload_rejected_*), 401 without a valid API key, 403 for a case owned by another partner, 404 if the case does not exist or outside the sandbox environment (API_ENVIRONMENT != sandbox, where the endpoint is inactive and applies no transition), and 422 for an unknown scenario (message lists allowed values), invalid category, missing required data, or when the scenario is unreachable from the current state (message names current and desired status). The legacy finance-decision endpoint remains available and unchanged. Related (PH-1017): POST /api/calculate and /api/calculate/estimate accept optional body field sandboxScenario. Value calculation_not_possible forces the same empty-calculation failure (HTTP 500, EmptyCalculationException shape) as a real zero-offer miss; outside API_ENVIRONMENT=sandbox the field is rejected with 422 and calculation is not suppressed. Omit the field for normal calculation.

Parameters

Path and query parameters for POST /api/sandbox/financing_cases/{id}/simulate
Name In Type Required Description
id path string yes FinancingCase identifier

Request body

Request body properties for POST /api/sandbox/financing_cases/{id}/simulate
Name Type Required Description
scenario string|null yes Scenario to apply. Supported values: finance_review, manual_finance_review, finance_accepted, finance_rejected, canceled, information_requested, requested_document, requested_fill_and_return, change_requested, document_rejected, upload_rejected_type, upload_rejected_size, wait_for_signing, signed, post_processing_required, delivery_approved, invoice_checked, completed, signature_sent, signature_signed, signature_declined, reset.
data object no Optional scenario-specific payload. finance_rejected: rejectionReason (string). information_requested: question (string) or items[{question}]. requested_document: label+category or items[{label,category}]; allowed categories: business_registration, annual_financial_statement, business_assessment, self_disclosure, medical_license, purchase_offer, notarized_transfer_contract, land_register_extract, property_owner_consent, partnership_agreement. requested_fill_and_return: same shape; allowed categories: self_disclosure_template, default_guarantee. change_requested: message (string, required; Quote must be in_review). document_rejected: documentId (int, required) of a PENDING_REVIEW FinancingDocument on this case; optional reason (string). Foreign/missing documentId → 404; already rejected / not rejectable → 422. Re-opens the linked request in GET document-requests for re-upload. Contract-phase scenarios (wait_for_signing, signed, post_processing_required, delivery_approved, invoice_checked, completed) take no data; signed attaches an idempotent SIGNED_CONTRACT FinancingDocument (listable + PDF downloadable, no DocuSign); completed requires a contract number else 422; unreachable transitions return 422 naming current and desired status. upload_rejected_type / upload_rejected_size: data.documentId (int, required) of an open RequestedDocument or RequestedFillAndReturn on this case; returns the same HTTP 400 Bad Request payload as a real MIME-/size-rejected upload (no special sandbox format). Missing / foreign / closed documentId → 422. signature_sent / signature_signed / signature_declined (PH-1048): require Contract at wait_for_signing (created when missing, no DocuSign API); create/update a local DocuSignEnvelope + customer recipient into sent / signed / declined; optional data.reason for signature_declined; unreachable envelope transitions → 422 naming current and desired status; idempotent when already at the target envelope status. reset: data.targetStatus (string, required) rewinds the case to an earlier place with cleanup of open requests and simulated SIGNED_CONTRACT docs; does not delete the case. Allowed targetStatus: accepted_by_customer, finance_review, manual_finance_review, finance_accepted, finance_rejected, wait_for_signing, signed, post_processing_required, delivery_approved, invoice_checked. Missing/invalid targetStatus → 422 listing allowed values.

Example request

Example body
{
    "scenario": "finance_accepted"
}

Code samples

curl -X POST 'https://sandbox.partner.miete24.com/api/sandbox/financing_cases/{id}/simulate' \
  -H 'X-Api-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"scenario":"finance_accepted"}'

Responses

Responses for POST /api/sandbox/financing_cases/{id}/simulate
Status Description Schema
204 FinancingCase resource created —
400 Invalid input —
403 Forbidden —
422 Unprocessable entity —