Hushxima
Marketplace

Balance

What accrues to your organisation, the ledger behind it, and how to take it out.

Your organisation holds a balance per chain. It is a claim against the platform treasury rather than a wallet you have keys to, which is why taking money out is a request rather than a transfer.

Where the balance comes from

The main source is funding fees. Half of the platform take on every funding plan your organisation runs is credited back to you, on the plan's chain, once the fee is actually collected. Withdrawals debit it. Everything that moves it lands in the ledger.

GET /balance returns both halves in one call: the per-chain totals, and the ledger entries behind them. Each entry carries a kind, a signed amount, an optional sale_id, and a ref_key that identifies it uniquely.

GET
/balance

Authorization

bearerAuth
AuthorizationBearer <token>

JWT from /auth/login (users) or an org API key (mk_...) for integrations.

In: header

Response Body

application/json

curl -X GET "https://example.com/balance"
{  "balances": [    {      "amount": "string",      "chain": "string"    }  ],  "ledger": [    {      "amount": "string",      "chain": "string",      "created_at": "string",      "id": 0,      "kind": "string",      "note": "string",      "ref_key": "string",      "sale_id": "string"    }  ]}

Withdrawing

POST /balance/withdraw asks for an amount on a chain to be sent to an address you name. It is an organisation-admin action, so it needs a user session and an API key will not do.

What comes back is the ledger entry, not a transaction hash. The debit is recorded immediately and the payout is queued behind it, so the money leaves when the platform processes it. Poll GET /balance to see the entry, and the chain for the transfer itself.

Two things the call refuses outright: an amount of zero or less, with 400, and an amount above your balance on that chain, with 409 and both figures in the message.

The address is not inferred and not remembered. Every withdrawal names its own destination, and it is checked against nothing, so get it right.

POST
/balance/withdraw

Authorization

bearerAuth
AuthorizationBearer <token>

JWT from /auth/login (users) or an org API key (mk_...) for integrations.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/balance/withdraw" \  -H "Content-Type: application/json" \  -d '{    "amount": "string",    "chain": "string",    "to_address": "string"  }'
{  "amount": "string",  "chain": "string",  "created_at": "string",  "id": 0,  "kind": "string",  "note": "string",  "ref_key": "string",  "sale_id": "string"}

Last updated on

On this page