Skip to content

What is this application worth?

POST
/v1/score
curl --request POST \
--url https://stitch-collector-dev.magic-blocks.workers.dev/v1/score \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "loan_amount": 250000, "property_value": 357143, "credit_range": "Above 740", "loan_purpose": "Refi - CO", "product_grouping": "DSCR" }'

For whoever holds the application’s figures at the point its sections are complete — today, most likely the application’s own backend. Same body and answer as the EV Worker’s /score, in dollars and in cents. Logs nothing: a score without a loan is a what-if; the predictions that count are the ones written against loans through /v1/conversion. Do not call it again with updated figures — the value is corrected afterwards only by Stitch’s own restatements.

Media type application/json

The five fields the borrower entered, as typed. Unknown labels do not fail the request: the field falls back to its reference level and a warning is returned.

object
loan_amount
required

Dollars. The only field whose absence is a 400.

number
property_value

Dollars, as the applicant typed it (purchase price for purchases). The round-number signal lives here, so never send a value derived from a ratio.

number
credit_range
One of:
string
fico

The pulled score, when present; the FICO model is then used.

integer
loan_purpose

Purchase, Refi - CO, Refi - RT; aliases accepted (cash-out refinance, rate/term).

string
product_grouping

DSCR, Conv, Bank Stmt/Non-QM, Govt/Jumbo/Other; aliases accepted (conventional, bank statement, FHA).

string
occupancy

Accepted; not used by the shipped models.

string

The prediction.

Media type application/json

The same answer the EV Worker gave, in dollars and in cents. Report conversion_value as the value of the application conversion you report to Google.

object
prediction_id
string format: uuid
ev

Expected value in dollars: p_close × rev_if_close, after calibration.

number
conversion_value

What to report to the ad platform. Equal to ev.

number
p_close
number
<= 1
rev_if_close
number
model_used
string
Allowed values: credit_range fico
model

The model file’s name and version.

string
trained_on
string | null format: date
train_window
Array<string> | null
>= 2 items <= 2 items
calibration_multiplier
number
calibration
object
manual
number
auto
number
auto_source
string
Allowed values: off
inputs_used
object
key
additional properties
any
warnings
Array<string>
complete

Whether every recommended field was present.

boolean
ev_cents
integer
conversion_value_cents
integer
rev_if_close_cents
integer
Example
{
"model_used": "credit_range",
"calibration": {
"auto_source": "off"
}
}

Malformed JSON or a payload missing what the endpoint needs. The body says which.

Media type application/json
object
error
required

What was wrong, in a sentence. A 401 carries unauthorized and nothing more.

string
Example generated
{
"error": "example"
}

No key, or a key the collector does not know. Nothing was written.

Media type application/json
object
error
required

What was wrong, in a sentence. A 401 carries unauthorized and nothing more.

string
Example
{
"error": "unauthorized"
}

Only the method shown is served.