Documents
Create a Document
Create a Document using Razorpays API.
POST
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.
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:
401The 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.
The file field is required.
The file field is required.
Code:
400The request did not include a file field. This endpoint expects a multipart/form-data upload with both file and purpose parts.Solution: Submit the request as multipart/form-data with the file attached under the file part.The purpose field is required.
The purpose field is required.
Code:
400The request did not include a purpose field, or the request body was empty.Solution: Include purpose as a form field in the multipart/form-data request body. Use a supported purpose value (for example, dispute_evidence).invalid document upload purpose.
invalid document upload purpose.
Code:
400The value passed for purpose is not one of the supported document-upload purposes. The API echoes the rejected value, for example invalid document upload purpose:completely_invalid_purpose.Solution: Use a supported purpose value (for example, dispute_evidence).Document upload already in progress.
Document upload already in progress.
Code:
400Another document-upload request from the same merchant is already in progress. Razorpay holds a short-lived lock per merchant to prevent concurrent uploads from clashing.Solution: Wait a few seconds and retry the upload.The file may not be greater than 50000 kilobytes.
The file may not be greater than 50000 kilobytes.
Code:
400The uploaded file exceeds the 50 MB (50,000 KB) size limit.Solution: Compress the file or split the content so each upload stays under 50 MB.The file must be a file of type: {allowed types}.
The file must be a file of type: {allowed types}.
Code:
400The uploaded file’s MIME type does not match the allowed types for the supplied purpose. The list of allowed types varies per purpose. For example, kyc_proof accepts pdf, jpeg, jpg, png, jfif, while opgsp_awb accepts only pdf. The error message lists the allowed types for the requested purpose.Solution: Re-upload the document in one of the allowed file types for the requested purpose.