Create a crypto wallet
curl --request POST \
--url https://api-production.fossapay.com/api/v1/wallets/crypto/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api-production.fossapay.com/api/v1/wallets/crypto/create"
payload = { "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({customerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api-production.fossapay.com/api/v1/wallets/crypto/create', 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://api-production.fossapay.com/api/v1/wallets/crypto/create",
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([
'customerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api-production.fossapay.com/api/v1/wallets/crypto/create"
payload := strings.NewReader("{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api-production.fossapay.com/api/v1/wallets/crypto/create")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-production.fossapay.com/api/v1/wallets/crypto/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"statusCode": 201,
"message": "Crypto wallet created successfully",
"data": {
"id": "55555555-5555-4555-8555-555555555555",
"walletId": "wallet-reference-123",
"address": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF",
"network": "stellar"
}
}
Crypto Wallets
Create Crypto Wallet
Create a Solana or Stellar wallet for a merchant-owned customer
POST
/
api
/
v1
/
wallets
/
crypto
/
create
Create a crypto wallet
curl --request POST \
--url https://api-production.fossapay.com/api/v1/wallets/crypto/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api-production.fossapay.com/api/v1/wallets/crypto/create"
payload = { "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({customerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api-production.fossapay.com/api/v1/wallets/crypto/create', 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://api-production.fossapay.com/api/v1/wallets/crypto/create",
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([
'customerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api-production.fossapay.com/api/v1/wallets/crypto/create"
payload := strings.NewReader("{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api-production.fossapay.com/api/v1/wallets/crypto/create")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-production.fossapay.com/api/v1/wallets/crypto/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"statusCode": 201,
"message": "Crypto wallet created successfully",
"data": {
"id": "55555555-5555-4555-8555-555555555555",
"walletId": "wallet-reference-123",
"address": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF",
"network": "stellar"
}
}
Request
string
required
Active production API key belonging to the customer’s merchant.
string
required
The blockchain network for the crypto wallet:
solana or stellar.string
required
FossaPay customer UUID. One wallet per network can be created for this customer.
Request Example
curl -X POST https://api-production.fossapay.com/api/v1/wallets/crypto/create \
-H "x-api-key: $FOSSAPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"network": "stellar",
"customerId": "11111111-1111-4111-8111-111111111111"
}'
const response = await fetch('https://api-production.fossapay.com/api/v1/wallets/crypto/create', {
method: 'POST',
headers: {
'x-api-key': process.env.FOSSAPAY_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
network: 'stellar',
customerId: '11111111-1111-4111-8111-111111111111'
})
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status} ${response.statusText}`);
}
const cryptoWallet = await response.json();
Response
{
"status": "success",
"statusCode": 201,
"message": "Crypto wallet created successfully",
"data": {
"id": "55555555-5555-4555-8555-555555555555",
"walletId": "wallet-reference-123",
"address": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF",
"network": "stellar"
}
}
data.id for wallet-by-ID and wallet-transactions endpoints. Use data.address for wallet-by-address requests. Save the network and full address with the customer ID. The example address is illustrative; use the address in your actual response.
Errors
| Status | Typical cause |
|---|---|
400 | Customer not found, wallet already exists, or wallet creation failed |
401 | Missing or invalid API key |
422 | Invalid customer UUID or a network other than solana or stellar |
5xx | Temporary service failure; check for an existing wallet before retrying |
Authorizations
Body
application/json

