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.
where:
where:
address is the address of the user's wallet.
signer.signMessage is the signatures of the user's wallet personal sign.
Please note that in some programming languages SHA3 function might act a bit different than the web3.utils.sha3(). The SHA3 of a simple text such as SHA3("Fiat24"), should give as a response 0x1cf688cdaa53bf4605bfbb1ab56565651179978e63d41cf2df557d5bb5f1bd90.
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
Response Body
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
Response Body
If the card is not available, the 500 code is returned.
If the card is found, the following data is returned
Important Notices:
If the user doesn't own a card, it returns
statusCode
= 404.number
,expiry
andCVV
fields are very sensitive data, they should not be shown without client's consent.All the limits are monthly (excluding dailyUsed, dailyAvailable, dailyMax).
All the limits in /cards are in EUR.
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.
or
or Pagination
Request fields:
currency = eur, usd, gbp, chf, cnh
fromrecord (optional) = used for paginating (in case we want to do pagination of 10)
recordscounts (optional) = records to retrieve. Also used for paginating.
fromtimestamp (optional) = Timestamp to begin
totimestamp (optional) = Timestamp to begin
Response Body
The API returns a maximum of 1,000 transactions per request.
Result fields
timestamp
is a 10 digits UNIX timestamp,txId
refers to Arbitrum Transaction Hash. More details can be retrieved from Arbiscan.io.image
field will return the image of the sender or the receiver (in case the user is the sender).from
tokenID that sent the transferto
tokenID that received the transfer
Card Icons
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
This API is public, a signed header is not required.
Response Body of GET https://api.fiat24.com/iban/12345
From OpenSea API
Or you can get the IBAN as an attribute from OpenSea's metadata.
Response Body for a NFT id = 12345. The line no. 16 states the IBAN.
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.
This API is public, a signed header is not required.
Response body providers all ISO-3 countries codes for
Eligible Client Domiciles
Eligible Client Domiciles for obtain a VISA card
Blacklist nationalities
6. Forex exchange rates
This API is public, a signed header is not required.
Response body:
Each FX pair will provide 3 quotes:
rate
: Central parity ratebid
: Bid (or BUY) rateask
: Ask (or SELL) rate
7. QR Payment
Requires Authentication
We provide a simple way to enable wallet providers to initialise the QR payments for the end users. Currently, we support the following QR payments:
Swiss QR Bill (QR Rechnung)
SEPA EPC QR
UnionPay QR (Coming in Q4/2024)
The wallet provider conducts 3 steps to make a QR payment:
Scan the QR and read as a string. Call the following URL and pass the string as parameter to get the information of a valid QR.
Call the smart contract clientPayoutRef() and pass the parameters which are provided from last API call.
The end user sign the transaction and the payment is done.
Case 1: Swiss QR Bill
A QR-bill is an invoice with an integrated payment part and receipt in Switzerland. The QR-bill replaced the old orange and red payment slips on 30 September 2022.
The upper part of the QR-bill (1) is like a normal invoice; the lower part is divided into two parts just like today's payment slips: the payment part (2) and the receipt (3). The payment part includes the Swiss QR Code (4), which contains all relevant information necessary for both invoicing and payment. A typical QR bill looks like the following:
Here is the sample of request url:
and the response body as JSON object:
Inside the response body, the line 2 - 20 are information the wallet could show to the end user, indicating the business purpose of this QR code. The line 21 - 27 are the parameter values to call the smart contract function CHF24.clientPayoutRef().
Case 2: SEPA (EPC) QR
The European Payments Council QR Code guidelines define the content of a QR code that can be used to initiate SEPA credit transfer (SCT). These QR code guidelines are used on many invoices and payment requests in the European countries (mostly in Austria, Belgium, Finland, Germany, The Netherlands) .
Usually, SEPA QR has no fixed layout, it can be placed anywhere in an invoice or bill.
Here is the sample of request url:
and the response body as JSON object:
Inside the response body, the line 2 - 14 are information the wallet could show to the end user, indicating the business purpose of this QR code. The line 15 - 21 are the parameter values to call the smart contract function EUR24.clientPayoutRef().
8. KYC Status Check
The following API returns the KYC status of a certain NFT.
The response code can be easily referred as:
NOT_INIT
: KYC has not been started yet.CA_COMPLETED_PENDING_SCAN
: First part registration completed, ready for ID scan step.PROCESSING_SCAN
: User scanned the passport, waiting to process the information (around 15-20 seconds), after that user will become either: MANUAL_REVIEW, COMPLETED or REJECTED.PENDING_ACTION
: Client needs action to finish the KYC, for example the passport has not been scanned yet, or has been scanned but user needs to re-do it, or needs to re-add address.COMPLETED
: The KYC has been successfully done, the client is in live status.MANUAL_REVIEW
: The KYC has been submitted, but due to regulatory reason, it's under manual review phase.REJECTED
: The KYC has been submitted, but rejected by compliance. Due to regulatory reason or company policy, we cannot serve the client.INTERNAL_ERROR
: Unknown system error. When the NFT is not minted, you will have such status as well.
9. Payment Purposes
The following API returns the Payment Purposes for the ClientPayoutRef
Response sample:
Last updated