Sell EURR
Learn how to redeem EURR into fiat money using the StablR API.
Redeeming EURR from your wallet(s) to fiat Euros in your business bank account is the other core functionality of you can integrate with the StablR API. On this page we will guide you through the steps to transfer EURR from your institutional wallet to StablR and receive Euros in your business bank account on a 1:1 conversion basis.
1. Configure your StablR Account
To programmatically Sell EURR make sure you have the basics configured in your StablR Account. You should have:
- Created an API Key.
- Registered your business bank account.
- Whitelisted at least one (1) of your institutional wallets.
Get an API Key
StablR's API uses API Keys and Access Tokens as the mechanism to authenticate customer requests. When you have retrieved the Access Token for authentication, this Access Token must be set in the Authorization header of the API request for which the format of the header is Bearer secret-key-value.
How to Create an API Key!
Once you have generated your API key, store its respective {CLIENT_SECRET}
and the {CLIENT_ID}
in a secure place.
To be able to make valid requests from your backend server, you must retrieve an {ACCESS_TOKEN}
using the {CLIENT_SECRET}
and {CLIENT_ID}
as explained in the Authentication section.
API Access Tokens
StablR's Access Tokens for making secure API requests will expire five (5) minutes after creation. This means you have to request a new token after the respective token has expired to keep making valid requests from your backend server.
Register your Bank Account
Before you start using the StablR API, make sure you register your business bank account from which you wish to interact and convert fiat funds into EURR.
- Navigate to the Account section in your StablR Account.
- Go to Bank Accounts and click on Add Bank Account.
- Enter the respective bank account details of your business bank account and upload a valid and recent account statement for verification purposes.
Bank Account Validation
When adding the Bank Account to your StablR Account it will be in PENDING status. StablR will verify the registration of your business bank account which will mark it as APPROVED.
Whitelist your wallet
To be able to convert your fiat funds into digital currency, you must also at minimum whitelist one (1) institutional wallet which you own.
You can either do this manually via the StablR Account by:
- Navigate to the Account section in your StablR Account.
- Go to Wallets and click on Add Wallet.
- Enter the respective wallet details and confirm the whitelisting.
Or you can programmatically manage your Wallets via the StablR API by:
- Whitelisting a Wallet.
- Retrieving your whitelisted wallet(s).
- Removing your whitelisted wallet(s).
Wallet Validation
When adding the Wallet to your StablR Account it will be in PENDING status. StablR will verify the whitelisting of your wallet which will mark it as APPROVED.
2. Initiate a Sell Order
To Sell EURR and redeem fiat Euros you will need to Create a Sell Order first.
Request
Replace {ACCESS_TOKEN}
with the Access Token you retrieved when authenticating your API Key.
Insert Sell
as the Type.
Insert the {AMOUNT}
to indicate how much fiat funds you wish to convert to EURR.
Insert the {WALLET_ID}
of a registered wallet you retrieved in the previous step when whitelisting your wallet or retrieving the list of whitelisted wallets in your StablR Account.
Wallet
Please make sure to insert the WalletId of the whitelisted wallet from where you are transferring the EURR to StablR!
curl --request POST \
--url https://api.stablr.com/v1/orders \
--header 'accept: application/json' \
--header 'authorization: Bearer {ACCESS_TOKEN}' \
--header 'content-type: application/*+json' \
--data '
{
"Type": "Buy",
"Amount": "{AMOUNT}",
"WalletId": "{WALLET_ID}",
"CustomerReference": "OPTIONAL"
}
'
Response
The response should like like this:
{
"OrderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
3. Retrieve Payment Instructions
You can easily retrieve all necessary details to transfer the EURR from your wallet to StablR's wallet by using the GET Order and GET Crypto Transfer details endpoints. The GET Order request will provide you with the Crypto Transfer Id and subsequently using this Id in the GET Crypto Transfer Details request returns the beneficiary and wallet details.
GET Order Request
Replace {ACCESS_TOKEN}
with the Access Token you retrieved when authenticating your API Key.
Replace orderId
with the Id of the Order you created in step 2.
curl --request GET \
--url https://api.stablr.com/v1/orders/orderId \
--header 'accept: application/json' \
--header 'authorization: Bearer {ACCESS_TOKEN}'
GET Order Response
The response looks as follows:
{
"OrderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"Type": "string",
"Amount": {AMOUNT},
"WalletId": "2fa85f64-5717-4562-b3fc-2c963f66afa5",
"CustomerReference": "OPTIONAL",
"Status": "string",
"FiatTransferId": 0,
"CryptoTransferId": "4fa85f64-5717-4562-b3fc-2c963f66afa7",
"CreatedAt": "2024-05-30T08:58:16.730Z"
}
GET Crypto Transfer Details Request
Replace {ACCESS_TOKEN}
with the Access Token you retrieved when authenticating your API Key.
Replace transferId
with the Crypto Transfer Id of the Order you retrieved in the previous step.
curl --request GET \
--url https://api.stablr.com/v1/transfers/crypto/transferId \
--header 'accept: application/json' \
--header 'authorization: Bearer {ACCESS_TOKEN}'
GET Crypto Transfer Details Response
The response looks like this:
{
"Id": "4fa85f64-5717-4562-b3fc-2c963f66afa7",
"OrderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"WalletOwner": "StablR Ltd.",
"WalletAddress": "STABLR WALLET ADDRESS",
"Amount": {AMOUNT},
"CreatedAt": "2024-05-30T09:16:37.250Z"
}
4. Confirm EURR Transfer
After you have transferred the EURR from your whitelisted wallet to StablR's wallet, you need to confirm the transfer by using the Confirm Transfer endpoint.
Request
Replace {ACCESS_TOKEN}
with the Access Token you retrieved when authenticating your API Key.
Replace transferId
with the Crypto Transfer Id of the Order you retrieved in step 3.
Insert the transaction hash of the on-chain transfer of EURR to StablR's wallet in the {TRANSFER_TRANSACTION_HASH}
parameter.
curl --request POST \
--url https://api.stablr.com/v1/transfers/crypto/transferId/confirmation \
--header 'authorization: Bearer {ACCESS_TOKEN}' \
--header 'content-type: application/*+json' \
--data '
{
"TransactionHash": "{TRANSFER_TRANSACTION_HASH}"
}
'
Response
A successful response returns a HTTPS 200 to your backend server.
5. Receive fiat funds on your bank account
After the EURR transfer is successfully confirmed, the EURR will be automatically burned by StablR's smart contract and the Euro pay-out is initiated from StablR's bank account to your registered business bank account.
Updated 6 months ago