Skip to main content
  • For: treasurers
  • You get: a transfer between two of your own accounts recorded in Scoutworks, both sides at once, from a sheet row or a shortcut on your phone
  • Time: about fifteen minutes
  • Scopes: accounting:read and accounting:write
You moved £500 from savings to the current account for camp. In Scoutworks that is one transfer with two sides: money out of savings and into current. This recipe records it from a Google Sheet, or from a phone shortcut while you are still in the banking app. Nothing moves in the bank: it records a transfer you have already made.
This recipe changes your books, so the read-only sandbox key cannot run it. Use your own key with accounting:write, and try it on one made-up transfer first.

1. Create a key and find your accounts

A group admin creates a key in Settings → Integrations → API keys with accounting:read and accounting:write. A transfer the key records shows that admin as the person who added it, and Scoutworks marks it as added by the key. List your accounts to find their ids. Try it on the demo group first:
With your own key, call https://api.scoutworks.app/api/v1/bank-accounts and copy the id of each account you move money between.

2. Lay out the sheet

Make a tab called Transfers. Row 1 holds headings. From row 2, one transfer a row: Format column A as Format → Number → Plain text before you type, so a date is always read as day, month, year.

3. Add the script

Choose Extensions → Apps Script. Delete what is there, paste the script below and choose Save. Then add a script property SCOUTWORKS_API_KEY with your key, in Project Settings → Script Properties.
Code.gs

4. Try it on one transfer

1

Add one made-up transfer

One row: today’s date, your two account ids, 0.01, and TEST from the Scoutworks recipe.
2

Run it

Choose recordTransfers and press Run. The first time, Google asks you to allow the script to reach an outside service. Column F gets an id that starts transfer_.
3

Check it in Scoutworks

Open Finance → Transactions. The test shows twice: 1p out of the first account and 1p into the second, both marked as a transfer.
4

Undo it

Delete the transfer in Scoutworks, which deletes both sides, or send DELETE /transfers/{id} with the id from column F. Then delete the test row.

5. Run it

Add a row for each transfer and choose Run. A row that already has an id is skipped, so you can keep one running list.

From your phone

An iPhone Shortcut can record a transfer while you are still in the banking app. Make a shortcut with Ask for Input (a number: the amount), then Get Contents of URL:
  • URL: https://api.scoutworks.app/api/v1/transfers
  • Method: POST
  • Headers: Authorization = Bearer and your key; Idempotency-Key = the Current Date formatted as yyyyMMddHHmm and the amount, so pressing it twice in the same minute records one transfer.
  • Request Body: JSON, with fromBankAccountId and toBankAccountId typed in once, amount from the input (with two decimal places, for example 500.00), date as Current Date formatted yyyy-MM-dd, and description.
Keep the key only in the shortcut, on a phone with a passcode. Anyone with the shortcut can add to your books.

Changing or deleting one

PATCH /transfers/{id} changes the amount, dates, description or reference of both sides together, and DELETE /transfers/{id} deletes both. Each works only on a transfer the API recorded, whose sides are not yet matched to a bank statement: anything else answers 409 source_locked, so change it in Scoutworks. Send the ETag you last read as If-Match; if the transfer changed since, the answer is 412 stale_write and nothing changes.

If something goes wrong

  • 400 invalid_request: usually an account id that is wrong, closed or not your group’s, or the same account twice. The message says which.
  • 409 period_closed: the date is in an accounting year that is closed.
  • 403 insufficient_scope: the key needs accounting:read and accounting:write.
  • The arriving side has a different date on its statement: send destinationDate too, up to 7 days after date.
See Errors for every code.