InvalidScopeError in sandbox when listing funding sources

I’m using the dwolla ruby gem ( I have dwolla configured as such:

$dwolla =
  environment: Rails.env.production? ? :production : :sandbox

confirmed I’m in sandbox in console. running $dwolla returns #<DwollaV2::Client key="RxWTKzcPctZTMG242JZXmA4GimbR1rr7PpAF5Z8CGP3reKZWlf" environment=:sandbox>

I generated an app_token by:
app_token = $dwolla.auths.client

When trying to list funding sources I get the InvalidScopeError 401 response:

I understand that this functionality is limited in production to those with with a specific scope that was approved by dwolla (ex. ManageCustomers), but am under the impression sandbox should have no such limitations

This person seemed to have the same problem but no resolution is listed: InvalidScopeError when listing funding sources

Hi @alisonmtague – That’s correct, Sandbox doesn’t have limitation on the default settings like creating Customers, funding-sources and transfers.

For this particular error, it looks like the account id in the request endpoint is actually a Customer id. In order to list the funding-sources for a Customer, the endpoint you want to call would be the following -

Let me know if that fixes the issue!