Unable to create an unverified and a verified customer

Hi,
I have created 3 receive only customers accounts in sandbox and also done one transaction, but now that I want to create the unverified and verified customers I think there is no way I can do that. I have searched in the customers option, but I can not find the step to move on.

Thanks,
Diamufuama

Hi @Diamufuama – I’m afraid creating Unverified and Verified Customer types isn’t supported through the Dashboard. You would have to call the Dwolla API in order to create these Customer types.

You can find more information on creating Customers via the API in our Docs!
Here’s also a helpful guide that walks you through creating an authorization which is needed to start calling the API.

Let us know if you come across any questions, we’d be happy to help! :slight_smile:

1 Like

Hi,
I get the following message when I call the Dwolla API:{“code”:“InvalidCredentials”,“message”:“Missing or invalid Authorization header.”}

Regards,
Pedro

Hi Pedro – It looks like the value you’re passing in the Authorization header might be wrong. Are you able to confirm that you are passing the word Basic followed by a space and a base64-encoded string client_id:client_secret as the value like in the following example?

Authorization: Basic Base64(client_id:client_secret)

Your client_id and client_secret can be found in the Sandbox Dashboard under Applications (see screenshot).

Hope that helps! If not, I’d be happy to take a look at the request/response bodies and see what’s causing the error! Let me know!

Hi, this is also happening to me, even when creating the token from the “Create Token” button in the Applications page. I thought maybe I was sending the request wrong but I was able to create a receive-only customer with it.

@shreya I’m making the request with Postman, don’t know if that has to do something with the result. The Postman exported curl request:

curl --location --request POST 'https://api-sandbox.dwolla.com/customers' \
--header 'Accept: application/vnd.dwolla.v1.hal+json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cfduid={cookie}; __cf_bm={cookie}' \
--data-raw '{"firstName":"Name","lastName":"Last","email":"name.last@test.com"}'

I would like some assistance with this, thanks!

Hi @armando, just wanted to confirm, the resulting error you’re receiving from the curl request shown above is {“code”:“InvalidCredentials”,“message”:“Missing or invalid Authorization header.”}

Hi, sorry, the response I’m getting is a 403 with the message: “The supplied credentials are not authorized for this resource.”

Hi @armando, I believe I found the culprit which was a permissions issue on your Sandbox account. This should be resolved now. Would you be able to give this request another shot?

It’s working now. Thanks a lot! Finally, Is there a way to convert receive-only users to unverified, or I just have to deactivate them and create them back? Thanks again!

Hey there!

I am having this same issue as well, I have received the same error, for the Authorization: Basic Base64(client_id:client_secret) am I suppose to add this in my index.js as is or should I assign it to a variable?

Should i stick that in the here somewhere:
app.get("/create-customer", function (req, res) { generateClientToken("customer.create").then((cRes) => { res.status(200).render(create-customer, { token: cRes.token }); }); });
i am stumped!
:slight_smile:

Hi @akikoLPF – Are you using the above value for the Authorization header as is? If so, you’d need to convert the “your_client_id:your_client_secret” to Base 64 and plug that value in the Authorization header after "Basic ".

Are you using one of our SDKs for making calls to the API? If so, you might not even need to handle the token creation as some of our SDKs (like dwolla-v2-node) handle token creation for you; you would just need to instantiate the Dwolla client.

Uhmm, so I have the proper SDK installed, I am currently using node.js one. However, It is still giving me the same error messages of invalid auth header.

What I am specifically asking is how I am supposed to have the Authorization: Basic Base64(client_id: secret) stored. Like does it need to be stored in a variable? like this: let auth = Authorization: Basic Base64(client_id: secret) or is this supposed to be located in another file because right now it is in my index.js file.

Right now, nothing seems to be working…

No, you shouldn’t need to save it into a variable. The “Authorization” is meant to be sent to Dwolla as an API request header when creating an access-token, like so,

POST https://api-sandbox.dwolla.com/token
Authorization: Basic YkVEMGJMaEFhb0pDamplbmFPVjNwMDZSeE9Eb2pyOUNFUzN1dldXcXUyeE9RYk9GeUE6WEZ0bmJIbXR3dXEwNVI1Yk91WmVOWHlqcW9RelNSc21zUU5qelFOZUFZUlRIbmhHRGw=
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials

However, since you’re using the Node SDK, you do not have to set the Authorization header at all. When you instantiate the Client in your index.js file, the token is automatically generated about every 60 minutes, before the previous one expires. You can also reference this file from the drop-ins-examples repo since it uses our Node sdk under the hood as well.

1 Like

So this is where I am very confused because I have the SDK installed, and i am using this exact example repo here. Yet, I am still getting the Dwolla API:{“code”:“InvalidCredentials”,“message”:“Missing or invalid Authorization header.”} error.

I am not sure what I am missing or doing wrong? Should I specifically be making a post request in index.js to Dwolla in order for this error to be fixed? :thinking:

example:

fetch('https://api-sandbox.dwolla.com/token', { method: 'POST' headers: { 'Content-Type': 'application/x-www-form-urlencoded', Authorization: Basic Base64(client_id: secret) }, body: JSON.stringify(data), }) .then(response => response.json()) .then(data => { console.log('Success:', data); }) .catch((error) => { console.error('Error:', error); });

Thank you!!

Hmm…it indicates that the issue has to do with what is set as the Authorization header value. Would you be able to share in a DM what your key and secret are, as well as what is generated as the Base64(client_id: secret) value?

You can also skip generating tokens if you’re using the node SDK. The SDK generates tokens automatically once you instantiate the Client as in the following code snippet.

Are you able to make calls to other endpoints from the same file (index.js) where you are instantiating the client with the following code?

var Client = require("dwolla-v2").Client;

var dwolla = new Client({
  key: process.env.DWOLLA_APP_KEY,
  secret: process.env.DWOLLA_APP_SECRET,
  environment: "sandbox", // defaults to 'production'
});
1 Like

Hey there,

Yes, I can send you a DM of my key and secret I am using!