DFX is a crypto on- and off-ramp with an open API that can be integrated by anyone. This page explains the basic concepts of the API. If you don't want to bother with API calls, you can integrate our ready-to-use web widget with a few lines of code (see the services repository) or use our React API npm package.
Each user who wants to use the service must be registered separately with their blockchain address and a signature to prove ownership.
Contact support to register your wallet name. This is used to identify all users that signed up with your wallet. This step is optional.
- Get the sign message from sign-message endpoint (with the user's address) and sign it with the corresponding private key
- Register the user with the sign-up endpoint.
wallet
andusedRef
are optional:- Use the wallet name (
wallet
) from step initial setup - See below for more information on the referral program (
usedRef
)
- Use the wallet name (
- Now you can get your JWT access token (with address & signature) with the sign-in endpoint
If a user wants to get notified about ongoing transactions, he can register his email address with the user endpoint
- Basic information about the referral program can be found in our FAQ
- A referral code can only be set once during user registration (
usedRef
parameter) - Every user will receive his own referral code after the first successful transaction. It can be get from the user detail endpoint.
KYC is not required for a daily transaction volume up to 1000 CHF. To increase the transaction volume, the user needs to be verified with a KYC process, which can be done on the DFX KYC page.
- Get the user's KYC hash from user endpoint
- Open then link to the KYC page:
https://payment.dfx.swiss/kyc?code=<kyc-hash>
Get a quote
- Get all available assets with the asset endpoint
- This endpoint will return all assets compatible with the user's address, which might be assets on multiple blockchains. The query parameter (optional) can be used to filter for specific blockchains.
- Only assets with the
buyable
field set totrue
can be bought
- Get all available currencies with the fiat endpoint
- Only fiats with the
sellable
field set totrue
can be used to buy crypto
- Only fiats with the
- Get a quote with the buy quote endpoint
Get payment infos
- Get all available assets with the asset endpoint
- This endpoint will return all assets compatible with the user's address, which might be assets on multiple blockchains. The query parameter (optional) can be used to filter for specific blockchains.
- Only assets with the
buyable
field set totrue
can be bought
- Get all available currencies with the fiat endpoint
- Only fiats with the
sellable
field set totrue
can be used to buy crypto
- Only fiats with the
- Get the payment information with the buy payment endpoint
- Do a bank transfer with the provided payment infos
- Ensure compliance with minimum deposit and KYC limits
- The crypto asset will be sent to the user's blockchain address as soon as the bank transfer is completed
Get a quote
- Get all available assets with the asset endpoint
- Only assets with the
sellable
field set totrue
can be sold
- Only assets with the
- Get all available currencies with the fiat endpoint
- Only fiats with the
buyable
field set totrue
can be used to sell crypto
- Only fiats with the
- Get a quote with the sell quote endpoint
Get payment infos
In order to perform bank transactions, DFX needs to know the name and address of the recipient. Therefore, user data must be collected once before a sale can be made. The user data can be updated with the kyc data endpoint. Required fields are mail, phone, firstname, surname, street, houseNumber, location, zip, country
. For non personal accounts, organizationName, organizationStreet, organizationHouseNumber, organizationLocation, organizationZip, organizationCountry
are also required.
- Update user data, if required (check with
kycDataComplete
field from user endpoint) - Get all available assets with the asset endpoint
- Only assets with the
sellable
field set totrue
can be sold
- Only assets with the
- Get all available currencies with the fiat endpoint
- Only fiats with the
buyable
field set totrue
can be used to sell crypto
- Only fiats with the
- Get the payment information with the sell payment endpoint
- Do a blockchain transaction to the provided deposit address
- Ensure compliance with minimum deposit and KYC limits
- The fiat will be sent to the specified bank account as soon as the blockchain transaction is completed
- All bank accounts of a user can be fetched with the bank account endpoint
- A call to the buy or sell payment info endpoints will automatically create a bank account for the provided IBAN
- This can be used to improve UX and show the previously used IBANs to the user
- Bank accounts (label, preferred currency) can be updated with the update endpoint
- Bank accounts can be created directly with the create endpoint
- DFX.swiss is integrated in the DFX.swiss exchange