Retrieve a document
Retrieve a specific document from a dispute. This endpoint returns detailed information about an evidence file, including the download URL to access the file.
Request Parametersโ
Required - 2 fieldsRequired Parameters
`id`STRING(required)
Dispute ID (path parameter).
`document_id`STRING(required)
Document ID to retrieve (path parameter). Format: docu_test_ or docu_live_ followed by alphanumeric string.
Responsesโ
200
Successful retrievalReturns the document object with complete details including download URL.
Response includes:
object- Always "document"id- Document ID (docu_*)livemode- Whether this is a live mode documentlocation- API path to retrieve the documentdeleted- Whether the document has been deletedfilename- Original filenamekind- Document type (cardholder_details, details_of_purchase, proof_of_receipt, proof_of_acceptance)download_uri- Temporary URL to download the documentcreated_at- When the document was uploaded
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
- Dispute or document belongs to different account
- ID typo or formatting error
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 \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
document = Omise::Document.retrieve(
'dspt_test_5xuy4w91xqz7d1w9u0t',
'docu_test_5xuy4w91xqz7d1w9u0t'
)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
document = omise.Document.retrieve(
'dspt_test_5xuy4w91xqz7d1w9u0t',
'docu_test_5xuy4w91xqz7d1w9u0t'
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const document = await omise.documents.retrieve(
'dspt_test_5xuy4w91xqz7d1w9u0t',
'docu_test_5xuy4w91xqz7d1w9u0t'
);
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$document = OmiseDocument::retrieve(
'dspt_test_5xuy4w91xqz7d1w9u0t',
'docu_test_5xuy4w91xqz7d1w9u0t'
);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Document document = client.documents().retrieve(
"dspt_test_5xuy4w91xqz7d1w9u0t",
"docu_test_5xuy4w91xqz7d1w9u0t"
);
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var document = await client.Documents.Retrieve(
"dspt_test_5xuy4w91xqz7d1w9u0t",
"docu_test_5xuy4w91xqz7d1w9u0t"
);
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
document, _ := client.Document.Retrieve(
"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 | Document not found | Check both dispute ID and document ID are correct |
invalid_document_id | Document ID format invalid | Use valid docu_ format |
Download URL Notesโ
- The
download_uriis a temporary signed URL - URL expires after a period (typically 15 minutes to 1 hour)
- Request a new document retrieval to get a fresh download URL if expired
API Credentials
Try it outโ
Required - 2 fields
Your IP:
...Loading...