curl --request POST \
--url https://sandbox.cashfree.com/import/transactions/{cf_payment_id} \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <x-client-id>' \
--header 'x-client-secret: <x-client-secret>' \
--form 'importer_name=<string>' \
--form 'invoice_number=<string>' \
--form invoice_file=@/path/to/file.pdfimport requests
url = "https://sandbox.cashfree.com/import/transactions/{cf_payment_id}"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--"
headers = {
"x-client-id": "<x-client-id>",
"x-client-secret": "<x-client-secret>",
"x-api-version": "<x-api-version>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('importer_name', '<string>');
form.append('invoice_number', '<string>');
form.append('invoice_file', '@/path/to/file.pdf');
const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
'x-client-secret': '<x-client-secret>',
'x-api-version': '<x-api-version>'
}
};
options.body = form;
fetch('https://sandbox.cashfree.com/import/transactions/{cf_payment_id}', 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/import/transactions/{cf_payment_id}",
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=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-api-version: <x-api-version>",
"x-client-id: <x-client-id>",
"x-client-secret: <x-client-secret>"
],
]);
$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/import/transactions/{cf_payment_id}"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("x-client-secret", "<x-client-secret>")
req.Header.Add("x-api-version", "<x-api-version>")
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/import/transactions/{cf_payment_id}")
.header("x-client-id", "<x-client-id>")
.header("x-client-secret", "<x-client-secret>")
.header("x-api-version", "<x-api-version>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/import/transactions/{cf_payment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["x-client-secret"] = '<x-client-secret>'
request["x-api-version"] = '<x-api-version>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"uploaded_documents": [
{
"doc_name": "shop_or_brand_name",
"doc_type": "VALUE",
"doc_status": "VERIFIED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "invoice_number",
"doc_type": "VALUE",
"doc_status": "VERIFIED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "importer_name",
"doc_type": "VALUE",
"doc_status": "IN_REVIEW",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "invoice_file",
"doc_type": "DOCUMENT",
"doc_status": "IN_REVIEW",
"remarks": null,
"added_on": null,
"last_updated_on": null
}
],
"missing_documents": [
{
"doc_name": "ecommerce_order_serial_number",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "hs_code",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "shipment_date",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "port_of_loading",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "awb_number",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
}
],
"errors": []
}Upload Payment Verification Details
This API is used to upload all the required payment details for the verification
curl --request POST \
--url https://sandbox.cashfree.com/import/transactions/{cf_payment_id} \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <x-client-id>' \
--header 'x-client-secret: <x-client-secret>' \
--form 'importer_name=<string>' \
--form 'invoice_number=<string>' \
--form invoice_file=@/path/to/file.pdfimport requests
url = "https://sandbox.cashfree.com/import/transactions/{cf_payment_id}"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--"
headers = {
"x-client-id": "<x-client-id>",
"x-client-secret": "<x-client-secret>",
"x-api-version": "<x-api-version>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('importer_name', '<string>');
form.append('invoice_number', '<string>');
form.append('invoice_file', '@/path/to/file.pdf');
const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
'x-client-secret': '<x-client-secret>',
'x-api-version': '<x-api-version>'
}
};
options.body = form;
fetch('https://sandbox.cashfree.com/import/transactions/{cf_payment_id}', 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/import/transactions/{cf_payment_id}",
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=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-api-version: <x-api-version>",
"x-client-id: <x-client-id>",
"x-client-secret: <x-client-secret>"
],
]);
$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/import/transactions/{cf_payment_id}"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("x-client-secret", "<x-client-secret>")
req.Header.Add("x-api-version", "<x-api-version>")
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/import/transactions/{cf_payment_id}")
.header("x-client-id", "<x-client-id>")
.header("x-client-secret", "<x-client-secret>")
.header("x-api-version", "<x-api-version>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/import/transactions/{cf_payment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["x-client-secret"] = '<x-client-secret>'
request["x-api-version"] = '<x-api-version>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"importer_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_number\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"invoice_file\"\r\n\r\n@/path/to/file.pdf\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"uploaded_documents": [
{
"doc_name": "shop_or_brand_name",
"doc_type": "VALUE",
"doc_status": "VERIFIED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "invoice_number",
"doc_type": "VALUE",
"doc_status": "VERIFIED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "importer_name",
"doc_type": "VALUE",
"doc_status": "IN_REVIEW",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "invoice_file",
"doc_type": "DOCUMENT",
"doc_status": "IN_REVIEW",
"remarks": null,
"added_on": null,
"last_updated_on": null
}
],
"missing_documents": [
{
"doc_name": "ecommerce_order_serial_number",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "hs_code",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "shipment_date",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "port_of_loading",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
},
{
"doc_name": "awb_number",
"doc_type": "VALUE",
"doc_status": "ACTION_REQUIRED",
"remarks": null,
"added_on": null,
"last_updated_on": null
}
],
"errors": []
}Headers
client id generated from the merchant dashboard
client secret generated from the merchant dashboard
API version to be used. Format is in YYYY-MM-DD. Ensure to pass 2025-01-01 in header to ensure this version is invoked.
Path Parameters
Successful payment id for the created order.
Body
The request body can include multiple document entries. Each key represents a valid doc_name. The value for each key can be either:
- A string (when
doc_typeisVALUE) - A file (when
doc_typeisDOCUMENT)
Response
This response can represent either a successful upload (when all documents are processed correctly) or a partial success (when some documents are successfully uploaded while others are missing or encountered errors). - Full Success: All documents are uploaded and processed without any issues. - Partial Success: Some documents are uploaded successfully, but others are either missing or encountered errors. - If documents are missing or errors occur, these will be returned in the response in the missing_documents or errors fields.
