Upload Documents
curl --request POST \
--url https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents \
--header 'Content-Type: multipart/form-data' \
--header 'x-partner-apikey: <x-partner-apikey>' \
--form 'document_type=<string>' \
--form file='@example-file'import requests
url = "https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "document_type": "<string>" }
headers = {"x-partner-apikey": "<x-partner-apikey>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('document_type', '<string>');
form.append('file', '<string>');
const options = {method: 'POST', headers: {'x-partner-apikey': '<x-partner-apikey>'}};
options.body = form;
fetch('https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents', 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://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents",
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_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-partner-apikey: <x-partner-apikey>"
],
]);
$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://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-partner-apikey", "<x-partner-apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents")
.header("x-partner-apikey", "<x-partner-apikey>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-partner-apikey"] = '<x-partner-apikey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"document_type": "bank_statement",
"uploaded_on": "2006-01-02T15:04:05-0700"
}{
"message": "Invalid file format. Allowed formats are jpeg, png, pdf",
"code": "invalid_document_format",
"type": "invalid_request_error"
}{
"message": "Invalid authentication credentials",
"code": "failed_authentication",
"type": "invalid_request_error"
}{
"message": "Merchant not found or linked to partner.",
"code": "partner_connect_not_found",
"type": "invalid_request_error"
}{
"message": "Product is already active for the merchant.",
"code": "merchant_product_is_active",
"type": "invalid_request_error"
}{
"message": "bad URL, please check API documentation",
"code": "request_failed",
"type": "invalid_request_error"
}Merchant Onboarding APIs
Upload Documents
Use this API to upload KYC documents for merchants.
POST
/
merchants
/
{merchant_id}
/
documents
Upload Documents
curl --request POST \
--url https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents \
--header 'Content-Type: multipart/form-data' \
--header 'x-partner-apikey: <x-partner-apikey>' \
--form 'document_type=<string>' \
--form file='@example-file'import requests
url = "https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "document_type": "<string>" }
headers = {"x-partner-apikey": "<x-partner-apikey>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('document_type', '<string>');
form.append('file', '<string>');
const options = {method: 'POST', headers: {'x-partner-apikey': '<x-partner-apikey>'}};
options.body = form;
fetch('https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents', 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://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents",
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_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-partner-apikey: <x-partner-apikey>"
],
]);
$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://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-partner-apikey", "<x-partner-apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents")
.header("x-partner-apikey", "<x-partner-apikey>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-partner-apikey"] = '<x-partner-apikey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"document_type": "bank_statement",
"uploaded_on": "2006-01-02T15:04:05-0700"
}{
"message": "Invalid file format. Allowed formats are jpeg, png, pdf",
"code": "invalid_document_format",
"type": "invalid_request_error"
}{
"message": "Invalid authentication credentials",
"code": "failed_authentication",
"type": "invalid_request_error"
}{
"message": "Merchant not found or linked to partner.",
"code": "partner_connect_not_found",
"type": "invalid_request_error"
}{
"message": "Product is already active for the merchant.",
"code": "merchant_product_is_active",
"type": "invalid_request_error"
}{
"message": "bad URL, please check API documentation",
"code": "request_failed",
"type": "invalid_request_error"
}Supported document types
Supported document types
The
document_type parameter accepts the following values organised by document category:Business proof documents
| Document type | Description |
|---|---|
businessproof_saecertificate | Certificate or licence issued by the appropriate authorities under Shops and Establishment Act and any other Acts as applicable to the firm |
businessproof_regproof | Other government-issued registration proof |
businessproof_municipal | Municipal certificate |
businessproof_udhyog | Udyog Aadhaar |
businessproof_taxreturn | Sales tax and income tax return |
businessproof_roc | Registration certificate from ROC (Registrar of Company for a Jurisdiction) |
businessproof_taxreturnfull | Full tax return |
businessproof_customeragreement | Customer agreement |
businessproof_platformconfirm | Platform confirmation |
businessproof_invoices | Business invoices |
Entity proof documents
| Document type | Description |
|---|---|
entityproof_partnershipdeed | Partnership deed |
entityproof_trustdeed | Trust deed |
entityproof_societycertificate | Society certificate |
entityproof_hufdeed | HUF deed |
entityproof_llp | LLPIN document |
Line of business proof documents
| Document type | Description |
|---|---|
lobproof_nonprofit | Domestic: 80 G, 12 A or International: FCRA |
lobproof_travel | IATA certificate or IRCTC agency certificate |
lobproof_pcidss | AOC for PCI-DSS compliance |
lobproof_gaming | RNG certificate (if applicable), legal opinion |
lobproof_food | FSSAI |
lobproof_bbps | BBPS certificate |
lobproof_jewellery | BIS certificate, 916 Hallmark, 925 Hallmark, or GII certificate |
lobproof_nbfc | NBFCs or Service Level Agreements with RBI approved NBFCs |
lobproof_papg | PA-PG licence |
lobproof_pharmacy | Pharmacy licence, retail or wholesale drug licence, undertaking of authorised signatory under Drugs and Cosmetics Act 1940, declaration (Form 20, Form 21, Form 21B, Form 20B) |
lobproof_ppi | Bank PPI licence or Non Bank PPI licence |
lobproof_mutualfunds | AMFI certificate |
lobproof_fema | FEMA registration, FFMC certificate (FFMC state wise) |
lobproof_ayush | Ayush (manufacturing licence - Form 24D) |
lobproof_sebi | SEBI certificate |
lobproof_insurance | IRDA: Life insurance, general insurance, health insurance or SLA with the insurer if this is being issued by a different party |
lobproof_education | UGC certificate, ICSE, CBSE, or AICTE |
Other documents
| Document type | Description |
|---|---|
bank_statement | Bank statement |
certificate_of_incorporation | Certificate of incorporation |
board_resolution | Board resolution |
gst_certificate | GST certificate |
localtax_identifier | Local tax identifier |
bene_owner_id_proof_1 to bene_owner_id_proof_6 | Beneficial owner ID proofs |
Headers
Your partner API key for authentication
API version to be used for the request
Path Parameters
Unique identifier for the merchant
Body
multipart/form-data
The type of document being uploaded. For the complete list of supported document types, see Supported Document Types.
The KYC document file to upload. Supported formats include PDF, JPG, JPEG, and PNG.
Was this page helpful?
⌘I