Create a Document
POST
/v1/documents
Click to copy
Use this endpoint to upload a document onto the Razorpay ecosystem. After a document is successfully uploaded, the corresponding document id (present in response) can be provided in cases such as dispute evidence submission.
Is this page helpful?
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X POST 'https://api.razorpay.com/v1/documents' \3-H "Content-Type: multipart/form-data" \4-F 'purpose=dispute_evidence' \5-F 'file=@/Users/your_name/sample_uploaded.jpeg'
Success
Failure
1{2"id": "doc_EsyWjHrfzb59Re",3"entity": "document",4"purpose": "dispute_evidence",5"name": "doc_19_12_2020.jpg",6"mime_type": "image/png",7"size": 2863,8"created_at": 15906042009}
Response Parameters
id
string
The unique identifier of the document uploaded.
entity
string
Indicates the type of entity. In this case, it is document
.
purpose
string
The reason you are uploading this document. Here, it is dispute_evidence
.
size
integer
Indicates the size of the document in bytes.
mime_type
string
Indicates the nature and format in which the document is uploaded. Possible values include:
- image/jpg
- image/jpeg
- image/png
- application/pdf
created_at
integer
Unix timestamp at which the document was uploaded.
Errors
The API <key/secret> provided is invalid.
Error Status: 401
The 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.
Solution
Create a Document
POST
/v1/documents
Click to copy
Use this endpoint to upload a document onto the Razorpay ecosystem. After a document is successfully uploaded, the corresponding document id (present in response) can be provided in cases such as dispute evidence submission.
Is this page helpful?
Response Parameters
id
string
The unique identifier of the document uploaded.
entity
string
Indicates the type of entity. In this case, it is document
.
purpose
string
The reason you are uploading this document. Here, it is dispute_evidence
.
size
integer
Indicates the size of the document in bytes.
mime_type
string
Indicates the nature and format in which the document is uploaded. Possible values include:
- image/jpg
- image/jpeg
- image/png
- application/pdf
created_at
integer
Unix timestamp at which the document was uploaded.
Errors
The API <key/secret> provided is invalid.
Error Status: 401
The 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.
Solution
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X POST 'https://api.razorpay.com/v1/documents' \3-H "Content-Type: multipart/form-data" \4-F 'purpose=dispute_evidence' \5-F 'file=@/Users/your_name/sample_uploaded.jpeg'
Success
Failure
1{2"id": "doc_EsyWjHrfzb59Re",3"entity": "document",4"purpose": "dispute_evidence",5"name": "doc_19_12_2020.jpg",6"mime_type": "image/png",7"size": 2863,8"created_at": 15906042009}