Skip to main content
This recipe reads GET /api/v1/balance and prints each figure on its own line. Show them side by side, never added up. When the money cannot be read the API answers 503 and the recipe stops: show the balance as unavailable, never as zero.

Prerequisites

  • MART_API_KEY: your API key, with the money:read scope.
  • MART_API_BASE: https://sandbox.mart.ps while you build, https://mart.ps when you go live.
One runtime: cURL 7.84 or later with jq; Node 22.18 or later, which runs the .ts file as it is; Python 3.9 or later with httpx; PHP 7.4 or later with its curl extension; Go 1.22 or later; or Java 17 or later with Jackson (jackson-databind). Each file reads its variables from the environment and sets a timeout on every call. Run it on your own server: a browser or an app never holds the key.

Run the recipe

Verify the result

available is what a withdrawal may ask for now, held is earned but not matured, and owed is a debt, 0.00 when none. See Balance and statements.

Troubleshooting

Every other code is in the error catalog.