Delegation Endpoints
The accounts, rates, quote, and order endpoints you implement for Lirium to call
These four endpoints are implemented and hosted by you, the Banking Partner. Lirium calls them to read Customer balances and rates, price an operation, and settle it. They are the counterpart to the Delegation Accounts product.
These are your endpointsUnlike the rest of the API Reference, these operations are not served by Lirium. You expose them on your own host, and Lirium acts as the client. Every request is authenticated with a JWT signed by Lirium — see Authenticating Lirium's requests.
All amounts are strings. Currency codes are uppercase (USD, ARS, BTC).
Get Accounts
Lists the Customer's accounts available on your platform, with their balances.
GET /accounts
Response
{
"accounts": [
{ "id": "1234", "currency": "ARS", "balance": "1000.00", "name": "Mi cuenta en pesos" },
{ "id": "abcd", "currency": "USD", "balance": "100.00", "name": "Mi cuenta en dólares" }
]
}| Field | Type | Required | Description |
|---|---|---|---|
accounts | array | Yes | The Customer's accounts. |
accounts[].id | string | Yes | Account identifier. An id lets a Customer hold more than one balance in the same currency. If you keep a single balance per currency and do not want to expose an account id, return the currency code as the id. |
accounts[].currency | string | Yes | Currency code of the account. |
accounts[].balance | string | Yes | Current balance, as a string. |
accounts[].name | string | No | Display name shown in the WebApp. If omitted, the WebApp builds a description from your partner name (e.g. Mi cuenta {partner_name}). |
Get Rates
Returns the rates for the currencies the Customer operates. Lirium uses them to price operations.
GET /rates
Response
{
"ARS": { "base": "USD", "quote": "ARS", "buy": "1400", "sell": "1350" },
"USD": { "base": "USD", "quote": "USD", "buy": "1.001", "sell": "0.999" }
}The response is keyed by currency code. Each entry describes the price of that currency against the settlement base.
| Field | Type | Required | Description |
|---|---|---|---|
base | string | Yes | Base currency of the pair. |
quote | string | Yes | Quote currency of the pair. |
buy | string | Yes | Price applied when the Customer is buying. |
sell | string | Yes | Price applied when the Customer is selling. |
Create Quote
Prices a debit or credit operation for the Customer. Lirium requests a quote whenever a Customer starts a buy or sell so it can show the final amount in the selected currency.
POST /quote
Depending on what the Customer entered, the amount can be denominated in either currency. Lirium sends the amount on the side it knows; you compute the missing amount, honoring the from → to direction.
Settlement in the account currencyEven when the settlement currency matches the Customer's account currency, Lirium still requests a quote. This lets you apply a different amount to account for a commission or operating cost.
Request
{
"from": { "currency": "ARS", "account_id": "1234" },
"to": { "currency": "USD", "amount": "101.23" }
}| Field | Type | Required | Description |
|---|---|---|---|
from.currency | string | Yes | Source currency. |
from.account_id | string | No | The Customer account the operation debits, when from is the account side. |
from.amount | string | No | Present when the operation is denominated on the from side. |
to.currency | string | Yes | Destination currency. |
to.account_id | string | No | The Customer account the operation credits, when to is the account side. |
to.amount | string | No | Present when the operation is denominated on the to side. |
Exactly one of from.amount / to.amount is present in the request. Fill in the other in the response.
Response
{
"from": { "currency": "ARS", "amount": "120000", "account_id": "1234" },
"to": { "currency": "USD", "amount": "101.23" },
"id": "xyz"
}| Field | Type | Required | Description |
|---|---|---|---|
from | object | Yes | Source side, with both currency and amount resolved. |
to | object | Yes | Destination side, with both currency and amount resolved. |
id | string | No | Quote identifier. If you return one, Lirium stores it and includes it as quote_id on the matching order, so you can honor the same price. |
Create Order
Executes the fiat transfer between the Customer's account and your settlement account.
POST /order
The operation states the direction of the transfer:
debit— debit the Customer account (asset) and credit your settlement account. Used when the Customer buys crypto.credit— debit your settlement account and credit the Customer account (asset). Used when the Customer sells crypto.
Use lirium_id as an idempotency key: if you receive the same value again (for example on a retry), return the original result instead of transferring again. If a quote_id is present, apply the price from that quote.
Request
{
"operation": "debit",
"asset": { "id": "1234", "currency": "ARS", "amount": "120000" },
"settlement": { "currency": "USD", "amount": "101.23" },
"quote_id": "xyz",
"lirium_id": "a1b2c3e4f5"
}| Field | Type | Required | Description |
|---|---|---|---|
operation | string | Yes | debit or credit. Direction of the fiat transfer. |
asset.id | string | Yes | The Customer account to move funds on. |
asset.currency | string | Yes | Currency of the Customer account. |
asset.amount | string | Yes | Amount to move on the Customer account, as quoted. |
settlement.currency | string | Yes | Currency of your settlement account. |
settlement.amount | string | Yes | Amount to move on your settlement account, as quoted. |
quote_id | string | No | The quote to apply, when one was returned by POST /quote. |
lirium_id | string | Yes | ID of the order in Lirium. Idempotency key for the transfer. |
If the rate moved and the Customer amount changed, return the updated final amount in the response.
Response
{
"id": "x",
"state": "completed",
"operation": "debit",
"asset": { "id": "1234", "currency": "ARS", "amount": "120000" },
"settlement": { "currency": "USD", "amount": "101.23" },
"quote_id": "xyz",
"lirium_id": "a1b2c3e4f5"
}| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Your identifier for the transfer. |
state | string | Yes | Final state of the transfer, e.g. completed. |
operation | string | Yes | Echoes the request operation. |
asset | object | Yes | The Customer side of the transfer, with the final amount. |
settlement | object | Yes | The settlement side of the transfer, with the final amount. |
quote_id | string | No | Echoes the request quote_id, when present. |
lirium_id | string | Yes | Echoes the request lirium_id. |
Updated 3 days ago
