Running the recipes

Short, ready-to-use answers to everyday finance questions — with Postman, an AI assistant, or a small script.

Recipes answer one everyday finance question each — what did we spend last month?, what do we have to pay this week? — with as little code as possible. Each one gives you three ways to get the answer:

  • Postman, no code — send the request from our Postman collection and read the result.
  • An AI assistant — ask the question in plain language through the Spendesk MCP server.
  • A script — a short Python script you can copy, run and schedule, which writes a CSV or prints a summary.
RecipeAnswers
Export a month of spend to a spreadsheetEvery expense of a month, with supplier or employee, amount, cost center, bookkeeping status and receipt
List the invoices due this weekThe approved supplier invoices to pay in the next days, overdue ones first, with the total per currency
Month-end close checklistWhat is still missing before closing a month: receipts, exports, approvals, failed exports
Check the wallet balanceThe wallet balance, what is available or committed, and the latest wallet loads

For a full accounting export, see Exporting accounting data.

Before you start

An API key with the right scopes

An Account Owner or Admin creates an API key in Spendesk, under Settings → Integrations → Manage API access, and ticks the scopes each recipe lists. Scopes starting with experimental: are granted on request: ask your CSM or write to [email protected]. See Scopes.

With an organisation-level API key (several entities), also note the ID of the company you want: Get Companies lists them. Each recipe then answers for that company — run it once per company. See Organisation-level access.

For the scripts: Python 3

The scripts need Python 3.9 or later and nothing else — no package to install. Check with python3 --version.

Keep the key out of the script: pass it through environment variables, in the terminal where you run the script.

export SPENDESK_CLIENT_ID="your client ID"
export SPENDESK_CLIENT_SECRET="your client secret"
# Only with an organisation-level key:
export SPENDESK_COMPANY_ID="the company ID"
# Only to try the recipe on your demo account:
export SPENDESK_BASE_URL="https://public-api.demo.spendesk.com"

python3 monthly_spend.py

On Windows, use set SPENDESK_CLIENT_ID=… in the Command Prompt, or $env:SPENDESK_CLIENT_ID="…" in PowerShell, and python instead of python3.

Good to know

  • Amounts are in the smallest unit of the currency — cents for EUR, GBP or USD: the scripts divide them by 100. For a currency without decimals, such as JPY, remove the division. See Data types.
  • Data may be cached for a short period: something changed in Spendesk a moment ago may appear a little later.
  • The scripts only read data: they change nothing in Spendesk.