Deposit onChain
curl --request POST \
--url https://preview.kotanipay.com/api/v3/deposit/on-chain \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wallet_id": "<string>",
"amount": 123,
"customer_key": "<string>",
"public_address": "<string>",
"callback_url": "<string>",
"reference_id": "<string>"
}
'import requests
url = "https://preview.kotanipay.com/api/v3/deposit/on-chain"
payload = {
"wallet_id": "<string>",
"amount": 123,
"customer_key": "<string>",
"public_address": "<string>",
"callback_url": "<string>",
"reference_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet_id: '<string>',
amount: 123,
customer_key: '<string>',
public_address: '<string>',
callback_url: '<string>',
reference_id: '<string>'
})
};
fetch('https://preview.kotanipay.com/api/v3/deposit/on-chain', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://preview.kotanipay.com/api/v3/deposit/on-chain",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallet_id' => '<string>',
'amount' => 123,
'customer_key' => '<string>',
'public_address' => '<string>',
'callback_url' => '<string>',
'reference_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://preview.kotanipay.com/api/v3/deposit/on-chain"
payload := strings.NewReader("{\n \"wallet_id\": \"<string>\",\n \"amount\": 123,\n \"customer_key\": \"<string>\",\n \"public_address\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"reference_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://preview.kotanipay.com/api/v3/deposit/on-chain")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wallet_id\": \"<string>\",\n \"amount\": 123,\n \"customer_key\": \"<string>\",\n \"public_address\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"reference_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://preview.kotanipay.com/api/v3/deposit/on-chain")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet_id\": \"<string>\",\n \"amount\": 123,\n \"customer_key\": \"<string>\",\n \"public_address\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"reference_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Deposit has been successfully created.",
"data": {
"id": "<string>",
"message": "<string>",
"reference_id": "<string>",
"reference_number": 123,
"customer_key": "<string>",
"redirect_url": "<string>"
}
}{
"success": false,
"message": "Bad Request",
"data": {}
}{
"success": false,
"message": "Unauthorized",
"data": {}
}{
"success": false,
"message": "Not Found",
"data": {}
}{
"success": false,
"message": "Duplicate Transaction",
"data": {}
}{
"success": false,
"message": "Too Many Requests",
"data": {}
}Crypto Deposits (On-Chain)
Deposit On-Chain (Receive Crypto)
deprecated
Crypto deposits are where a customer’s mobile money wallet account is deducted a specific fiat amount which is then converted to a specified stablecoin amount and sent to the integrator’s specified public wallet address.
POST
/
api
/
v3
/
deposit
/
on-chain
Deposit onChain
curl --request POST \
--url https://preview.kotanipay.com/api/v3/deposit/on-chain \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wallet_id": "<string>",
"amount": 123,
"customer_key": "<string>",
"public_address": "<string>",
"callback_url": "<string>",
"reference_id": "<string>"
}
'import requests
url = "https://preview.kotanipay.com/api/v3/deposit/on-chain"
payload = {
"wallet_id": "<string>",
"amount": 123,
"customer_key": "<string>",
"public_address": "<string>",
"callback_url": "<string>",
"reference_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet_id: '<string>',
amount: 123,
customer_key: '<string>',
public_address: '<string>',
callback_url: '<string>',
reference_id: '<string>'
})
};
fetch('https://preview.kotanipay.com/api/v3/deposit/on-chain', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://preview.kotanipay.com/api/v3/deposit/on-chain",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallet_id' => '<string>',
'amount' => 123,
'customer_key' => '<string>',
'public_address' => '<string>',
'callback_url' => '<string>',
'reference_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://preview.kotanipay.com/api/v3/deposit/on-chain"
payload := strings.NewReader("{\n \"wallet_id\": \"<string>\",\n \"amount\": 123,\n \"customer_key\": \"<string>\",\n \"public_address\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"reference_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://preview.kotanipay.com/api/v3/deposit/on-chain")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wallet_id\": \"<string>\",\n \"amount\": 123,\n \"customer_key\": \"<string>\",\n \"public_address\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"reference_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://preview.kotanipay.com/api/v3/deposit/on-chain")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet_id\": \"<string>\",\n \"amount\": 123,\n \"customer_key\": \"<string>\",\n \"public_address\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"reference_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Deposit has been successfully created.",
"data": {
"id": "<string>",
"message": "<string>",
"reference_id": "<string>",
"reference_number": 123,
"customer_key": "<string>",
"redirect_url": "<string>"
}
}{
"success": false,
"message": "Bad Request",
"data": {}
}{
"success": false,
"message": "Unauthorized",
"data": {}
}{
"success": false,
"message": "Not Found",
"data": {}
}{
"success": false,
"message": "Duplicate Transaction",
"data": {}
}{
"success": false,
"message": "Too Many Requests",
"data": {}
}This endpoint is marked as deprecated but is fully functional. It will be replaced with a clearer naming convention in the future.
Use Case
This endpoint is for e-commerce platforms and businesses that want to accept mobile money payments and receive the equivalent in cryptocurrency. Perfect for:- E-commerce platforms accepting crypto payments
- Merchants wanting to receive payments in stablecoins
- Platforms converting fiat payments to crypto automatically
- Selling crypto to customers (use
/onrampinstead) - Running a crypto exchange
How It Works
- Your customer pays via mobile money (STK push)
- We collect the mobile money payment
- We convert the fiat to crypto at current rates
- Your crypto wallet receives the USDT/crypto
- You fulfill the customer’s order
Flow
Key Differences
| Aspect | This Endpoint (Deposit On-Chain) | Onramp Endpoint |
|---|---|---|
| Who receives crypto? | ✅ You (the merchant) | Customer |
| Who receives fiat? | Payment processor | ✅ You (the merchant) |
| Crypto inventory needed? | ❌ No | ✅ Yes (must have crypto to sell) |
| Use case | Accept payments in crypto | Sell crypto to customers |
Examples
Receive crypto to your wallet
When you DON’T providepublic_address, crypto goes to your wallet:
{
"customer_key": "cus_abc123",
"wallet_id": "wallet_polygon_usdt_xyz",
"amount": 1450,
"chain": "POLYGON",
"token": "USDT",
"callback_url": "https://yourdomain.com/webhook",
"reference_id": "order_12345"
}
Send crypto to customer’s address
When you providepublic_address, crypto goes directly to that address:
{
"customer_key": "cus_abc123",
"wallet_id": "wallet_polygon_usdt_xyz",
"amount": 1450,
"chain": "POLYGON",
"token": "USDT",
"public_address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"callback_url": "https://yourdomain.com/webhook",
"reference_id": "order_12345"
}
Supported Chains & Tokens
Get supported chains and tokens:GET /api/v3/deposit/on-chain/supported-chains
{
"data": {
"POLYGON": ["USDT", "USDC"],
"ETHEREUM": ["USDT", "USDC"],
"CELO": ["CUSD"],
"STELLAR": ["USDC"],
"SOLANA": ["USDT", "USDC"]
}
}
Status Tracking
Track your deposit status:GET /api/v3/deposit/on-chain/status/{reference_id}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
supported chain
Available options:
ETHEREUM, CELO, AVALANCHE, POLYGON, ARBITRUM, OPTIMISM, STELLAR, TRON, FUSE, LIGHTNING, SOLANA, PROVENANCE, CARDANO, HEDERA, BASE, LISK, VICTION, SCROLL supported token
Available options:
CUSD, USDC, USDT, USDT0, SAT, BTC, HASH, FUSE, HBAR, USDGLO, CKES, CGHS, MSAT, XLM, ADA The wallet id
The amount to deposit
The customer key
The transaction public address
The callback url
Optional reference id