curl --request GET \
--url https://api.zinc.com/wallet/me \
--header 'Authorization: <api-key>'import requests
url = "https://api.zinc.com/wallet/me"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.zinc.com/wallet/me', 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.zinc.com/wallet/me",
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: <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"
"net/http"
"io"
)
func main() {
url := "https://api.zinc.com/wallet/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.zinc.com/wallet/me")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zinc.com/wallet/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": 123,
"balance": 123,
"wallet_type": "api_consumption",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"spendable_balance": 0,
"order_fee_cents": 0,
"billed_by_invoice": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Wallet
Read your wallet balance and the per-order fee, so you can tell whether an order will clear before you place it.
curl --request GET \
--url https://api.zinc.com/wallet/me \
--header 'Authorization: <api-key>'import requests
url = "https://api.zinc.com/wallet/me"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.zinc.com/wallet/me', 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.zinc.com/wallet/me",
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: <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"
"net/http"
"io"
)
func main() {
url := "https://api.zinc.com/wallet/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.zinc.com/wallet/me")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zinc.com/wallet/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": 123,
"balance": 123,
"wallet_type": "api_consumption",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"spendable_balance": 0,
"order_fee_cents": 0,
"billed_by_invoice": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}POST /orders compares max_price + order_fee_cents against spendable_balance, not balance. Compare against the same figure here instead of discovering the shortfall as a 402.
Which balance to use
| Field | Meaning |
|---|---|
balance | The ledger balance, including in-flight Zinc Connect holds. |
spendable_balance | What the order gate actually checks. Excludes those holds. |
order_fee_cents | Zinc’s API fee per order, at your negotiated rate. |
billed_by_invoice | true for bulk-deal accounts, which are invoiced monthly and skip the balance check entirely. |
zn_test_ key (or X-Test-Mode) this reads the sandbox wallet. Sandbox orders never draw it down.Authorizations
Zinc API key (Bearer zn_...)
Headers
Response
Successful Response
Response model for wallet data.
Beyond the raw balance this carries the two other numbers a client needs to
answer "can I place this order?" without reimplementing the gate in
POST /orders: the spendable balance that gate actually compares
against, and the per-order API fee it adds on top of max_price. Both are
server-derived on purpose — the fee is env-tunable and the two balances
differ for Connect accounts, so a client computing either one locally would
drift.
api_consumption, purchases Balance available to spend on orders, in cents. Excludes in-flight Connect hold reservations, which transiently inflate balance. This is the figure the order balance check compares against.
Zinc's API fee per order, in cents. An order needs max_price + order_fee_cents available (plus the notifications add-on when the order opts into customer emails).
True for bulk-deal customers, who are invoiced monthly. Their orders skip the wallet balance check entirely, so a low balance does not block them.

