Step 5: Create Buy Form

Below is an example checkout form that will be hosted on your site as a gateway into Banxa

  1. Use Get Fiat Currencies and Get Crypto Currencies to get the list of fiat and crypto currencies available. These can be cached on your server side but they should be refreshed at least hourly to pickup any changes to the available currency lists. The Get Crypto Currencies endpoint will also return the supported blockchain networks available for each crypto currency. You may optionally allow the user to select a blockchain network for the crypto currency they wish to buy if there are more than one supported. However, if there is no explicit choice made, the configured default blockchain network will be used.

  2. Use Get Payment Methods to get the list of available payments. The recommended approach is that this be called when either of the chosen currencies changes. This ensures that you have the right payments for the currency pair, that you are reflecting the correct payment method id and that you will pickup if the availability changes. We do not recommend hard coding the payment method ids, as these are subject to change.

  3. Use Get Prices to get the spot price for the currency pair and selected payment method. Due to differences in payment fees we do recommend calling this whenever the payment method chosen changes. The best value to display is spot_price_including_fee

  4. Once all information has been collected you can submit the Create Order request. See Step 6: Create Order for more details