Part 2: RESTful APIs

Introduction

This API (or Application Programming Interface) guide is a set of rules and protocols that defines how a 3rd party software can interact and exchange data with Fiat24 banking services.

These APIs extends the smart contract functions in Part 1 to access off-chain data.

Authentication & Access

Fiat24 does NOT use any standard protocol for authentication and authorization. All requests need to have a header with signed information by the NFT holder, which guarantees only the end-user can access his/her data.

To faciliate developer's integration work, we provide the signed header for our demo account #10365.

const headers = {
    tokenid: <token id of user>,
    network: 42161,
    sign: <user's wallet signature>,
    hash: <hash used for signing>,
    deadline: <deadline used for signing>,
    "Content-Type": "application/json"
}

where:

// 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;
const deadline = Math.round(Date.now()/1000) + SIGNATURE_DEADLINE_IN_SECONDS;

const messageToHash = "Hello world"; // Could be any text.

const deadlineHash = web3.utils.sha3(messageToHash + deadline);
const messageToSign = `I agree to access my profile. ${deadlineHash}`;
const sign = await signer.signMessage({
            message: messageToSign,
          });

return [ hash: messageToHash, deadline, sign ];

Functions

All RESTful interfaces are read-only functions, which retrieve off-chain data from Fiat24's backend system. All those data is very sensitive piece of data and they should be handled and stored with the upmost care.

1. Get Client Profile

Requires Authentication

Get the information about a specific account by NFT ID.

Request

GET https://api.fiat24.com/br

Response Body

{
    "tokenId": 10365,
    "br": "Janet Jackson",
    "debitCard": "WEUR",
    "iban": "CH81 8305 1000 0000 1036 5",
    "limits": {
                "restartDate": "16.09.2023 - 9:04",
                "used": 27.88, // value in CHF
                "available": 99972.12 // value in CHF
                "max": 100000.00 // value in CHF
    },
    "email" : "sample@gmail.com",
    "mobile" : "+41798563254",
    
    "contacts": {
       "CHF": [{
                "id": "EC-0000001",
                "name": "Jake"
                "account": "•••• 0001",
                "bank": "PostFinance",
                "country" : "CH",
                "lastPaymentDate" : 1700093537000
             },
             ...],
       "EUR": [{
                "id": "EC-0000002",
                "name": "Marc"
                "account": "•••• 1234",
                "bank": "PostFinance",
                "country" : "ES",
                "lastPaymentDate" : 1700093537000
             },
             ...],
       "USD": [{
                "id": "EC-0000003",
                "name": "Bob"
                "account": "•••• 5555",
                "bank": "PostFinance",
                "country" : "FR",
                "lastPaymentDate" : 1700093537000
             },
             ...],
       "GBP": [{
                "id": "EC-0000001",
                "name": "Alice"
                "account": "•••• 2323",
                "bank": "PostFinance",
                "country" : "CH",
                "lastPaymentDate" : 1700093537000
             },
             ...]
    },
    "depositBank": {
        "CHF": {
            "account" : "CH8183051000000010365",
            "bank"    : "SR Saphirstein AG",
            "BIC"     : "SAHHCHZ2",
            "payee"   : "Janet Jackson"
        },
        "EUR": {
            "account" : "CH8183051000000010365",
            "bank"    : "SR Saphirstein AG",
            "BIC"     : "SAHHCHZ2",
            "payee"   : "Janet Jackson"
        }
    }
}

Deposit Bank Account Details

The traditional way to fund user's Fiat24 account is to trigger a bank transfer or wire directly from the customer's account to our bank account in his/her currency. This Bank account detail endpoints are provided for users to fill in bank account details for such a deposit.

In order for us to link this in coming payment with a corresponding Fiat24 client, the individual creating bank transfer need to include specific text in the "payment reference" field. which is always user's token_id.

Payout Bank Account Details

This section returns a list with all registered Payout bank account details for the given user. Account receive options can also include local and international details to receive money on the currency balance.

2. Get Cards

Requires Authentication

Get the VISA Debit Cards information from a user.

Request

GET https://api.fiat24.com/cards

Response Body

If the card is not available, the 500 code is returned.

{
    "statusCode" : 500,
    "tokenId"    : 10365
}

If the card is found, the following data is returned

{ 
    statusCode: 200,
    body: [{
        "cardHolder": "Janet Jackson",
        "security": {
            "contactlessEnabled": true,
            "withdrawalEnabled": true,
            "internetPurchaseEnabled": true,
            "overallLimitsEnabled": false
        },
        "limits": {
            "account": {
                "restartDate": "16.09.2023 - 9:04",
                "used": 27.88, // value in CHF
                "available": 99972.12 // value in CHF
                "max": 100000.00 // value in CHF
            },
            "contactless": {
                "used": 13.02,
                "available": 9986.98,
                "max": 10000,
                "dailyUsed": 0,
                "dailyAvailable": 1600,
                "dailyMax": 1600
            },
            "withdrawal": {
                "used": 0,
                "available": 2000,
                "max": 2000,
                "dailyUsed": 0,
                "dailyAvailable": 2000,
                "dailyMax": 2000
            },
            "internetPurchase": {
                "used": 0,
                "available": 10000,
                "max": 10000,
                "dailyUsed": 0,
                "dailyAvailable": 5000,
                "dailyMax": 5000
            },
            transaction : {
                "purchase": 5000,
                "withdrawal": 2000,
                "internetPurchase": 5000,
                "contactless": 1600,
             }
        },
        "status": "Active",
        "currency": "EUR",
        "masked": {
            "cardNumber": "•••• 4455",
            "cvv2": "•••",
            "expiry": "••/••",
            "card3DSecurePassword": "••••••"
        }
    },
    ...]
}

Important Notices:

  1. If the user doesn't own a card, it returns statusCode = 404.

  2. number, expiry and CVV fields are very sensitive data, they should not be shown without client's consent.

  3. All the limits are monthly (excluding dailyUsed, dailyAvailable, dailyMax).

  4. All the card limits are in EUR.

  5. The account limits are separated from the card limits, but still important as the card limits depend on the account limit. The account limits are in CHF.

3. Get Transactions

Requires Authentication to display card transaction details, without authentication it only displays the public blockchain data.

Get the transactions from a user.

Request

Get recent transactions.

The following sample request gets last 6 transactions from EUR account of Account 10365, containing blockchain as well as card transactions.

GET https://api.fiat24.com/transactions?
currency=eur
&fromrecord=0
&recordscount=6

or

GET https://api.fiat24.com/transactions?
currency=eur
&fromtimestamp=1683797408116
&totimestamp=1683897408116

Request fields

currency = eur, usd, gbp, chf

Response Body

{
    "tokenid": 903,
    "currency": "EUR",
    "count": 6,
    "totalDebit": 109.00,
    "totalCredit": 109.00,
    "transactions": [
        {
            "title": "COOP-4899ZURICHBAHNHOF",
            "subtitle": "Reserved - ZURICH1SIZH",
            "amount": -1.89,
            "timestamp": 1683221111000,
            "image": "https://www.fiat24.com/img/visa_tx.png",
            "txId": "36344dbd-ab91-4418-b06e-4b756fb71629",
            "from": 9105,
            "to": 903,
        },
        {
            "title": "MIG migrolino ZH Tiefenbr",
            "subtitle": "Zurich",
            "amount": -1.02,
            "timestamp": 1683117041000,
            "image": "https://www.fiat24.com/img/visa_tx.png",
            "txId": "01ef2cec-23ed-492e-a0d5-4aa082f701f7",
            "from": 9105,
            "to": 903,
        },
        {
            "title": "Coop-4899 Zurich Bahnhof",
            "subtitle": "Zurich 1 Sihl",
            "amount": -1.88,
            "timestamp": 1682695543000,
            "image": "https://www.fiat24.com/img/visa_tx.png",
            "txId": "73c9f072-018a-436b-8933-ed04a0df553e",
            "from": 9105,
            "to": 903,
        },
        {
            "title": "@nicosaphirstein",
            "subtitle": "#903",
            "amount": "29405.00",
            "timestamp": 1682673347000,
            "image": "https://www.fiat24.com/api/avatar/903",
            "txId": "0xded890834ca450dbf64e8eaad51cbc99edb027425980695e0e928f794a41e9cb",
            "from": 9105,
            "to": 903,
        },
        {
            "title": "Confiserie Sprungli AG V2",
            "subtitle": "Zurich 1",
            "amount": -1.93,
            "timestamp": 1682666818000,
            "image": "https://www.fiat24.com/img/visa_tx.png",
            "txId": "79b11ec9-30bd-410a-87c1-f667c2f8bc92",
            "from": 9105,
            "to": 903,
        },
        {
            "title": "MIG migrolino ZH Tiefenbr",
            "subtitle": "Zurich",
            "amount": -5.02,
            "timestamp": 1682604232000,
            "image": "https://www.fiat24.com/img/visa_tx.png",
            "txId": "2b5f962d-b622-4956-beea-2afe83ff5d4c",
            "from": 9105,
            "to": 903,
        }
    ]
}

The API returns a maximum of 1,000 transactions per request.

Result fields

  1. timestamp is a 10 digits UNIX timestamp,

  2. txId refers to Arbitrum Transaction Hash. More details can be retrieved from Arbiscan.io.

  3. image field will return the image of the sender or the receiver (in case the user is the sender).

  4. from tokenID that sent the transfer

  5. to tokenID that received the transfer

4. Get IBAN

Each Fiat24 NFT can map to an unique Swiss IBAN.

For example, the NFT #12345 will own the IBAN of CH6883051000000012345. Wallet Provider can calculate the Swiss IBAN directly from the NFT id with the following request:

From API

GET https://api.fiat24.com/iban/<nftId>

This API is public, a signed header is not required.

Response Body of GET https://api.fiat24.com/iban/12345

{
    "iban" : "CH6883051000000012345"
}

From OpenSea API

Or you can get the IBAN as an attribute from OpenSea's metadata.

GET https://api.opensea.io/api/v2/chain/arbitrum/contract/0x133CAEecA096cA54889db71956c7f75862Ead7A0/nfts/<nftId>

Response Body for a NFT id = 12345. The line no. 16 states the IBAN.

{
    "nft": {
        "identifier": "901",
        "collection": "fiat24account",
        "contract": "0x133caeeca096ca54889db71956c7f75862ead7a0",
        ....

        "traits": [
            ....
            {
                "trait_type": "Swiss IBAN",
                "display_type": null,
                "max_value": null,
                "trait_count": 0,
                "order": null,
                "value": "CH6883051000000012345"
            },
            .....
        ]
    }
}

5. Country List

Fiat24 currently cannot serve all countries and regions, but we are actively expanding the scope of regions where we can provide our services. The eligible countries are published from our own FAQ, however, we provide the API for wallet providers to check the eligible countries efficiently.

GET https://api.fiat24.com/countries

This API is public, a signed header is not required.

Response body providers all ISO-3 countries codes for

  1. Eligible Client Domiciles

  2. Eligible Client Domiciles for obtain a VISA card

  3. Blacklist nationalities

{
  "eligibleDomiciles": [
    "ALA",
    "AUS",
    ...
    "SWE",
    "TWN"
  ],
  "eligibleDomicilesForCards": [
    "ALA",
    "AUT",
    ...
    "SWE",
    "CHE"
  ],
  "blacklistNationalities": [
    "GUM",
    "IRN",
    "PRK",
    "MNP",
    "PRI",
    "RUS",
    "UMI",
    "USA"
  ]
}

6. Forex exchange rates

GET https://api.fiat24.com/rates

This API is public, a signed header is not required.

Response body:

{
  "CHFCHF": {"rate":1,"lastUpdateAt":1710402772084},
  "USDGBP": {"rate":0.7818608287724785,"lastUpdateAt":1710402772084},
  "CHFGBP": {"rate":0.8889757623143081,"lastUpdateAt":1710402772084},
  "USDUSD": {"rate":1,"lastUpdateAt":1710402772084},
  "EURGBP": {"rate":0.8553557466770916,"lastUpdateAt":1710402772084},
  "GBPEUR": {"rate":1.1691042047531992,"lastUpdateAt":1710402772084},
  "GBPUSD": {"rate":1.279,"lastUpdateAt":1710402772084},
  "EUREUR": {"rate":1,"lastUpdateAt":1710402772084},
  "EURUSD": {"rate":1.094,"lastUpdateAt":1710402772084},
  "CHFUSD": {"rate":1.137,"lastUpdateAt":1710402772084},
  "CHFEUR": {"rate":1.0393053016453382,"lastUpdateAt":1710402772084},
  "GBPCHF": {"rate":1.1248900615655233,"lastUpdateAt":1710402772084},
  "USDEUR": {"rate":0.9140767824497257,"lastUpdateAt":1710402772084},
  "EURCHF": {"rate":0.9621811785400176,"lastUpdateAt":1710402772084},
  "GBPGBP": {"rate":1,"lastUpdateAt":1710402772084},
  "USDCHF": {"rate":0.8795074758135444,"lastUpdateAt":1710402772084}
}

Last updated

© Fiat24. All rights reserved.