# Document Uploads - Handling Failures/Retries

**URL:** <https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732>\
**Category:** API Support\
**Created:** [May 10, 2020, 9:27pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732 "2020-05-10T21:27:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmtichell](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/jmtichell/32/2370_2.png) [@jmtichell](https://discuss.dwolla.com/u/jmtichell)\
**Post date:** [May 10, 2020, 9:27pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/1 "2020-05-10T21:27:26Z")

</div>

When a document goes through the various failure statuses, what is the recommended way to handle it?

Should the document be deleted before another upload is attempted? Will subsequent uploads trigger a DuplicateResource error if not?

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [May 11, 2020, 2:05pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/2 "2020-05-11T14:05:05Z")

</div>

H @jmtichell – when a document fails approval, we recommendation surfacing the failure reason to the User and prompting them to upload a different document which is valid.

There isn’t a way to remove a Document. A `DuplicateResource` error is returned when the same doc is uploaded again.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![jmtichell](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/jmtichell/32/2370_2.png) [@jmtichell](https://discuss.dwolla.com/u/jmtichell)\
**Post date:** [May 11, 2020, 5:29pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/3 "2020-05-11T17:29:51Z")

</div>

How does Dwolla determine if the document is a duplicate?

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [May 11, 2020, 7:26pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/4 "2020-05-11T19:26:37Z")

</div>

Ah, sorry for the confusion – when I saiid “the same doc” I meant to say the same `file`. For example, if a Document is uploaded and fails with a `"ScanNotReadable"` error, the user can upload a picture of the same document, but not upload the same file that was previously uploaded which failed verification.

---

<div class="post-metadata">

**Author:** ![jmtichell](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/jmtichell/32/2370_2.png) [@jmtichell](https://discuss.dwolla.com/u/jmtichell)\
**Post date:** [May 11, 2020, 9:00pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/5 "2020-05-11T21:00:25Z")

</div>

Thank you for the help. If a user were to do the following, would step #3 succeed - or would it fail since the filename is the same?

1. User uploads a .jpeg of a driver’s license named my\_license.jpeg
2. Dwolla can’t read the file and returns a “ScanNotReadable” error.
3. User uploads a NEW scan of the drvier’s license also named my\_license.jpeg.

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [May 11, 2020, 10:40pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/6 "2020-05-11T22:40:31Z")

</div>

In this case, #3 would succeed in uploading since the actual file would be different.

---

<div class="post-metadata">

**Author:** ![jmtichell](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/jmtichell/32/2370_2.png) [@jmtichell](https://discuss.dwolla.com/u/jmtichell)\
**Post date:** [May 11, 2020, 11:19pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/7 "2020-05-11T23:19:00Z")

</div>

Thanks for the clarification!

---

<div class="post-metadata">

**Author:** ![jmtichell](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/jmtichell/32/2370_2.png) [@jmtichell](https://discuss.dwolla.com/u/jmtichell)\
**Post date:** [June 3, 2020, 2:31pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/8 "2020-06-03T14:31:10Z")

</div>

I’m still having difficulties with this. When I upload the failure test license, I’m not able to re-upload the file (to trigger/test the customer\_verification\_document\_failed webhook) and receive this response when I try and do so:

` {"code":"DuplicateResource","message":"Document already exists.","_links":{"about":{"href":"https://api-sandbox.dwolla.com/documents/115e4a49-ea9f-4842-9df1-872111c13262","type":"application/vnd.dwolla.v1.hal+json","resource-type":"document"}}}`

I’m retrieving the URL that I am uploading the file to from the Dwolla Retreive Customer endpoint:  
body[’\_links’][‘verify-with-document’][‘href’]

Based on the earlier responses, I would expect this to return a ScanNotReadable or other error, not that the document is a duplicate.

---

<div class="post-metadata">

**Author:** ![jlansden](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jlansden](https://discuss.dwolla.com/u/jlansden)\
**Post date:** [June 3, 2020, 11:01pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/9 "2020-06-03T23:01:34Z")

</div>

@sherya I’m having similar issues testing the failure and success of documentation. We have a mobile app only, so I save the images to my photo area. Should this work?

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [June 4, 2020, 6:55pm UTC](https://discuss.dwolla.com/t/document-uploads-handling-failures-retries/5732/10 "2020-06-04T18:55:33Z")

</div>

Hi @jmtichell – it sounds like the same `failed` sample doc is being uploaded twice. If so, the second upload will fail with the `DuplicateResource` error. The first document did get rejected with a `ScanNotReadable` reason.

You’d now have to upload the `approved` sample doc to move the Customer into a verified status. If you were looking to trigger the `customer_verification_document_failed` webhook, you’d have to create a new Customer in document and upload the sample `failed` doc.
