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"
}Wallets
Get Wallet
Retrieves a specific wallet by its Grain wallet ID.
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
Basic authentication using the partner API keys from https://console.grainfinance.co/keys
Path Parameters
The id of the wallet within the Grain platform.
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
The UUID of the Wallet in Grain's system.
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}Example:
"1b0ada1e-fa1b-4cfe-a553-01b340c5650e"
The current balance, in the wallet currency.
Example:
10525
The available balance (total minus reserved/pending amounts), in the wallet currency.
Example:
8500
The collateral amount held against open hedges, in the wallet currency.
Example:
2025
The wallet currency (ISO 4217)
Example:
"EUR"
Account details for depositing funds to this wallet
Show child attributes
Show child attributes