Skip to main content
  • For: trustees and treasurers
  • You get: a Budget transfers tab listing each move between budgets this year: when, from which budget, to which, and how much
  • Time: about ten minutes
  • Scopes: accounting:read
A budget the trustees agreed at the start of the year changes as the year goes on: the Beavers underspend, the summer trip costs more, and the treasurer moves money between budgets. Trustees should see every move. This recipe lists them, with the budgets’ names, for the year that is open now. No money moves in the bank when a budget changes. A budget transfer only changes what each budget has left to spend.

1. Try the request

Paste this into a terminal to see the demo group’s budget transfers:
Each move has its accounting year (periodId), the two budgets (sourceBudgetId and destinationBudgetId), the amount in pounds and when it was made (createdAt). The reason the treasurer typed is shown in Scoutworks, on the budget, but the API does not return it.

2. Add the script

In your Google Sheet, choose Extensions → Apps Script. Delete what is there, paste the script below and choose Save.
Code.gs

3. Add your key and run it

Choose Project Settings (the cog), then Script Properties → Add script property. Property: SCOUTWORKS_API_KEY. Value: the sandbox key to try it, or your own key. Then choose budgetTransfers and press Run.

4. Switch to your group

Change api-demo.scoutworks.app to api.scoutworks.app, and replace the sandbox key with your own. The key needs only accounting:read. The sheet holds budget names and amounts, and no one’s name, so it is safe to share with every trustee.

Variations

  • One budget’s history: add &budgetId= and the budget’s id to the /budget-transfers request. It lists moves in and out of that budget.
  • Last year: pick the closed year from /accounting-periods instead of the open one.

If something goes wrong

  • 403 insufficient_scope: the key does not have accounting:read.
  • 400 invalid_request naming periodId or budgetId: the id is not one of your group’s. Read it again from /accounting-periods or /budgets.
See Errors for every code.