How to simulate a fiat to crypto transaction
When you are building your integration, you will need to simulate transactions. When you want to simulate converting fiat to crypto, the Unblock API has an endpoint to help you to do this.
1. Create and log in as a new user
First, we need to create a new user; this can be done using this recipe:
2. Simulate a fiat-to-crypto transfer
This endpoint is only for the Sandbox and Private Sandbox environements
This endpoint will allow you to simulate a fiat to crypto transaction
of 100 units of fiat into an existing Individual or Corporate Unblock bank account. The rest of the fiat to Crypto process will then be triggered automatically as it is in all other environments.
curl --request POST \
--url https://api.getunblock.com/user/bank-account/unblock/<<unblock bank account uuid>>/simulate \
--header 'Authorization: <<unblock api key>>' \
--header 'accept: application/json' \
--header 'unblock-session-id: <<unblock session id>>'
As soon as this endpoint is called, the rest of the normal.fiatToCrypto
process will automatically get triggered, and then if the API keys used are for a private Sandbox, the Merchant will receive all the webhooks described here
This will only work once for non KYC users
As per the Unblock KYC policy, users that have no KYC will only be able to complete one transaction fiatToCrypto and one transaction cryptoToFiat up to the no KYC limit. For more information please read more here.
Updated 8 months ago