Amba

Currencies

Current user's balances across all defined currencies, plus transaction history.

Users don't need to have opened a user_balances row — /client/currencies synthesizes a zero-balance entry for every currency definition if the user has none yet.

Source: apps/api/src/routes/client/currencies.ts.

Endpoints

MethodPathDescription
GET/client/currenciesBalances for every defined currency (synthetic if no user_balance row).
GET/client/currencies/transactionsPaginated transaction history, optional ?currency_code=.

GET /client/currencies

Response 200

{
  "data": [
    {
      "currency_code": "gems",
      "name": "Gems",
      "is_premium": false,
      "balance": 100,
      "lifetime_earned": 150,
      "lifetime_spent": 50
    }
  ]
}

Errors

  • 500 FETCH_FAILED.

Try it:

GET/client/currencies
client auth
curl -X GET 'https://api.amba.dev/client/currencies'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/currencies' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

GET /client/currencies/transactions

Query

ParamDefault
limit50
offset0
currency_code— (all currencies)

Response 200

{
  "data": [
    {
      "id": "…",
      "currency_code": "gems",
      "amount": 50,
      "balance_after": 150,
      "transaction_type": "grant",
      "source": "admin",
      "created_at": "…"
    }
  ],
  "total": 42,
  "offset": 0,
  "limit": 50
}

Try it:

GET/client/currencies/transactions
client auth
curl -X GET 'https://api.amba.dev/client/currencies/transactions'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/currencies/transactions' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

On this page