Search documentation

Find pages, endpoints, parameters, and guides.

How to easily test CryptAPI

View as Markdown

You can see exactly what CryptAPI sends to your callback URL with a small test payment. You need a domain you control, because CryptAPI only creates payment addresses for callback URLs on a verified domain.

Step 1: Verify your domain

Verify the domain you will test on, for example example.com, on our Verify Domain page. You only do this once per domain. See How to verify your callback domain.

Step 2: Prepare a test callback URL

Put a page on that domain that records each request it receives and answers *ok*. In PHP, for example, save this as cryptapi-test.php:

PHP
<?php
// Writes each CryptAPI callback to the server's error log
error_log('CryptAPI callback: ' . $_SERVER['QUERY_STRING'] . ' ' . file_get_contents('php://input'));
echo '*ok*';

Your test callback URL is then https://example.com/cryptapi-test.php. Delete the page once you're done.

Step 3: Pick a cryptocurrency

Choose the coin or token you want to test with (see our cryptocurrencies list). In this example we use LTC, which is a good coin for testing.

Step 4: Request a payment address

Put the test callback URL and your crypto address (copied from your wallet) into a CryptAPI request like this:

text
https://api.cryptapi.io/ltc/create/?address=your_crypto_address&callback=https://example.com/cryptapi-test.php

If everything is correct, you will get a response like this:

JSON
{
  "status": "success",
  "address_in": "MPHoK2QzdBKMwaoNqwdTDkwroz3T4HaZJg",
  "address_out": "your_crypto_address",
  "callback_url": "https://example.com/cryptapi-test.php",
  "minimum_transaction_coin": "0.00200000",
  "priority": "default"
}

If you get Please verify your domain before using our service, go back to Step 1.

Step 5: Send a payment

Send a payment to the address in the address_in field of the response. Make sure it's above the minimum transaction value for that coin.

Step 6: Check the callback

Once the payment is confirmed, your server's log shows the callback, with fields such as address_in, txid_in, value_coin, coin and pending=0. It means CryptAPI received the payment and forwarded it to your crypto address. For every field, see Custom Payment Flow Webhooks.