Uploading documents via application's Frontend

In the documentation it implies that we can upload a document from the client of my web app to dwolla by generating a client token. However, it is not clear how to use it besides the drop-in components. I have a bit of a custom setup, where my server will provide the client token to the client but not sure how to handle the upload logic in my client once I’ve received the token from the server. By this I mean I can’t find code examples of how to upload an image from the client once I have the token. Is the CDN the only way to go for this? I am using NodeJs

Hi @Engineering_Archie – after creating the client-token with the action for uplading a document, you can simply call the <dwolla-document-upload> drop in and provide it the ID of the customer you want to upload a document for.

<dwolla-document-upload customerId="{{ customer.id }}"></dwolla-document-upload>

You might find this examples repo helpful (it’s a Node.js app that uses Express). Here’s the specific file where the document upload drop in is being used.

Yes – currently, we only have support through the CDN.

Hope that helps! Please let us know if you have any questions!

@shreya Thanks, that sounds good. Is there a different URL format to upload document for beneficial owners? I try with id from this URL: https://api-sandbox.dwolla.com/beneficial-owners/8edc295d-e6ea-4ef5-a985-1ad9f7e96c8c which is what I store, but keep getting resource not found

Ah for beneficial-owners you’d need to create a client-token with a different action than for a Customer - "beneficialowner.documents.create" (reference).

When you get a chance, please give it a try and let me know if you run into any issues!

Thanks for the info, we continue to get resources not found when generating the clien totken. This is preventing us from being able to upload documents to verify Benefecial owners in prod. Using the beneficial owner’s URL: ‘https://api-sandbox.dwolla.com/beneficial-owners/0fa83e0e-4db2-4e8a-a13e-9508099afd0e’ with action "beneficialowner.documents.create", and then just appending /customers/{benenficialOwnerId} with beneficialowner.documents.create. The upload works for regular customers but failing for beneficial owners.

Were you getting the error on Client token creation or when using the drop-in? If it’s the latter, then you can find an example of using the drop-ins for beneficial owners in this line of the examples repo.

<dwolla-document-upload customerId="customerId" ownerId="ownerId" type="beneficial-owner"></dwolla-document-upload>

@shreya Our issue is generating the token on the serverside for beneficial owners, weirdly we could generate it using the customer action

Hi @Engineering_Archie , Flow UI components such as the beneficial owners component may require multiple requests to /client-tokens to generate a granular scoped token that’s used in various steps throughout the lifecycle of the component.

What does your server-side endpoint look like that’s tasked with taking in requests from the dwolla-web.js library and generating a client token that gets sent client-side to authenticate requests?

Hello Dwolla,

We are trying to use the drop-in component for document upload and see this error when the form tries to render:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘documents’)
at dwolla-web.js:182

our customer in sandbox does not have any documents at the moment. Here is the customer id url:


And we are created our client token with an end point as such, and are using the token property on configuration.

var requestBody = {
_links: {
customer: {
href: ${customer.dwollaLocation}
action: ‘customer.documents.create’

const res = await dwolla.post(`/client-tokens`, requestBody);
return {token: res.body.token};

Hi @Saveraa_LLC

It looks like 64bce764-038f-4fc8-a82e-21d4b15bb654 is a Personal Verified Customer, so you may need to use /tokenURL

I attached the difference between them below and a link to our Drop-in examples repo as well

Let us know if you reach any other blockers