The supplied credentials are not authorized for this resource

Hello Dwolla team - I am getting an error where my production credentials say:

"error": "invalid_client"

But if I switch things to sandbox and use those credentials, I get the token just fine. This issue is occurring for both the SDK and raw requests. This is also seem to affect my unverified customer creation as this code:

dwollav2.error.ForbiddenError: {"code":"Forbidden","message":"The supplied credentials are not authorized for this resource."}

This error occurs at line:

request_body = {
        'firstName': p.first_name,
        'lastName': p.last_name,        
        'email': current_user.email,
        'ipAddress':p.ip}

customer = app_token.post('customers', request_body)

Any suggestions? In sandbox, everything works as expected. In production is when I have these issues.

Hi @Bryan_Marks, If you are primarily initiating payouts to end-users and are signed up for the Pay as you go pricing plan, you may be restricted to only creating the Receive-only Customer type. Assuming that is true, you’ll likely need to add "type": "receive-only" to the body of your request.

Hello Spencer,

My account has been approved for production - can you confirm I can create users who can send and receive funds?

Hi @Bryan_Marks, we just reviewed your account and updated the configuration to create users that can send and receive funds. Please let us know if you continue to experience errors/issues!

Awesome - thank you! Will update this thread if anything else pops up.

1 Like

Hello Spencer,

When creating a funding source with Plaid Dwolla, the response for reacting the funding source does not contain a funding source.

Here is the code:

  request_body = {
          'plaidToken': processor_token,
          'name': p.first_name + ' ' + p.last_name
        }


                customer = app_token.post('%s/funding-sources' % p.dwolla_customer_url, request_body)
                funding_source = customer.headers['location']

Here is the response:
{'_links': {'self': {'href': 'https://api.dwolla.com/customers/2d73c0f3-972c-403e-823f-52815678**/funding-sources', 'type': 'application/vnd.dwolla.v1.hal+json', 'resource-type': 'funding-source'}, 'customer': {'href': 'https://api.dwolla.com/customers/2d73c0f3-972c-403e-8*********', 'type': 'application/vnd.dwolla.v1.hal+json', 'resource-type': 'customer'}}, '_embedded': {'funding-sources': []}}

Notice that the funding source is nil. It does work in development mode. I am following this guide:
https://developers.dwolla.com/guides/plaid/create-funding-source#step-2---create-a-funding-source-for-a-customer-using-a-plaidtoken

Actually sorry please ignore! This code does work :slight_smile: thanks!

1 Like