Skip to main content
GET
/
wallets
/
{walletId}
cURL
curl --request GET \
  --url https://api.grainfinance.co/v1/wallets/{walletId} \
  --header 'Authorization: Basic <encoded-value>'
import requests

url = "https://api.grainfinance.co/v1/wallets/{walletId}"

headers = {"Authorization": "Basic <encoded-value>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};

fetch('https://api.grainfinance.co/v1/wallets/{walletId}', 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.grainfinance.co/v1/wallets/{walletId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.grainfinance.co/v1/wallets/{walletId}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Basic <encoded-value>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.grainfinance.co/v1/wallets/{walletId}")
.header("Authorization", "Basic <encoded-value>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.grainfinance.co/v1/wallets/{walletId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'

response = http.request(request)
puts response.read_body
{
  "id": "1b0ada1e-fa1b-4cfe-a553-01b340c5650e",
  "totalBalance": 10525,
  "availableBalance": 8500,
  "collateralAmount": 2025,
  "currency": "EUR",
  "depositDetails": {
    "accountHolderName": "Acme Payments Ltd",
    "accountNumber": "8290041523",
    "bankName": "JPMorgan Chase Bank, N.A.",
    "bankAddress": "383 Madison Avenue, New York, NY 10017",
    "bankCountry": "US",
    "bankState": "NY",
    "iban": "<string>",
    "bicSwift": "CHASUS33XXX",
    "routingCode": "<string>",
    "bankCode": "<string>",
    "branchCode": "<string>",
    "sortCode": "560036",
    "bsbCode": "082902",
    "specialInstructions": "<string>",
    "achRoutingCode": "486478148",
    "wireRoutingCode": "419568613"
  }
}
{
"message": "Can't perform this action",
"reason": "Supplied object is in *Cancelled* state, which prevents performing this action"
}

Authorizations

Authorization
string
header
required

Basic authentication using the partner API keys from https://console.grainfinance.co/keys

Path Parameters

walletId
string<uuid>
required

The id of the wallet within the Grain platform. Stringified UUIDv4. See RFC 4112

Pattern: [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}

Response

Wallet Retrieved

id
string
required

The UUID of the Wallet in Grain's system.

Example:

"1b0ada1e-fa1b-4cfe-a553-01b340c5650e"

totalBalance
number<double>
required

The current balance, in the wallet currency.

Example:

10525

availableBalance
number<double>
required

The available balance (total minus reserved/pending amounts), in the wallet currency.

Example:

8500

collateralAmount
number<double> | null
required

The collateral amount held against open hedges, in the wallet currency.

Example:

2025

currency
string
required

The wallet currency (ISO 4217)

Example:

"EUR"

depositDetails
object
required

Account details for depositing funds to this wallet