### Query Documentation via HTTP GET Source: https://docs.fiat24.com/user/payments Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query the documentation. Use this when the answer is not explicitly present, for clarification, or to retrieve related sections. ```http GET https://docs.fiat24.com/user/payments.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Perform an HTTP GET request with the `ask` query parameter to dynamically query the documentation for additional information or clarification. ```javascript GET https://docs.fiat24.com/developer/integration-guide/part-2-api-reference.md?ask= ``` -------------------------------- ### Perform HTTP GET Request to Query Documentation Source: https://docs.fiat24.com/user/misc/fiat24-nft Use this method to query documentation dynamically when information is not explicitly present. The question should be specific and self-contained. ```http GET https://docs.fiat24.com/user/misc/fiat24-nft.md?ask= ``` -------------------------------- ### Successful Bank Details Response Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Example JSON response for a successful retrieval of bank details based on an IBAN. ```json { "name" : "Zürcher Kantonalbank", "bankCode" : "00700", "bankCodes" : ["00700",,"00730","00754","00755","30700"], "bic" : "ZKBKCHZZXXX", "country" : "CH", "accountMask" : "CH00\\0\\07\\0\\0************", "accountPlaceholder":"CH0000700000000000000", "accountNotice":"" } ``` -------------------------------- ### Perform HTTP GET Request to Query Documentation Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Use this method to query documentation dynamically. The question should be specific and self-contained. The response includes a direct answer and relevant excerpts. ```http GET https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts.md?ask= ``` -------------------------------- ### Show Debit Card using JavaScript Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Integrates the fiat24card.js service to display debit card details. Ensure the cardToken is valid and the fiat24card.js file is accessible. This example is for React. ```javascript // Step 1. Download the file in: // https://www.fiat24.com/js/fiat24card.js // Step 2. Integrate code (Sample in React) // This code only gives you the card details, // you may need to modify the CSS and HTML to fit your needs import React, { useEffect } from "react"; import { isMobile, toastbox } from "utils/util"; export default function Fiat24Card({ cardToken, cardHolder }) { useEffect(() => { if (!!cardToken) { const mobile = isMobile(); if (!window.fiat24card) { require("public/js/fiat24card.js"); // path to your fiat24card.js } if (!!window.fiat24card) { window.fiat24card.bootstrap({ "clientAccessToken": cardToken, "component": { "showPan": { "cardPan": { "domId": "cardNumbers", "format": true, "styles": { "span": { "background": "transparent", "color": "#000", "font-size": mobile ? "1em" : "23px", "font-family": '"Helvetica Neue",Helvetica-Neue,HelveticaNeue,Helvetica, Arial, "Lucida Grande", sans-serif', "letter-spacing": "2px", "font-weight": "500" } } }, "copyCardPan": { "domId": "cardNumbersCopy", "mode": "transparent", "onCopySuccess": () => toastbox("toastCopied", 2000), "onCopyFailure": error => { console.error(error); } }, "cardExp": { "domId": "cardExpiryDate", "format": true, "styles": { "span": { "background": "transparent", "color": "#000", "font-family": '"Helvetica Neue",Helvetica-Neue,HelveticaNeue,Helvetica, Arial, "Lucida Grande", sans-serif', "letter-spacing": "2px", "font-weight": "500" } } }, "cardCvv": { "domId": "cardCvvDate", "styles": { "span": { "background": "transparent", "color": "#000", "font-family": '"Helvetica Neue",Helvetica-Neue,HelveticaNeue,Helvetica, Arial, "Lucida Grande", sans-serif', "letter-spacing": "2px", "font-weight": "500" } } } } }, "callbackEvents": { "onSuccess": () => { console.log("Success!") }, "onFailure": error => { console.error("Unable to get card details"); } } }); } } }, [cardToken]); return (<>
``` -------------------------------- ### Bank Master Data Response Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Example JSON response containing bank master data, including 'lastUpdateAt' for version checking and a list of banks categorized by country. ```json { "lastUpdateAt": 1756374790409, "banks": { "CH": [ { "name": "UBS AG", "bankCode": "00315", "bankCodes": [ "00315" ], "bic": "UBSBCHZZXXX", "country": "CH", "accountMask": "CH00\\0\\0315************", "accountPlaceholder": "CH0000315000000000000", "accountNotice": "" }, { "name": "Credit Suisse (Schweiz) AG", "bankCode": "04835", "bankCodes": [ "04106", "04251", "04425", "04835", "31000", "31881" ], "bic": "CRESCHZZXXX", "country": "CH", "accountMask": "CH00\\04835************", "accountPlaceholder": "CH0004835000000000000", "accountNotice": "" } ... ] } } ``` -------------------------------- ### Forex Rates Response Body Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Example response body for the forex rates API, showing currency pairs with their interbank rate, bid, ask, and last updated time. ```json { ... "CNHCHF": { "rate": 0.1203, "bid": 0.1191, "ask": 0.1215, "lastUpdateAt": 1710402772084 }, "USDGBP": { "rate": 0.7647, "bid": 0.7571, "ask": 0.7723, "lastUpdateAt": 1710402772084 }, ... } ``` -------------------------------- ### Verify SEPA QR Code Request Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference This GET request is used to verify a SEPA QR code. Ensure the QR code data is URL-encoded and passed in the 'qr' parameter. ```javascript GET https://api.fiat24.com/verify?qr=BCD%0A001%0A1%0ASCT%0ANTSBDEB1XXX%0ABlueRabbIT%0ADE59100110012628958324%0AEUR1043.62%0A%0A%0AInvoice%20%23%2016%20Customer%20%23%201%201st%20January%202021%0A ``` -------------------------------- ### Bank Payout Error Example Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference This snippet shows an example of an error response for an invalid IBAN during a bank payout. ```json { "error": "Invalid IBAN." } ``` -------------------------------- ### Get Cards Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Retrieves the Debit Cards information from a user. ```APIDOC ## GET /cards ### Description Get the Debit Cards information from a user. ### Method GET ### Endpoint https://api.fiat24.com/cards ### Response #### Success Response (200) - **[Card details]** (object) - Information about the user's debit cards. ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.fiat24.com/user/account-types Perform an HTTP GET request to query the documentation dynamically. Use the `ask` query parameter with a specific, self-contained question in natural language. The response will contain a direct answer and relevant excerpts. ```http GET https://docs.fiat24.com/user/account-types.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.fiat24.com/developer/release-notice/2025-02-01 Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query documentation. The question should be specific and self-contained. Use this mechanism when the answer is not explicitly present, for clarification, or to retrieve related documentation sections. ```http GET https://docs.fiat24.com/developer/release-notice/2025-02-01.md?ask= ``` -------------------------------- ### Get Transactions Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Retrieves transaction data for a user. Supports filtering by currency, pagination, and time range. ```APIDOC ## GET /transactions ### Description Retrieves transaction data for a user. Supports filtering by currency, pagination, and time range. ### Method GET ### Endpoint /transactions ### Parameters #### Query Parameters - **currency** (string) - Required - Specifies the currency for transactions (e.g., EUR, USD, CHF, CNH, ALL). Note: 'ALL' may have a delay. - **fromrecord** (integer) - Optional - Used for pagination, indicates the starting record number. - **recordscount** (integer) - Optional - Used for pagination, specifies the number of records to retrieve. - **fromtimestamp** (integer) - Optional - Unix timestamp to filter transactions from. - **totimestamp** (integer) - Optional - Unix timestamp to filter transactions until. - **direction** (string) - Optional - Filters transactions by direction ('IN', 'OUT', 'ALL'). Defaults to 'ALL'. - **type** (string) - Optional - Filters transactions by type(s), separated by commas (e.g., 'P2P,FRX'). Supported types: P2P, FRX, CTU, CRD, CDP, CWD. ### Request Example ``` GET https://api.fiat24.com/transactions?currency=EUR&fromrecord=0&recordscount=6 ``` ### Response #### Success Response (200) - **transactions** (array) - A list of transaction objects. - **currency** (string) - The currency of the transaction. - **fromrecord** (integer) - The record number. - **recordscount** (integer) - The count of records retrieved. - **fromtimestamp** (integer) - The starting timestamp. - **totimestamp** (integer) - The ending timestamp. - **direction** (string) - The direction of the transaction ('IN', 'OUT', 'ALL'). - **type** (string) - The type of the transaction (e.g., 'P2P', 'FRX'). #### Response Example ```json { "transactions": [ { "currency": "EUR", "fromrecord": 0, "recordscount": 6, "fromtimestamp": 1683797408116, "totimestamp": 1683897408116, "direction": "IN", "type": "P2P" } ] } ``` ``` -------------------------------- ### Error Response for Bank Details Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Example JSON response when an error occurs during the retrieval of bank details by IBAN. ```json { ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.fiat24.com/products/pricing-for-business Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query the documentation. The question should be specific and in natural language. Use this for clarification or to retrieve related sections. ```http GET https://docs.fiat24.com/products/pricing-for-business.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.fiat24.com/developer/release-notice Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query documentation. The question should be specific, self-contained, and written in natural language. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. ```http GET https://docs.fiat24.com/developer/release-notice.md?ask= ``` -------------------------------- ### Get Balances Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Retrieves the user's multi-currency account balances. All Fiat24 cash tokens have a decimal of 2. ```APIDOC ## Get Balances ### Description Retrieves the user's multi-currency account balances. All Fiat24 cash tokens have a decimal of 2. ### Methods #### `balanceOf(address)` Retrieves balances for a given address. #### `balanceOfByAccountId(nftId)` Retrieves balances for a specific NFT ID. ### Request Example ```javascript //Read from Address parseFloat((parseInt(await usd24.balanceOf(address))/100).toFixed(2)); //Read from NFT id #10365 parseFloat((parseInt(await usd24.balanceOfByAccountId(10365))/100).toFixed(2)); ``` ``` -------------------------------- ### Execute Exchange: Buy Exact Amount Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Illustrates how to execute a currency exchange when the exact amount of the output currency to buy is known. This involves calculating the required input amount considering exchange rates and spreads, approving the token, and then calling `moneyExchangeExactOut`. ```javascript // Get exchange rate, here USD24/EUR24 const fx_eur24_usd24 = parseInt(await fiat24cryptodeposit.getExchangeRate(EUR24_ADDRESS, USD24_ADDRESS)); // Get reversed spread const reversespread_usd24_eur24 = parseInt(await fiat24cryptodeposit.getSpread(USD24_ADDRESS, EUR24_ADDRESS, true)); // Get estimated input amount in USD24 for 10.00 EUR var usd24_input_amount = Math.floor((1000*fx_eur24_usd24)/10000); usd24_input_amount = Math.floor((usd24_input_amount*reversespread_usd24_eur24)/10000); try { var tx = await usd24.approve(FIAT24_CRYPTO_TOP_UP_ADDRESS, usd24_input_amount); var receipt = tx.wait(); tx = await fiat24cryptodeposit.moneyExchangeExactOut(USD24_ADDRESS, EUR24_ADDRESS, 1000); receipt = tx.wait(); } catch(err) { console.error(err); } ``` -------------------------------- ### Failed Email Update Response Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference This is the response body when the email update fails, for example, due to an existing email address. ```json { "statusCode" : 401 } ``` -------------------------------- ### Execute GMX/EUR24 Top-up via WETH Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Approves the Fiat24 contract to spend GMX tokens and then performs a static call to `depositTokenViaEth` to estimate the EUR24 output. Ensure GMX is approved before calling. ```javascript try { const tx = await gmx.approve(FIAT24_CRYPTO_TOP_UP_ADDRESS, "90000000000000000"); const receipt = await tx.wait(); } catch(err) { console.error(err); } eur24_amount = parseFloat((parseInt(await fiat24cryptodeposit.callStatic.depositTokenViaEth(GMX_ADDRESS, EUR24_ADDRESS, "90000000000000000"))/100).toFixed(2)); console.log("EUR24 amount for 0.09 GMX depositTokenViaUsdc() call:", eur24_amount); ``` -------------------------------- ### Retrieve Payment Purposes API Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Use this GET request to retrieve a list of static payment purposes. These are required for bank payouts. ```http GET https://api.fiat24.com/payment-purposes ``` -------------------------------- ### Execute Exchange: Sell Exact Amount Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Demonstrates how to execute a currency exchange when the exact amount of the input currency to sell is known. This involves approving the token and then calling `moneyExchangeExactIn`. ```javascript try { var tx = await usd24.approve(FIAT24_CRYPTO_TOP_UP_ADDRESS, 1000); var receipt = tx.wait(); tx = await fiat24cryptodeposit.moneyExchangeExactIn(USD24_ADDRESS, EUR24_ADDRESS, 1000); receipt = tx.wait(); } catch(err) { console.error(err); } ``` -------------------------------- ### Get Last 6 EUR Transactions Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Retrieve the most recent 6 transactions for the EUR currency. This is useful for a quick overview of recent activity. ```javascript GET https://api.fiat24.com/transactions? currency=EUR &fromrecord=0 &recordscount=6 ``` -------------------------------- ### Get Forex Rates Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Retrieve the latest foreign exchange rates, including interbank, bid, and ask rates, along with a timestamp of the last update. ```APIDOC ## GET /rates ### Description Fetches current foreign exchange rates for various currency pairs. ### Method GET ### Endpoint /rates ### Response #### Success Response (200) - **[CurrencyPair]** (object) - An object containing rate details for a specific currency pair (e.g., CNHCHF, USDGBP). - **rate** (number) - The interbank exchange rate. - **bid** (number) - The bid exchange rate. - **ask** (number) - The ask exchange rate. - **lastUpdateAt** (integer) - Timestamp of the last update in milliseconds. ### Response Example ```json { "CNHCHF": { "rate": 0.1203, "bid": 0.1191, "ask": 0.1215, "lastUpdateAt": 1710402772084 }, "USDGBP": { "rate": 0.7647, "bid": 0.7571, "ask": 0.7723, "lastUpdateAt": 1710402772084 } } ``` ``` -------------------------------- ### Perform HTTP GET Request with 'ask' Parameter Source: https://docs.fiat24.com/developer/terms-and-conditions-partners Use this method to dynamically query documentation. Append the 'ask' query parameter with your natural language question to the current page URL. The response will include a direct answer and relevant excerpts. ```HTTP GET https://docs.fiat24.com/developer/terms-and-conditions-partners.md?ask= ``` -------------------------------- ### Execute GMX/EUR24 Top-up via USDC Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Approves the Fiat24 contract to spend GMX tokens and then performs a static call to `depositTokenViaUsdc` to estimate the EUR24 output. Ensure GMX is approved before calling. ```javascript try { const tx = await gmx.approve(FIAT24_CRYPTO_TOP_UP_ADDRESS, "90000000000000000"); const receipt = await tx.wait(); } catch(err) { console.error(err); } eur24_amount = parseFloat((parseInt(await fiat24cryptodeposit.callStatic.depositTokenViaUsdc(GMX_ADDRESS, EUR24_ADDRESS, "90000000000000000"))/100).toFixed(2)); console.log("EUR24 amount for 0.09 GMX depositTokenViaUsdc() call:", eur24_amount); ``` -------------------------------- ### Get Country List Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Retrieve a list of countries relevant to Fiat24 services, including eligible domiciles for services, card issuance, and blacklisted nationalities. ```APIDOC ## GET /countries ### Description Fetches lists of eligible domiciles for services and card issuance, as well as blacklisted nationalities. ### Method GET ### Endpoint /countries ### Response #### Success Response (200) - **eligibleDomiciles** (array of strings) - ISO-3 country codes for eligible client domiciles. - **eligibleDomicilesForCards** (array of strings) - ISO-3 country codes for eligible client domiciles for obtaining a debit card. - **blacklistNationalities** (array of strings) - ISO-3 country codes for blacklisted nationalities. ### Response Example ```json { "eligibleDomiciles": [ "ALA", "AUS", "SWE", "TWN" ], "eligibleDomicilesForCards": [ "ALA", "AUT", "SWE", "CHE" ], "blacklistNationalities": [ "GUM", "IRN", "PRK", "MNP", "PRI", "RUS", "UMI", "USA" ] } ``` ``` -------------------------------- ### Get EUR Transactions Within a Period Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Fetch all EUR transactions that occurred between two specified timestamps. Ensure the timestamps are in milliseconds since the epoch. ```javascript GET https://api.fiat24.com/transactions? currency=EUR &fromtimestamp=1683797408116 &totimestamp=1683897408116 ``` -------------------------------- ### Get Account Status Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Retrieves the account status for a given token ID. The status is an integer representing different account states from soft-blocked to live. ```javascript const status = await fiat24account.status(tokenId); ``` -------------------------------- ### Signature Generation Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference This snippet demonstrates how to generate the necessary signature, hash, and deadline for secured API requests. ```APIDOC ## Signature Generation ### Description This section explains the process of generating the `sign`, `hash`, and `deadline` fields required for the secured API request headers. It involves obtaining a server timestamp, calculating a deadline, hashing a message, and signing it with the user's wallet. ### Steps 1. **Define Signature Deadline**: Set a maximum validity period for the signature (e.g., 1200 seconds). 2. **Get Server Timestamp**: Fetch the current server time to ensure accuracy. 3. **Calculate Deadline**: Add the signature deadline to the current server timestamp. 4. **Define Hash Message**: Specify the original text to be hashed (e.g., "Hello world"). 5. **Generate Deadline Hash**: Combine the hash message and deadline, then compute its SHA3 hash. 6. **Construct Message to Sign**: Create the final message by concatenating a predefined string with the deadline hash. 7. **Sign Message**: Use the user's wallet to sign the constructed message. ### Code Example ```javascript // We only allow the signature to be valid for 20 minutes max. // Can be less than that if want more security. const SIGNATURE_DEADLINE_IN_SECONDS = 1200; // Alternative to Date.now() // sometimes the device clock is out of sync and can give the wrong timestamp const serverTimestamp = await fetch("https://api.fiat24.com/timestamp"); const now = serverTimestamp.timestamp; const deadline = Math.round(now/1000) + SIGNATURE_DEADLINE_IN_SECONDS; const hash = "Hello world"; // Could be any text const deadlineHash = web3.utils.sha3(hash + deadline); // web3.js // const deadlineHash = ethers.keccak256(ethers.toUtf8Bytes(hash + deadline)); // ethers const messageToSign = `I agree to access my profile. ${deadlineHash}`; const sign = await web3.eth.personal.sign(messageToSign, address); // web3.js // const sign = await signer.signMessage(messageToSign); // ethers // Return these values to be included in the headers // return { hash, deadline, sign }; ``` ### Notes - The `network` field in the header is critical. Using different network values can result in different IBANs for the same request. - Ensure the SHA3 implementation used is compatible with `web3.utils.sha3()`. For example, `SHA3("Fiat24")` should yield `0x1cf688cdaa53bf4605bfbb1ab56565651179978e63d41cf2df557d5bb5f1bd90.` ``` -------------------------------- ### Execute Exact In Currency Exchange Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Use `moneyExchangeExactIn` to exchange a specified input amount for an output amount determined by the current exchange rate. Ensure the necessary addresses and amounts are provided. ```javascript tx = await fiat24cryptodeposit.moneyExchangeExactIn(USD24_ADDRESS, EUR24_ADDRESS, 1000); receipt = tx.wait(); ``` -------------------------------- ### Get IBAN from NFT ID (API) Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Use this endpoint to retrieve the Swiss IBAN associated with a specific Fiat24 NFT. The IBAN is derived from the NFT ID. ```javascript GET https://api.fiat24.com/iban/ ``` -------------------------------- ### Calculate ETH to EUR24 Deposit Output Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Calculates the estimated output amount in EUR24 for a crypto top-up deposit of ETH. It involves fetching pool fees, quotes, exchange rates, spreads, and fees before estimating the final amount. Also shows a static call to depositETH(). ```javascript // Get the correct xxx24 output amount of a crypto top-up depositETH(), here ETH/EUR24 // 1. Get Uniswap pool fee of most liquid pool for WETH/USDC var poolFee_weth_usdc = await fiat24cryptodeposit.getPoolFeeOfMostLiquidPool(GMX_ADDRESS, WETH_ADDRESS); // 2. Get quote for Uniswap WETH/USDC usdc_amount = Math.floor(parseInt(await fiat24cryptodeposit.callStatic.getQuote(WETH_ADDRESS, USDC_ADDRESS, poolFee_weth_usdc, "30000000000000000"))/10000); // 3. Get exchange rate USD24/EUR24 var fx_usd24_eur24 = parseInt(await fiat24cryptodeposit.getExchangeRate(USD24_ADDRESS, EUR24_ADDRESS)); // 4. Get spread var spread_usd24_eur24 = parseInt(await fiat24cryptodeposit.getSpread(USD24_ADDRESS, EUR24_ADDRESS, false)); // 5. Get fee var fee = parseInt(await fiat24cryptodeposit.getFee(tokenId, usdc_amount)); // 6. Get estimated output amount in EUR24 for 0.003 ETH var eur24_amount = Math.floor((usdc_amount-fee)*fx_usd24_eur24/10000); eur24_amount = Math.floor(eur24_amount*spread_usd24_eur24/10000); eur24_amount = parseFloat((eur24_amount/100).toFixed(2)); //var eur24_amount = parseFloat(((usdc_amount-fee)*fx_usd24_eur24*spread_usd24_eur24/10000/10000/100).toFixed(2)); console.log("EUR24 amount for 0.09 GMX:", eur24_amount); // OR just do a static call of depositETH() eur24_amount = parseFloat((parseInt(await fiat24cryptodeposit.callStatic.depositETH(EUR24_ADDRESS, {value: "30000000000000000"}))/100).toFixed(2)); console.log("EUR24 amount for 0.003 ETH depositETH() call:", eur24_amount); ``` -------------------------------- ### Verify QR Payment Request Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Initiate a QR payment by verifying the QR code string. This endpoint is the first step in enabling wallet providers to initialize QR payments for end users. ```javascript GET https://api.fiat24.com/verify?qr= ``` -------------------------------- ### GET Bank Master Data Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Retrieve the latest bank master data. Cache this JSON response locally and refresh periodically using the 'lastUpdateAt' timestamp. ```http GET https://api.fiat24.com/banks ``` -------------------------------- ### Calculate EUR24 Output for GMX/WETH Top-up Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Calculates the estimated EUR24 output for a GMX deposit via WETH. This involves multiple steps including getting pool fees for GMX/WETH and WETH/USDC, quotes, exchange rates, spreads, and fees. ```javascript // Get Uniswap pool fee of most liquid pool for GMX/WETH var poolFee_gmx_weth = await fiat24cryptodeposit.getPoolFeeOfMostLiquidPool(GMX_ADDRESS, WETH_ADDRESS); // Get quote for Uniswap GMX/USDC var weth_amount = await fiat24cryptodeposit.callStatic.getQuote(GMX_ADDRESS, WETH_ADDRESS, poolFee_gmx_weth, "90000000000000000"); // Get Uniswap pool fee of most liquid pool for WETH/USDC var poolFee_weth_usdc = await fiat24cryptodeposit.getPoolFeeOfMostLiquidPool(WETH_ADDRESS, USDC_ADDRESS); // Get quote for Uniswap GMX/USDC usdc_amount = Math.floor((await fiat24cryptodeposit.callStatic.getQuote(WETH_ADDRESS, USDC_ADDRESS, poolFee_weth_usdc, weth_amount))/10000); // Get exchange rate USD24/EUR24 fx_usd24_eur24 = parseInt(await fiat24cryptodeposit.getExchangeRate(USD24_ADDRESS, EUR24_ADDRESS)); // Get spread spread_usd24_eur24 = parseInt(await fiat24cryptodeposit.getSpread(USD24_ADDRESS, EUR24_ADDRESS, false)); // Get fee fee = parseInt(await fiat24cryptodeposit.getFee(tokenId, usdc_amount)); // Get estimated output amount in EUR24 for 0.09 GMX var eur24_amount = Math.floor((usdc_amount-fee)*fx_usd24_eur24/10000); eur24_amount = Math.floor(eur24_amount*spread_usd24_eur24/10000); eur24_amount = parseFloat((eur24_amount/100).toFixed(2)); console.log("EUR24 amount for 0.09 GMX:", eur24_amount); ``` -------------------------------- ### Verify Swiss QR Bill Request Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Use this GET request to verify a Swiss QR Bill. The QR code data should be URL-encoded in the 'qr' parameter. ```javascript GET https://api.fiat24.com/verify?qr=SPC%0D%0A0200%0D%0A1%0D%0ALI7830174502999200012%0D%0AS%0D%0ARobert%20Schneider%20AG%0D%0AMusterstrasse%0D%0A18%0D%0A9490%0D%0AVaduz%0D%0ALI%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A1949.75%0D%0ACHF%0D%0AS%0D%0AHans%20Mustermann%0D%0AMusterstrasse%0D%0A27a%0D%0A9490%0D%0AVaduz%0D%0ALI%0D%0AQRR%0D%0A210000000003139471430009017%0D%0AAuftrag%20vom%2015.06.2020%0D%0AEPD%0D%0A%2F%2FS1%2F11%2F200427%2F30%2F102673386%2F31%2F200427%2F32%2F7.7%2F40%2F0%3A30 ``` -------------------------------- ### Calculate EUR24 Output for GMX/USDC Top-up Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Calculates the estimated EUR24 output amount for a GMX deposit via USDC. This involves multiple steps including getting pool fees, quotes, exchange rates, spreads, and fees. ```javascript // Get Uniswap pool fee of most liquid pool var poolFee_uniswap = await fiat24cryptodeposit.getPoolFeeOfMostLiquidPool(GMX_ADDRESS, USDC_ADDRESS); // Get quote for Uniswap GMX/USDC var usdc_amount = Math.floor((await fiat24cryptodeposit.callStatic.getQuote(GMX_ADDRESS, USDC_ADDRESS, poolFee_uniswap, "90000000000000000"))/10000); // Get exchange rate USD24/EUR24 var fx_usd24_eur24 = parseInt(await fiat24cryptodeposit.getExchangeRate(USD24_ADDRESS, EUR24_ADDRESS)); // Get spread var spread_usd24_eur24 = parseInt(await fiat24cryptodeposit.getSpread(USD24_ADDRESS, EUR24_ADDRESS, false)); // Get fee var fee = parseInt(await fiat24cryptodeposit.getFee(tokenId, usdc_amount)); // Get estimated output amount in EUR24 for 0.09 GMX var eur24_amount = Math.floor((usdc_amount-fee)*fx_usd24_eur24/10000); eur24_amount = Math.floor(eur24_amount*spread_usd24_eur24/10000); eur24_amount = parseFloat((eur24_amount/100).toFixed(2)); console.log("EUR24 amount for 0.09 GMX:", eur24_amount); ``` -------------------------------- ### Get Client Profile Source: https://docs.fiat24.com/developer/integration-guide/part-2-api-reference Retrieves the information about a user's NFT account, including personal details, card eligibility, transaction limits, and contact information. ```APIDOC ## GET /br ### Description Get the information about user's NFT account. ### Method GET ### Endpoint https://api.fiat24.com/br ### Response #### Success Response (200) - **tokenId** (integer) - The user's token ID. - **br** (string) - The user's name. - **iban** (string) - The user's IBAN. - **email** (string) - The user's email address. - **mobile** (string) - The user's mobile number. - **debitCard** (string) - Indicates if a debit card is eligible ('MSTD' if eligible, empty otherwise). - **isCardEligible** (boolean) - True if a debit card is eligible, false otherwise. - **cards** (array) - Field only displayed if isCardEligible is true. Contains a list of cards. - **cardActivation** (object) - Field only displayed if isCardEligible is true and cards is empty. Contains activation details. - **amount** (integer) - The activation amount. - **currency** (string) - The currency of the activation amount. - **street** (string) - The user's street address. - **postalCode** (string) - The user's postal code. - **city** (string) - The user's city. - **country** (string) - The user's country code. - **limits** (object) - Transactional limits from the smart contract. - **restartDate** (string) - The restart date and time for limits. - **restartDateMs** (integer) - The restart date and time in milliseconds. - **used** (number) - The amount used within the limit (in CHF). - **available** (number) - The available amount within the limit (in CHF). - **max** (number) - The maximum limit (in CHF). - **contacts** (object) - A list of all registered Payout bank account details for the user, categorized by currency. - **[currency_code]** (array) - List of contact objects for a specific currency. - **id** (string) - The contact's ID. - **name** (string) - The contact's name. - **account** (string) - The contact's masked account number. - **fullAccount** (string) - The contact's full account number. - **bank** (string) - The contact's bank name. - **country** (string) - The contact's country code. - **lastPaymentDate** (integer) - The last payment date in milliseconds. - **depositBank** (object) - User's Fiat24 IBAN details for deposits, separated by currency. - **[currency_code]** (object) - Deposit bank details for a specific currency. - **account** (string) - The IBAN for deposits. - **bank** (string) - The bank name for deposits. - **BIC** (string) - The BIC code for deposits. - **payee** (string) - The payee name for deposits. - **city** (string) - The city of the deposit bank. - **street** (string) - The street of the deposit bank. - **postalCode** (string) - The postal code of the deposit bank. - **country** (string) - The country code of the deposit bank. ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "tokenId": 10365, "br": "Janet Jackson", "iban": "CH81 8305 1000 0000 1036 5", "email": "sample@gmail.com", "mobile": "+41798563254", "debitCard": "MSTD", "isCardEligible": true, "cards": [], "cardActivation": { "amount": 10, "currency": "EUR" }, "street": "Passeig Sant Gervasi", "postalCode": "08022", "city": "Barcelona", "country": "ESP", "limits": { "restartDate": "16.09.2023 - 9:04", "restartDateMs": 1725523620885, "used": 27.88, "available": 99972.12, "max": 100000.00 }, "contacts": { "CHF": [ { "id": "EC-0000001", "name": "Jake", "account": "•••• 0001", "fullAccount": "...", "bank": "PostFinance", "country": "CH", "lastPaymentDate": 1700093537000 } ], "EUR": [ { "id": "EC-0000002", "name": "Marc", "account": "•••• 1234", "fullAccount": "...", "bank": "PostFinance", "country": "ES", "lastPaymentDate": 1700093537000 } ] }, "depositBank": { "CHF": { "account": "CH8183051000000010365", "bank": "SR Saphirstein AG", "BIC": "SAHHCHZ2", "payee": "Janet Jackson", "city": "Barcelona", "street": "Passeig Sant Gervasi", "postalCode": "8022", "country": "ESP" }, "EUR": { "account": "CH8183051000000010365", "bank": "SR Saphirstein AG", "BIC": "SAHHCHZ2", "payee": "Janet Jackson", "city": "Barcelona", "street": "Passeig Sant Gervasi", "postalCode": "8022", "country": "ESP" } } } ``` ``` -------------------------------- ### Top-up ETH Source: https://docs.fiat24.com/developer/integration-guide/part-1-smart-contracts Performs a crypto top-up of ETH for xxx24 to EUR24 using the depositETH() function. This function directly handles ETH deposits. ```javascript //Top-up ETH for xxx24 using depositETH(), here ETH/EUR24 try { const tx = await fiat24cryptodeposit.depositETH(EUR24_ADDRESS, {value: "30000000000000000"}) const receipt = await tx.wait(); } catch(err) { console.error(err); } ```