Deposit

LegranPay supports creating channel deposits which is a common flow for letting a user top up their balance on your site. In this flow, LegranPay generates a dedicated crypto address for your user by your request, and the user can make transactions to this address at any time. Such an address is called a deposit address. You get notified about each transaction to the deposit address. If the transaction is successful, you are expected to add the appropriate amount to the user’s balance on your site.

Some advantages of channel deposits are:

  • easy and straightforward workflow

  • once created, the address can be used by the user as many times as they want

  • the user can make transactions at any time

  • there is no upper limitation on the amount of funds deposited in a transaction

How it works

  1. When your user wants to top up their balance, you request a deposit address from LegranPay.

  2. PING via API or Backoffice to deposit address for monitor incoming deposits for next 30 minutes.

  3. You pass the deposit address to the user. At this point, depending on the user’s local configuration, their software wallet may launch automatically.

  4. Using the software wallet, the user sends a transaction into the blockchain, by sending their funds to the provided address.

  5. When the incoming transaction is detected by system, it appears on the Transactions section and you are notified with an API callback (see Callbacks).

  6. At this point, you may want to reflect the incoming transfer of funds within your business logic — usually, by increasing your user’s balance.

If a user tries to send one cryptocurrency to a deposit address generated for another cryptocurrency, the funds may be lost.

Create and manage deposit addresses

Deposit addresses can be created using the API or in the backoffice. If you try to get an address for a user with parameters that you have already used before, it will return the address already created, otherwise it will return a new address.

Create deposit addresses using the API

To generate deposit addresses via the API, use the /deposits/take API endpoint. When calling it, you need to specify the blockchain and currency of the deposit. In the response, you will get an address that you can provide to your user. On each transaction to this address, LegranPay then notifies you with a callback, see deposit callback. A request to the endpoint needs to include an additional parameter, foreignId, where you can put any string that will help you identify the user. It makes sense to put the user’s account ID from your system into foreignId, so that when you find this ID in the callback, you can easily understand which account on your site needs to be updated accordingly.

Create and manage deposit addresses in the Backoffice

You can create and manage channel deposits in the Balances.

Click on the Deposit button in the Balance section
Deposit address management
Deposit address creation

Fees

LegranPay charges a fee when processing deposits. Full details on the fees applied to a given transaction are always available on the Transactions section and in the callback that you receive after the transaction. It is your choice what amount to use for increasing the user’s balance on your site — including the fee or not. The exact fees depend on your agreement and are listed on the Package Info tab in the backoffice. If you have any questions, please contact our sales manager at [email protected].

Last updated