Skip to main content
  • For: treasurers, and leaders running a camp or trip
  • You get: a Not paid tab and a Failed Direct Debits tab, refreshed every morning
  • Time: about ten minutes
  • Scopes: payments:read, payments.people:read, members:read and events:read
Before a camp, someone has to chase the families who have not paid. This recipe lists every payment request that is not yet paid, with the young person, the parent to contact, what it is for and when it was due. A second tab lists the Direct Debits that failed, so you can ask the family to check their bank.

1. Try the requests

Paste these into a terminal to see the demo group’s unpaid requests and failed payments:

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

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.

4. Run it

Choose whoHasntPaid and press Run. The first time, Google asks you to allow the script to reach an outside service.
  • Not paid lists each request still waiting for money, oldest due date first. Being collected means a Direct Debit is on its way: give it a few days before you chase.
  • Failed Direct Debits lists each collection that failed, that the parent’s bank refused, or that it reversed, newest first.
To refresh it every morning, add a Day timer trigger for whoHasntPaid, as in Your members in Google Sheets.

5. Switch to your group

Change api-demo.scoutworks.app to api.scoutworks.app, and replace the sandbox key with your own. The key needs payments:read for the amounts and dates, payments.people:read for the parent and the young person each payment is for, members:read for names and events:read for camp and trip names.
This sheet holds parents’ names and emails, and who owes money. Share it only with the leaders who need it, and delete it when the camp is paid for.

Variations

  • One camp. Filter the For column, or keep only rows whose request has the camp’s eventId.
  • Hear about a failure the moment it happens. Tell the treasurer when a Direct Debit fails sends a message within a minute, using a webhook.
  • Chase by email. Use the Email column with a mail merge add-on. Write the message yourself: a kind reminder works better than a demand.

If something goes wrong

  • The Young person or Parent column is empty: the key does not have payments.people:read.
  • 403 insufficient_scope: the key is missing one of the scopes above. The message says which.
See Errors for every code.