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.
`document_id`STRING(required)
Document ID to delete (path parameter). Format: docu_test_ or docu_live_ followed by alphanumeric string.
Responsesโ
200
Document deletedDocument 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 deletionlivemode- Whether this was a live mode document
- 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 requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid dispute ID format
- Invalid document ID format
401
UnauthorizedAuthentication 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 foundDispute 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 entityDocument 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 errorServer-side error occurred. These are rare but should be handled gracefully.
How to handle:
- Retry the request with exponential backoff
- Check status.omise.co for service incidents
- See Error Handling for detailed guidance
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/disputes/dspt_test_5xuy4w91xqz7d1w9u0t/documents/docu_test_5xuy4w91xqz7d1w9u0t \
-X DELETE \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
document = Omise::Dispute.delete_document(
'dspt_test_5xuy4w91xqz7d1w9u0t',
'docu_test_5xuy4w91xqz7d1w9u0t'
)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
document = omise.Dispute.delete_document(
'dspt_test_5xuy4w91xqz7d1w9u0t',
'docu_test_5xuy4w91xqz7d1w9u0t'
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const document = await omise.disputes.deleteDocument(
'dspt_test_5xuy4w91xqz7d1w9u0t',
'docu_test_5xuy4w91xqz7d1w9u0t'
);
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$document = OmiseDispute::deleteDocument(
'dspt_test_5xuy4w91xqz7d1w9u0t',
'docu_test_5xuy4w91xqz7d1w9u0t'
);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Document document = client.disputes().deleteDocument(
"dspt_test_5xuy4w91xqz7d1w9u0t",
"docu_test_5xuy4w91xqz7d1w9u0t"
);
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var document = await client.Disputes.DeleteDocument(
"dspt_test_5xuy4w91xqz7d1w9u0t",
"docu_test_5xuy4w91xqz7d1w9u0t"
);
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
document, _ := client.DeleteDisputeDocument(
"dspt_test_5xuy4w91xqz7d1w9u0t",
"docu_test_5xuy4w91xqz7d1w9u0t",
)
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
authentication_failure | Invalid API key | Verify your secret key is correct |
not_found | Dispute or document not found | Check both dispute ID and document ID are correct |
dispute_not_open | Dispute is not open | Documents can only be deleted from open disputes |
document_already_submitted | Document already sent to bank | Cannot 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โ
| Note | Description |
|---|---|
| Timing | Documents can only be deleted while dispute is "open" |
| Permanence | Deletion is permanent and cannot be undone |
| Re-upload | To replace a document, delete it first then upload the new version |
| Pending disputes | Once dispute is pending, documents cannot be modified |
API Credentials
Try it outโ
Required - 2 fields
Your IP:
...Loading...