Wallet routes
A wallet comprises a private key, a public key, and many addresses. To enable a user to accept tokens or digital assets, create a wallet for them using our API.
You can create one wallet per blockchain.
Here are routes for the profile management.
Create a wallet
 This operation creates a wallet
POST https://sandbox.oumla.com/api/v1/wallets/generate
Headers
x-api-key*
string
The API key generated from Oumla's dashboard
Request body
reference *
string
Any identifer for this user this could be the UUID for the user or profile
network*
NetworkType
One of the network types that we support. like for example "ETH"
Sample code of the request:
async function generateWallet(reference: string, network: string) {
  const apiKey = "Your API Key";
  const url = "https://sandbox.oumla.com/api/v1/wallets/generate";
  const data = JSON.stringify({ reference, network });
  const response = await fetch(url, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": apiKey,
    },
    body: data,
  });
  const responseData = await response.json();
  console.log(responseData);
}
// Example usage
generateWallet("dba1fea5-2004-4ea8-a06d-a7c7c5559b8f","BTC");import axios from "axios";
async function generateWallet(reference: string, network: string) {
  const apiKey = "Your API Key";
  const url = "https://sandbox.oumla.com/api/v1/wallets/generate";
  try {
    const response = await axios.post(url, {
      reference,
      network,
    }, {
      headers: {
        "x-api-key": apiKey,
        "Content-Type": "application/json",
      },
    });
    console.log(response.data);
  } catch (error) {
    console.error("Error:", error);
  }
}
// Example usage
generateWallet("dba1fea5-2004-4ea8-a06d-a7c7c5559b8f", "BTC");import requests
import json
url = "https://sandbox.oumla.com/api/v1/wallets/generate"
api_key = "Your API Key"
data = {
    reference: "dba1fea5-2004-4ea8-a06d-a7c7c5559b8f",
    network: "BTC",
}
headers = {
    "Content-Type": "application/json",
    "x-api-key": api_key
}
response = requests.post(url, data=json.dumps(data), headers=headers)
if response.status_code == 200:
    print(response.json())
else:
    print("Error:", response.status_code, response.text)The expected response:
    "data": {
        "reference": "-2004-4ea8-a06d-a7c7c5559b8f",
        "network": "ETH",
        "type": "User",
        "date": "2024-07-13T10:05:35.636Z"
    },{
    "message": "Profile has a ETH wallet",
    "success": false,
    "status": 402
}Get Wallets
This operation to get wallets by organization
organizationGET https://sandbox.oumla.com/api/v1/wallets/organization
Headers
x-api-key*
string
Oumla api key
Sample code of the request:
async function getWallets() {
  const apiKey = "Your API Key";
  const url = "https://sandbox.oumla.com/api/v1/wallets/organizations";
  const response = await fetch(url, {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": apiKey,
    },
  });
  const data = await response.json();
  console.log(data);
}
getWallets();import axios from "axios";
async function getWallets() {
  const apiKey = "Your API Key";
  const url = "https://sandbox.oumla.com/api/v1/wallets/organization";
  try {
    const response = await axios.get(url, {
      headers: {
        "x-api-key": apiKey,
      },
    });
    console.log(response.data);
  } catch (error) {
    console.error("Error:", error);
  }
}
// Example usage
getWallets();import requests
response = requests.get('https://sandbox.oumla.com/api/v1/wallets/organization', headers={
    'x-api-key': 'Your API Key'
})
if response.status_code == 200:
    print(response.json())
else:
    print(response.text)The expected response:
{
    "data": [
        {
            "reference": "89a625b9-4c5f-4130-8b56-afx8010f8103",
            "organizationId": "8a9e86b8889e36b8-b175-4371-950e-d0e8a2b56c67",
            "network": "ETH",
            "type": "User",
            "date": "2024-07-13T10:05:35.636Z",
            "currentDeepIndex": 0,
            "index": 1
        },
        {
            "reference": "89a625b9-4c5f-4130-8b56-afx8010f8103",
            "organizationId": "889e36b8-b175-4371-950e-d0e8a2b56c67",
            "network": "BTC",
            "type": "User",
            "date": "2024-06-10T18:36:18.749Z",
            "currentDeepIndex": 10,
            "index": 0
        },
// The other walllets
    ],
    "pagination": {
        "totalElements": 5,
        "totalPages": 1,
        "skip": 0,
        "take": 10
    },
    "success": true,
    "status": 200
}This operation to get wallets by reference
referenceGET https://sandbox.oumla.com/api/v1/wallets/profile/{{reference}}
Query Parameters (required)
reference*
string
the id for that user.
Headers
x-api-key*
string
Oumla api key
Sample code of the request:
async function getWalletByReference(reference: string) {
  const apiKey = "Your API Key";
  const url = `https://sandbox.oumla.com/api/v1/wallets/profile/${reference}`;
  const response = await fetch(url, {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": apiKey,
    },
  });
  const data = await response.json();
  console.log(data);
}
getWalletByReference("89a625b9-4c5f-4130-8b56-afx8010f8103");import axios from "axios";
async function getWalletByReference(reference: string) {
  const apiKey = "Your API Key";
  const url = `https://sandbox.oumla.com/api/v1/wallets/profile/${reference}`;
  try {
    const response = await axios.get(url, {
      headers: {
        "x-api-key": apiKey,
      },
    });
    console.log(response.data);
  } catch (error) {
    console.error("Error:", error);
  }
}
// Example usage
getWalletByReference("89a625b9-4c5f-4130-8b56-afx8010f8103");import requests
response = requests.get(f'https://sandbox.oumla.com/api/v1/wallets/profile/{reference}', headers={
    'x-api-key': 'Your API Key'
})
if response.status_code == 200:
    print(response.json())
else:
    print(response.text)The expected response:
{
    "data": [
        {
            "reference": "89a625b9-4c5f-4130-8b56-afx8010f8103",
            "organizationId": "8a9e86b8889e36b8-b175-4371-950e-d0e8a2b56c67",
            "network": "ETH",
            "type": "User",
            "date": "2024-07-13T10:05:35.636Z",
            "currentDeepIndex": 0,
            "index": 1
        },
        {
            "reference": "89a625b9-4c5f-4130-8b56-afx8010f8103",
            "organizationId": "889e36b8-b175-4371-950e-d0e8a2b56c67",
            "network": "BTC",
            "type": "User",
            "date": "2024-06-10T18:36:18.749Z",
            "currentDeepIndex": 10,
            "index": 0
        },
// The other walllets
    ],
    "pagination": {
        "totalElements": 5,
        "totalPages": 1,
        "skip": 0,
        "take": 10
    },
    "success": true,
    "status": 200
}The reference  is Missing in the parameters.
 response: {
    status: 404,
    statusText: 'Not Found',
    // ...
},Last updated
