Skip to main content
Version: 2019-05-29 (Current)

Delete Dispute Document

Delete a document from a dispute. This action removes an evidence file that was previously uploaded. Documents can only be deleted while the dispute is still open.


Request Parametersโ€‹

Required - 2 fieldsRequired Parameters
โ–ผ
`id`STRING(required)
Dispute ID (path parameter). The dispute must have status "open" to allow document deletion.
Example:"dspt_test_5xuy4w91xqz7d1w9u0t"
`document_id`STRING(required)
Document ID to delete (path parameter). Format: docu_test_ or docu_live_ followed by alphanumeric string.
Example:"docu_test_5xuy4w91xqz7d1w9u0t"

Responsesโ€‹

200

Document deleted

Document deleted successfully. Returns the deleted document object with deleted set to true.

Response includes:
  • object - Always "document"
  • id - Document ID (docu_*)
  • deleted - Set to true indicating successful deletion
  • livemode - Whether this was a live mode document
After deletion:
  • Document is permanently removed from the dispute
  • Download URL will no longer work
  • Action cannot be undone - you must re-upload if needed

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Invalid dispute ID format
  • Invalid document ID format

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

404

Not found

Dispute or document not found.

Common causes:
  • Incorrect dispute ID
  • Incorrect document ID
  • Document does not belong to this dispute
  • Document was already deleted
  • Dispute or document belongs to different account

422

Unprocessable entity

Document cannot be deleted.

Common causes:
  • Dispute status is not "open" (already pending, won, or lost)
  • Dispute is closed - documents cannot be modified
  • Document has already been submitted to the bank for review

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

curl https://api.omise.co/disputes/dspt_test_5xuy4w91xqz7d1w9u0t/documents/docu_test_5xuy4w91xqz7d1w9u0t \
-X DELETE \
-u skey_test_5xuy4w91xqz7d1w9u0t:

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
authentication_failureInvalid API keyVerify your secret key is correct
not_foundDispute or document not foundCheck both dispute ID and document ID are correct
dispute_not_openDispute is not openDocuments can only be deleted from open disputes
document_already_submittedDocument already sent to bankCannot delete documents already in review

When to Delete Documentsโ€‹

Consider deleting a document when:

  • File was uploaded in error (wrong document)
  • File contains incorrect or outdated information
  • Duplicate document was uploaded
  • Replacing with a better quality version (delete first, then re-upload)

Important Notesโ€‹

NoteDescription
TimingDocuments can only be deleted while dispute is "open"
PermanenceDeletion is permanent and cannot be undone
Re-uploadTo replace a document, delete it first then upload the new version
Pending disputesOnce dispute is pending, documents cannot be modified

๐Ÿ”‘API Credentials

Try it outโ€‹

Required - 2 fields
โ–ผ
Your IP: ...Loading...