Common withdrawal workflow
The most common scenario for sending crypto is “withdrawal with exchange”. AlphaPo provides web-services with on-the-fly exchange solution. This means that the funds that are stored on a merchant’s fiat balance can be automatically converted into cryptocurrencies before being sent to the user’s crypto wallet. For exchanges between the USDC tokens, the exchange rate is always 1:1 — this means that 1 USDC in ERC-20 is always equivalent to 1 USDC in SOL. Standard fees for “withdrawals with exchange” still apply. In case of regular withdrawals without exchange the workflow will be the same except of conversion operation.
Algorithm
- You have a EUR balance in our system
- User wants to get a withdrawal from their EUR balance on your site to their BTC wallet
- User uses some kind of “withdrawal” option on your site, chooses BTC as the currency to use for the payout and fills the payout form with their BTC address where they want to receive the funds and the withdrawal amount.
- After that your system makes the request to our processing.
- Our system makes an automatic exchange from EUR to BTC, sends funds to the user’s crypto address and your system gets the callback with transaction parameters, including the transaction’s status, currency pairs, amount, fees and so on.
- You decrease the user’s EUR balance for the transaction amount
In order to make a withdrawal you should use the “/v2/withdrawal/crypto” method from our API. You can define what currency should be used to send the funds, and, if necessary, from what fiat currency the funds should be converted before sending to the user.A request to the endpoint needs to include an additional identifier,
foreign_id. The foreign_id value must be a unique identifier of the operation, i.e., each call of this API method must use a different foreign_id. It will be included in the response and in all the callbacks related to the transaction.