Skip to content

Adapter Mapping ​

FAST uses a per-tenant adapter layer to translate incoming bet payloads into its canonical format. If your bet event fields differ from FAST's expected schema, configure a mapping so FAST can read your data without changes to your backend.

How a bet is read ​

Every bet route (POST /v1/bets, POST /v1/bets/validate and each item of POST /v1/bets/batch) reads the body in three steps:

  1. Map. With a mapping, FAST takes each canonical field from the path you named. A canonical field you did not map is read from the field of the same name, so a payload can mix both. Every other field in your payload is ignored. Without a mapping, the body must already use the canonical names.
  2. Check the shape. The mapped result must be a valid canonical bet: the types and status values in the table below. A numeric string such as "12.50" is accepted as a number. A wrong type answers 400 validation_error, and with a mapping the message ends in (after the adapter mapping).
  3. Check the values. A required field that is not at its mapped path, a negative stake or settlement, odds of 0 or less, or a timestamp more than 24 hours ahead answers 422 mapping_error with the canonical field that failed.

In a batch, a refused item does not stop the others: its result has status: "error" and an error that starts with validation_error: or mapping_error:.

Canonical Fields ​

FieldTypeRequiredDescription
userIdstringyesYour user identifier
externalBetIdstringyesYour bet identifier
stakeAmountnumberyesBet stake amount
oddsnumberyesDecimal odds
statusstringyesplaced, settled-won, settled-lost, voided
betTypeIdentifierstringnoBet type (single, accumulator, etc.)
eventTimestampstringnoISO 8601 timestamp; the time of arrival when missing
isCashOutbooleannoWhether this is a cash-out settlement
settlementAmountnumbernoTotal return on settlement
selectionsintegernoNumber of selections in an accumulator, checked against the ruleset's maximum

These are the only keys a mapping may use. A mapping with any other key, or with a path that has an empty segment, is refused with 400 validation_error.

Example Mapping ​

If your payload looks like this:

json
{
  "player_id": "user-001",
  "bet_ref": "BET-12345",
  "amount": 10.0,
  "decimal_odds": 2.5,
  "type": "single",
  "state": "placed",
  "is_early_cashout": false,
  "legs": 1
}

Configure this mapping:

bash
curl -X POST https://api.fundedfast.eu/v1/admin/adapters \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "mappingConfig": {
      "userId": "player_id",
      "externalBetId": "bet_ref",
      "stakeAmount": "amount",
      "odds": "decimal_odds",
      "betTypeIdentifier": "type",
      "status": "state",
      "isCashOut": "is_early_cashout",
      "selections": "legs"
    }
  }'

Your backend can make the same call with its server key in X-API-Key once the key has admin scope (see Authentication). Then send the payload above, unchanged, to POST /v1/bets.

Dot Notation for Nested Fields ​

If your payload nests fields inside objects, use dot notation:

json
{
  "player": {
    "id": "user-001"
  },
  "ticket": {
    "ref": "BET-12345",
    "wager": 10.0
  },
  "odds": 2.5,
  "state": "placed"
}

Mapping config:

json
{
  "mappingConfig": {
    "userId": "player.id",
    "externalBetId": "ticket.ref",
    "stakeAmount": "ticket.wager",
    "status": "state"
  }
}

odds is not mapped here, so it is read from the odds field of the same name.

Status Value Mapping ​

A mapping moves fields; it does not translate values. FAST expects these status strings, so if your system uses different values, translate them in your backend before sending to FAST:

FAST StatusDescription
placedBet accepted, not yet settled
settled-wonBet settled as a win
settled-lostBet settled as a loss
voidedBet cancelled or refunded: an open bet's stake is released, and a settled bet's result is reversed

Testing via Admin Dashboard ​

The operator backoffice includes a "Test Mapping" feature on the Adapter Mappings page. Paste a sample payload and verify that FAST correctly extracts all canonical fields before going live. Then send one bet to POST /v1/bets/validate on your staging tenant: it reads the payload exactly as POST /v1/bets does and records nothing.

Managing Mappings ​

A tenant has one mapping. Creating a second one answers 409 conflict: update the existing one instead. A create, update or delete applies to the very next bet.

MethodEndpointPurpose
GET/v1/admin/adaptersThe current mapping: {adapters: [...]}, empty or one item
POST/v1/admin/adaptersCreate the mapping from {mappingConfig}: 201 {adapter}, or 409 conflict if one exists
PUT/v1/admin/adapters/:idReplace its mappingConfig: {adapter}, or 404 not_found
DELETE/v1/admin/adapters/:idRemove it: {deleted: true}, or 404 not_found; bets must then use the canonical names

BLACKLINE CONSULTING d.o.o.