curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X GET https://api.razorpay.com/v1/documents/doc_EsyWjHrfzb59Re
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String documentId = "doc_EsyWjHrfzb59Re";
Document document = instance.document.fetch(documentId);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
documentId = "doc_NiyXWXXXXXXXXX"
client.document.fetch(documentId)
$api = new Api($key_id, $secret);
$documentId = "";
$api->document->fetch($documentId);
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
documentId = "doc_NiyXWXXXXXXXXX"
Razorpay::Document.fetch(documentId)
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
var documentId = "doc_EsyWjHrfzb59Re";
instance.documents.fetch(documentId);
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
documentId = "doc_NiyXWXXXXXXXXX"
body, err := client.Document.Fetch(documentId, nil, nil)
razorpay documents fetch doc_1234567890abcd
{
"id": "doc_EsyWjHrfzb59Re",
"entity": "document",
"purpose": "dispute_evidence",
"name": "file_19_18_2020.jpg",
"mime_type": "image/png",
"size": 2863,
"created_at": 1590604200
}
{
"error":{
"status_code": 401,
"description":"The API `<key/secret>` provided is invalid.",
"code":"BAD_REQUEST_ERROR"
}
}
Documents
Fetch Document Information
Fetch Document Information using Razorpays API.
GET
/
v1
/
documents
/
:id
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X GET https://api.razorpay.com/v1/documents/doc_EsyWjHrfzb59Re
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String documentId = "doc_EsyWjHrfzb59Re";
Document document = instance.document.fetch(documentId);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
documentId = "doc_NiyXWXXXXXXXXX"
client.document.fetch(documentId)
$api = new Api($key_id, $secret);
$documentId = "";
$api->document->fetch($documentId);
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
documentId = "doc_NiyXWXXXXXXXXX"
Razorpay::Document.fetch(documentId)
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
var documentId = "doc_EsyWjHrfzb59Re";
instance.documents.fetch(documentId);
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
documentId = "doc_NiyXWXXXXXXXXX"
body, err := client.Document.Fetch(documentId, nil, nil)
razorpay documents fetch doc_1234567890abcd
{
"id": "doc_EsyWjHrfzb59Re",
"entity": "document",
"purpose": "dispute_evidence",
"name": "file_19_18_2020.jpg",
"mime_type": "image/png",
"size": 2863,
"created_at": 1590604200
}
{
"error":{
"status_code": 401,
"description":"The API `<key/secret>` provided is invalid.",
"code":"BAD_REQUEST_ERROR"
}
}
Available in🇮🇳 India🇲🇾 Malaysia🇸🇬 Singapore🇺🇸 United States
Use this endpoint to retrieve the details of any document that was uploaded earlier.
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X GET https://api.razorpay.com/v1/documents/doc_EsyWjHrfzb59Re
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String documentId = "doc_EsyWjHrfzb59Re";
Document document = instance.document.fetch(documentId);
import razorpay
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
documentId = "doc_NiyXWXXXXXXXXX"
client.document.fetch(documentId)
$api = new Api($key_id, $secret);
$documentId = "";
$api->document->fetch($documentId);
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
documentId = "doc_NiyXWXXXXXXXXX"
Razorpay::Document.fetch(documentId)
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
var documentId = "doc_EsyWjHrfzb59Re";
instance.documents.fetch(documentId);
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
documentId = "doc_NiyXWXXXXXXXXX"
body, err := client.Document.Fetch(documentId, nil, nil)
razorpay documents fetch doc_1234567890abcd
{
"id": "doc_EsyWjHrfzb59Re",
"entity": "document",
"purpose": "dispute_evidence",
"name": "file_19_18_2020.jpg",
"mime_type": "image/png",
"size": 2863,
"created_at": 1590604200
}
{
"error":{
"status_code": 401,
"description":"The API `<key/secret>` provided is invalid.",
"code":"BAD_REQUEST_ERROR"
}
}
Path Parameters
string
required
The unique identifier of the document.
Response Parameters
string
The unique identifier of the document uploaded.
string
Indicates the type of entity. In this case, it is
document.string
The reason you are uploading this document. Here, it is
dispute_evidence.integer
Indicates the size of the document in bytes.
string
Indicates the nature and format in which the document is uploaded. Possible values include:
- image/jpg
- image/jpeg
- image/png
- application/pdf
integer
Unix timestamp at which the document was uploaded.
Errors
The API `<key/secret>
` provided is invalid.
The API `<key/secret> ` provided is invalid.
Code:
400The API credentials passed in the API call differ from the ones generated on the Dashboard.- Different keys for test mode and live modes.
- Expired API key.
_id is not a valid id.
_id is not a valid id.
Code:
400- The id is not 14 characters long.
- The id is not alphanumeric.
Invalid file id provided or merchant is unauthorized to access the fileId(s) provided.
Invalid file id provided or merchant is unauthorized to access the fileId(s) provided.
Code:
400The id does not exist, or it belongs to a different merchant. The API returns the same error for both cases for security reasons (so callers cannot enumerate other merchants’ document ids).Solution: Pass a valid id that was created by this merchant account.Was this page helpful?