Upload Document For E-Sign
curl --request POST \
--url https://sandbox.cashfree.com/verification/esignature/document \
--header 'Content-Type: multipart/form-data' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--form document='@example-file'import requests
url = "https://sandbox.cashfree.com/verification/esignature/document"
files = { "document": ("example-file", open("example-file", "rb")) }
headers = {
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('document', 'DOCUMENT.pdf');
const options = {
method: 'POST',
headers: {'x-client-id': '<api-key>', 'x-client-secret': '<api-key>'}
};
options.body = form;
fetch('https://sandbox.cashfree.com/verification/esignature/document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cashfree.com/verification/esignature/document",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\nDOCUMENT.pdf\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/verification/esignature/document"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\nDOCUMENT.pdf\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cashfree.com/verification/esignature/document")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\nDOCUMENT.pdf\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/verification/esignature/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\nDOCUMENT.pdf\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"document_id": 21637861
}E-sign
Upload Document For E-Sign
Use this API to upload the document before creating the request for E-Sign. The document ID received in the response of this API is required to create the request for E-Sign.
POST
/
esignature
/
document
Upload Document For E-Sign
curl --request POST \
--url https://sandbox.cashfree.com/verification/esignature/document \
--header 'Content-Type: multipart/form-data' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--form document='@example-file'import requests
url = "https://sandbox.cashfree.com/verification/esignature/document"
files = { "document": ("example-file", open("example-file", "rb")) }
headers = {
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('document', 'DOCUMENT.pdf');
const options = {
method: 'POST',
headers: {'x-client-id': '<api-key>', 'x-client-secret': '<api-key>'}
};
options.body = form;
fetch('https://sandbox.cashfree.com/verification/esignature/document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cashfree.com/verification/esignature/document",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\nDOCUMENT.pdf\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/verification/esignature/document"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\nDOCUMENT.pdf\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cashfree.com/verification/esignature/document")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\nDOCUMENT.pdf\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/verification/esignature/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\nDOCUMENT.pdf\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"document_id": 21637861
}Authorizations
Your unique client identifier issued by Cashfree. You can find this in your Merchant Dashboard.
The secret key associated with your client ID. Use this to authenticate your API requests. You can find this in your Merchant Dashboard.
Headers
Send the signature if two-factor authentication is selected as Public Key. More details.
Body
multipart/form-data
Find the request parameters to upload the document.
Upload the document that requires an e-sign. Allowed file type - PDF. Max file size allowed - 10MB.
Response
Success response for uploading the document for e-signature.
Was this page helpful?
āI