Skip to content

Create a settlement quote

POST
/api/v4/partner/settlement/quote

Generate a settlement quote for one or more beneficiaries. The returned quote must be used in the settlement execution step before the confirm deadline.

Authorizations

ApiKeyAuth
Type
API Key (header: X-Api-Key)

Request Body

application/json
JSON
{
"currency": "EUR",
"network": "ethereum",
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"beneficiaries": [
{
"externalTransactionId": "string",
"customerId": "customer_a1b2c3d4",
"customerAddress": "0x1234....abcd",
"quoteType": "fiat_to_token",
"amount": "99.99"
}
]
}

Responses

OK

application/json
JSON
{
"status": "ok",
"payload": {
"quoteId": "79a89717-3690-4db0-b434-39e25df01d55",
"timestamp": 1724247261,
"confirmDeadline": 1724247261,
"currency": "EUR",
"network": "ethereum",
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"totalAmountIn": "2811.242231",
"totalAmountSettled": "2623.34",
"totalAmountGBPReference": "2270.40",
"beneficiaries": [
{
"externalTransactionId": "string",
"customerId": "customer_a1b2c3d4",
"customerAddress": "0x1234....abcd",
"amountIn": "171.684232",
"amountSettled": "165.23",
"amountGBPReference": "142.99"
}
]
}
}

Playground

Authorization
Body

Samples

Powered by VitePress OpenAPI

Code examples

bash
curl -X POST https://api.brrr.network/api/v4/partner/settlement/quote \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "EUR",
    "network": "ethereum",
    "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "beneficiaries": [
      {
        "externalTransactionId": "txn_001",
        "customerId": "cust_a1b2c3d4",
        "customerAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
        "quoteType": "fiat_to_token",
        "amount": "100.00"
      }
    ]
  }'
javascript
const response = await fetch('https://api.brrr.network/api/v4/partner/settlement/quote', {
  method: 'POST',
  headers: {
    'X-Api-Key': process.env.BRRR_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    currency: 'EUR',
    network: 'ethereum',
    token: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC on Ethereum
    beneficiaries: [
      {
        externalTransactionId: 'txn_001',
        customerId: 'cust_a1b2c3d4',
        customerAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
        quoteType: 'fiat_to_token',
        amount: '100.00', // EUR amount to settle
      },
    ],
  }),
});

if (!response.ok) {
  const error = await response.json();
  throw new Error(`Quote creation failed: ${error.errorCode}`);
}

const data = await response.json();
const quote = data.payload;

console.log('Quote ID:', quote.quoteId);
console.log('Confirm before:', new Date(quote.confirmDeadline * 1000).toISOString());
console.log('Total token amount to send:', quote.totalAmountIn);

// Store quote — pass it as the body to execute-settlement
python
import os
import httpx
from datetime import datetime

response = httpx.post(
    'https://api.brrr.network/api/v4/partner/settlement/quote',
    headers={
        'X-Api-Key': os.environ['BRRR_API_KEY'],
        'Content-Type': 'application/json',
    },
    json={
        'currency': 'EUR',
        'network': 'ethereum',
        'token': '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',  # USDC on Ethereum
        'beneficiaries': [
            {
                'externalTransactionId': 'txn_001',
                'customerId': 'cust_a1b2c3d4',
                'customerAddress': '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
                'quoteType': 'fiat_to_token',
                'amount': '100.00',  # EUR amount to settle
            }
        ],
    },
)
response.raise_for_status()
data = response.json()
quote = data['payload']

print(f"Quote ID: {quote['quoteId']}")
print(f"Confirm before: {datetime.fromtimestamp(quote['confirmDeadline']).isoformat()}")
print(f"Total token amount to send: {quote['totalAmountIn']}")

# Store quote — pass it as the body to execute-settlement

Quote expiry

Each quote has a 15-minute validity window. The confirmDeadline field in the response is a Unix timestamp indicating the latest time you can call Execute Settlement. After that, the quote is expired and a new one must be created.