Creating a transaction with existing users on the v2 API
Create a transaction on the v2 chain
The crypto you would like to charge the customer with. Currently supports ETH, LTC, and XRP. Put them in lowercase, so ltc, eth, or xrp.
The buyer's tunnel ID (Get this from the buyer) - This constantly rotates randomly every month and every time the buyer completes a transaction. This is to prevent spamming them with emails or transactions. This also lets us give you more controls, since there is less risk of merchants spamming our systems.
The server you want us to contact with a POST request when the payment is received. If you do not have a server location, you can constantly poll the transaction ID with this method.
You can now use the SSE method, and get instant updates even without a static IP or hostname!
The price in USD you would want the buyer to pay. (This gets calculated at the time of creation, NOT at the time of payment). For example, if the price of crypto is 100 dollars at the time of creation, but then drops to 80 dollars at the time of payment, the buyer will be charged 100 dollars worth of crypto, NOT 80 dollars.
For un-activated XRP accounts, the minimum transaction size is the equivalent of 21 XRP
At the time of creation, you can add notes, which get passed on to you when the buyer pays through callbacks, or in the database when you access it. The data type can be anything, a string, an array, an object, anything.
The expiry of the transaction in milliseconds elapsed since January 1, 1970. You can easily get this with Date.now() the default is Date.now() + 1800000
Creating no-user transactions
No user transactions will return a crypto deposit address that you can show to the buyer for them to deposit crypto into. When they deposit enough, a callback and SSE hook will be fired and you will be notified.
This is the parameter that lets you adjust the required amount of crypto deposited into the generated wallet. Default is 95% and we suggest lowering this number even more on transactions with low charge, since the buyer can run into un-expected crypto transaction fees. For example, if the charge is 100 ETH and accuracy is set to 95%, then we would mark deposits greater than 95 ETH as PAID.
The callback server you would like us to contact when the payment is received and transferred. For more info, visit here.
The expiry is set to 30 minutes after transaction creation, but if our API detects an incoming transaction, it will increase the expiry to 2 hours from the time it detected it.
On the ETH net, we do not have a way to detect incoming transactions, so the expiry is set to 1 day.
The USD equivalent of the crypto you would like to charge the buyer.
The data you would like us to send back when the buyer has paid. This can be used to keep track of orders and what to give the buyer.
The note can be in any data format (string, json, array, number, boolean)
This tells you how much crypto to charge the customer, and how much crypto the API is expecting to be paid.
Show this to your buyer! Without this, they have no place to put their money! This is the wallet where we check for balance changes, and after the payment is made, the crypto is transfered to your wallet.
This is the Coin-Tunnel transaction ID, and you can use this in the other API methods to get the status on the transaction.