Appearance
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:
- 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.
- 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 answers400 validation_error, and with a mapping the message ends in(after the adapter mapping). - 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_errorwith the canonicalfieldthat 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
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | yes | Your user identifier |
externalBetId | string | yes | Your bet identifier |
stakeAmount | number | yes | Bet stake amount |
odds | number | yes | Decimal odds |
status | string | yes | placed, settled-won, settled-lost, voided |
betTypeIdentifier | string | no | Bet type (single, accumulator, etc.) |
eventTimestamp | string | no | ISO 8601 timestamp; the time of arrival when missing |
isCashOut | boolean | no | Whether this is a cash-out settlement |
settlementAmount | number | no | Total return on settlement |
selections | integer | no | Number 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 Status | Description |
|---|---|
placed | Bet accepted, not yet settled |
settled-won | Bet settled as a win |
settled-lost | Bet settled as a loss |
voided | Bet 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.
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /v1/admin/adapters | The current mapping: {adapters: [...]}, empty or one item |
| POST | /v1/admin/adapters | Create the mapping from {mappingConfig}: 201 {adapter}, or 409 conflict if one exists |
| PUT | /v1/admin/adapters/:id | Replace its mappingConfig: {adapter}, or 404 not_found |
| DELETE | /v1/admin/adapters/:id | Remove it: {deleted: true}, or 404 not_found; bets must then use the canonical names |