Skip to content

Quickstart ​

Give a customer an address, take a payment on it, and send a payout. Each step ends in a state you can check.

Before you start ​

VariableValue
$FIATLESS_URLThe install's API origin, from its operator
$FIATLESS_KEYAn API key with ledger:read, wallets:write, payouts:write and webhooks:manage
$WEBHOOK_URLAn https URL on your server that answers 2xx; plain http works too, with events sent in clear text

1. Pick a network and an asset ​

List the networks, then one network's assets. Pick one whose capabilities allow deposit. A request names a network by its code, which stays the same when you move from a testnet install to a mainnet one.

sh
curl -sS "$FIATLESS_URL/api/v1/networks" \
  -H "Authorization: Bearer $FIATLESS_KEY"

200 OK

json
{
  "data": [
    {
      "id": "3a6a1d9d-e8ec-4808-a296-d6be30c8fdd3",
      "code": "bitcoin",
      "family": "bitcoin",
      "name": "Bitcoin Signet",
      "native_symbol": "BTC",
      "testnet": true,
      "explorer_tx_url": "https://mempool.space/signet/tx/{tx_hash}",
      "confirmations": { "required": 6 },
      "address_type": "p2tr"
    }
  ],
  "next_cursor": null
}
sh
curl -sS "$FIATLESS_URL/api/v1/assets?network=$NETWORK" \
  -H "Authorization: Bearer $FIATLESS_KEY"

200 OK

json
{
  "data": [
    {
      "id": "88ff7129-30fb-5f41-ae6b-f6d93eea1bc9",
      "code": "btc",
      "network": "bitcoin",
      "network_id": "3a6a1d9d-e8ec-4808-a296-d6be30c8fdd3",
      "standard": "native",
      "decimals": 8,
      "onchain_identity": null,
      "name": "Bitcoin",
      "symbol": "BTC",
      "logo_url": "/static/btc.svg",
      "capabilities": { "deposit": true, "payout": true }
    }
  ],
  "next_cursor": null
}

Done when you hold the network's code and the asset's id.

2. Register an endpoint ​

Register it first: an endpoint gets only events published after it exists.

sh
curl -sS "$FIATLESS_URL/api/v1/webhook-endpoints" \
  -H "Authorization: Bearer $FIATLESS_KEY" \
  --json @- <<JSON
{"url": "$WEBHOOK_URL"}
JSON

201 Created

json
{
  "id": "0b6f3a52-7c1d-4a8e-9f10-2d3c4b5a6e7f",
  "url": "https://example.com/fiatless/events",
  "description": null,
  "status": "active",
  "events": null,
  "created_at": "2026-09-24T09:00:01Z",
  "updated_at": "2026-09-24T09:00:01Z",
  "secret": "whsec_…"
}

events null is every event type; send a list in events to take only some. The same URL again answers 200 with the same endpoint and no secret: if you lose the secret, rotate it. The secret is in the form Standard Webhooks defines, so its libraries verify each event with it as it is.

Danger

Anyone who holds the secret can sign events your server will trust. Keep it out of logs and source code.

Done when the secret is stored on your server. To check your handler now, call sendWebhookTestEvent: it sends one signed endpoint.test event.

3. Create a customer address ​

Send the customer's reference as external_id, with the assets to accept. The answer holds the address.

sh
curl -sS "$FIATLESS_URL/api/v1/wallets" \
  -H "Authorization: Bearer $FIATLESS_KEY" \
  -H "Idempotency-Key: signup-8842" \
  --json @- <<JSON
{"network": "$NETWORK", "external_id": "8842", "asset_ids": ["$ASSET_ID"]}
JSON

201 Created · Location: /api/v1/wallets/{id}

json
{
  "id": "1080986a-b3b8-458c-a9cb-855f77f0189a",
  "external_id": "8842",
  "network_id": "3a6a1d9d-e8ec-4808-a296-d6be30c8fdd3",
  "address": "tb1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0wasjpkd5c",
  "asset_ids": ["88ff7129-30fb-5f41-ae6b-f6d93eea1bc9"],
  "created_at": "2026-09-24T09:00:02Z"
}

Read it again at any time with getWallet.

sh
curl -sS "$FIATLESS_URL/api/v1/wallets/$WALLET_ID" \
  -H "Authorization: Bearer $FIATLESS_KEY"

200 OK

json
{
  "id": "1080986a-b3b8-458c-a9cb-855f77f0189a",
  "external_id": "8842",
  "network_id": "3a6a1d9d-e8ec-4808-a296-d6be30c8fdd3",
  "address": "tb1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0wasjpkd5c",
  "asset_ids": ["88ff7129-30fb-5f41-ae6b-f6d93eea1bc9"],
  "created_at": "2026-09-24T09:00:02Z"
}

Warning

Only assets in asset_ids are credited automatically. Another active asset sent to the address waits for the operator: see Customer addresses.

Done when the customer's address is stored on your server.

4. Receive a payment ​

A payment needs a chain, so this step has no call. Once one confirms, your endpoint receives transaction.confirmed:

json
{
  "id": "6b1e0c52-3f4a-4c8e-9a17-0d2b5e8f1a13",
  "type": "transaction.confirmed",
  "aggregate_type": "chain_transaction",
  "aggregate_id": "8d4e1f22-0c9a-4b3e-9d17-5a6b7c8d9e0f",
  "schema_version": 1,
  "occurred_at": "2026-09-24T09:31:48.204519Z",
  "data": {
    "transaction_id": "8d4e1f22-0c9a-4b3e-9d17-5a6b7c8d9e0f",
    "network_id": "7845483d-e3b5-4754-bcec-cc6c2019ad89",
    "tx_hash": "0x4a8f1c2d3e5b6a7980c1d2e3f4a5b6c7d8e9f00112233445566778899aabbcc",
    "status": "confirmed",
    "amounts": [
      {
        "asset_id": "311d52dc-f56b-40b3-b77d-b68fab806e29",
        "amount": "0.015"
      }
    ],
    "wallets": [
      {
        "wallet_id": "1080986a-b3b8-458c-a9cb-855f77f0189a",
        "external_id": "customer-42",
        "amounts": [
          {
            "asset_id": "311d52dc-f56b-40b3-b77d-b68fab806e29",
            "amount": "0.015"
          }
        ]
      }
    ],
    "inclusion_block_hash": "0x000000000000000a3c2b1f0e9d8c7b6a5f4e3d2c1b0a99887766554433221100",
    "canonicality_generation": 1
  }
}

Verify the signature, store the event once by its id, then answer 2xx. Each entry in wallets is a customer the payment paid, named by your external_id: set that customer's credit for this transaction and asset to the entry's amount. A later transaction.reverted sets those credits back to 0. Skip an event not newer than the last you applied for the transaction, by canonicality_generation and then occurred_at. A transaction.detected only says the payment is on its way: set its credits to 0 and show it as pending. Payments has the whole rule.

Done when the event is stored once, its customer is credited, and it is answered with 2xx.

5. Check the balance ​

The balance is per asset, for the whole install.

sh
curl -sS "$FIATLESS_URL/api/v1/balances?network=$NETWORK" \
  -H "Authorization: Bearer $FIATLESS_KEY"

200 OK

json
{
  "network_id": "3a6a1d9d-e8ec-4808-a296-d6be30c8fdd3",
  "balances": [
    {
      "network_id": "3a6a1d9d-e8ec-4808-a296-d6be30c8fdd3",
      "asset_id": "88ff7129-30fb-5f41-ae6b-f6d93eea1bc9",
      "confirmed": "0.5",
      "held": "0",
      "available": "0.5",
      "spendable": true
    }
  ]
}

Done when available covers the payout and its network fee, and spendable is true.

6. Send a payout ​

Payouts leave from the treasury. A payout the treasury cannot fund yet waits in queued: see When money is short.

sh
curl -sS "$FIATLESS_URL/api/v1/payouts" \
  -H "Authorization: Bearer $FIATLESS_KEY" \
  --json @- <<JSON
{"source": "treasury", "asset_id": "$ASSET_ID", "amount": "0.1",
 "destination": {"address": "tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"},
 "fee_policy": "normal", "external_id": "payout-8842"}
JSON

202 Accepted · Location: /api/v1/payouts/{id}

json
{
  "id": "c17401b0-2256-438c-b9fd-4b860c9216a7",
  "network_id": "3a6a1d9d-e8ec-4808-a296-d6be30c8fdd3",
  "asset_id": "88ff7129-30fb-5f41-ae6b-f6d93eea1bc9",
  "source": "treasury",
  "amount": "0.1",
  "destination": {
    "address": "tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx",
    "type": "address",
    "tag": null,
    "memo": null
  },
  "fee_policy": "normal",
  "external_id": "payout-8842",
  "status": "queued",
  "waiting_reason": null,
  "chain_transaction_id": null,
  "tx_hash": null,
  "failure": null,
  "transaction": null,
  "completed_at": null,
  "created_at": "2026-09-24T09:00:05Z",
  "updated_at": "2026-09-24T09:00:05Z"
}
Payout · payout
  1. queuedpayout.queued
  2. signingno event
  3. broadcastpayout.broadcastpayout.reorg_resolved
  4. confirmingpayout.confirmingpayout.reorg_resolved
  5. confirmedfinalpayout.confirmedpayout.reorg_resolved
  6. failedfinalpayout.failedpayout.reorg_resolved

Can return to queued from signing and broadcast.

After a reorg: reorged, sent as payout.reorg_detected.

Danger

A payout cannot be cancelled. Check the destination before you send.

Retry with the same external_id: a repeat answers with this payout, however late, and never queues a second one.

Done when payout.confirmed arrives, or getPayout shows status: "confirmed".