Cash-Advance Scores

Both endpoints on this page are deprecated with no replacement. Cash-advance scoring is sourced entirely from Pave and is being retired along with the Pave integration rather than reimplemented elsewhere. In a future release both will stop returning data and respond 404 for every user. Clients should remove their use of them rather than migrate.

The Insight Service exposes two cash-advance score endpoints, both served by the prod-insight-api Lambda. Scores are sourced from Pave and reflect the probability that a user will repay a cash advance within a given time window.

Endpoints

GET /{user_id}/scores/cash_advance

Deprecated, no replacement. The scores DynamoDB entity this reads is written from Pave mining runs and is being deleted with the rest of the Pave cache.

Returns the most recent cash-advance score for the user from the prod-pave DynamoDB scores entity. The score is written by the miner Lambda each time Pave insight mining runs for the user.

Data path:

Request → prod-insight-api
  └─▶ DynamoDB CashAdvanceScoreRepo.Get(user_id)
        ├─ found → 200 with score payload
        └─ not found → 404 (score not yet available; miner has not run for this user)

Response shape:

{
  "user_id": "<floatme_user_id>",
  "date": "2024-01-15T12:00:00Z",
  "scores": [
    {
      "score": 85,
      "highest_amount": 100,
      "lowest_amount": 25
    }
  ]
}

score is an integer representing the repayment probability percentage. Each entry in scores corresponds to an advance amount bracket — multiple entries represent the score at different loan amounts (in $25 increments per the Pave scoring model).

GET /{user_id}/scores/cash_advance_history

Deprecated, no replacement, and already failing in practice — Pave removed the underlying API it relied on, so every request calls Pave and returns 502 when that call fails. The endpoint remains in the spec and code for backwards compatibility only, and is scheduled for removal.

Returns historical repayment probabilities across three time windows: 15d, 30d, and 45d. Unlike cash_advance, this endpoint calls Pave directly rather than reading from DynamoDB cache.

Response shape:

{
  "user_id": "<floatme_user_id>",
  "date": "2024-01-15",
  "scores": {
    "full_payment_15d": 0.82,
    "full_payment_30d": 0.88,
    "full_payment_45d": 0.91
  }
}

Score Lifecycle

Scores are populated by the miner Lambda as part of the Pave mining pipeline:

Pave mining (miner Lambda)
  ├─▶ Pave.GetCashAdvanceScore(user_id)
  └─▶ DynamoDB CashAdvanceScoreRepo.Save(user_id, scores)

The prod-insight-api Lambda reads the cached value from DynamoDB — it does not call Pave directly for GET /scores/cash_advance. This means scores are only as fresh as the last successful mining run for the user.

DynamoDB Entity

The scores entity in prod-pave stores the score data written by the miner. See DynamoDB Tables for the full key construction and attribute schema.