Create Embeddable Onboarding Link (does not require login)
curl --request POST \
--url https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link \
--header 'Content-Type: application/json' \
--header 'x-partner-apikey: <x-partner-apikey>' \
--data '
{
"type": "account_onboarding",
"return_url": "https://b8af79f41056.eu.ngrok.io?key1=value1"
}
'import requests
url = "https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link"
payload = {
"type": "account_onboarding",
"return_url": "https://b8af79f41056.eu.ngrok.io?key1=value1"
}
headers = {
"x-partner-apikey": "<x-partner-apikey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-partner-apikey': '<x-partner-apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'account_onboarding',
return_url: 'https://b8af79f41056.eu.ngrok.io?key1=value1'
})
};
fetch('https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link', 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}/onboarding_link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'account_onboarding',
'return_url' => 'https://b8af79f41056.eu.ngrok.io?key1=value1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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}/onboarding_link"
payload := strings.NewReader("{\n \"type\": \"account_onboarding\",\n \"return_url\": \"https://b8af79f41056.eu.ngrok.io?key1=value1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-partner-apikey", "<x-partner-apikey>")
req.Header.Add("Content-Type", "application/json")
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}/onboarding_link")
.header("x-partner-apikey", "<x-partner-apikey>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"account_onboarding\",\n \"return_url\": \"https://b8af79f41056.eu.ngrok.io?key1=value1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link")
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["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"account_onboarding\",\n \"return_url\": \"https://b8af79f41056.eu.ngrok.io?key1=value1\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-07-24T12:24:44+0530",
"expires_at": "2023-07-24T13:24:44+0530",
"onboarding_link": "https://merchant.cashfree.com/merchantwebapp/validate/..token..?goto=onboarding"
}{
"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
Create Embeddable Onboarding Link (does not require login)
Use this API to create a pre-built onboarding link for the sub-merchant account. Embed this link within your platform so that merchants can complete their KYC process. The link remains active for 1 hour only.
POST
/
merchants
/
{merchant_id}
/
onboarding_link
Create Embeddable Onboarding Link (does not require login)
curl --request POST \
--url https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link \
--header 'Content-Type: application/json' \
--header 'x-partner-apikey: <x-partner-apikey>' \
--data '
{
"type": "account_onboarding",
"return_url": "https://b8af79f41056.eu.ngrok.io?key1=value1"
}
'import requests
url = "https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link"
payload = {
"type": "account_onboarding",
"return_url": "https://b8af79f41056.eu.ngrok.io?key1=value1"
}
headers = {
"x-partner-apikey": "<x-partner-apikey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-partner-apikey': '<x-partner-apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'account_onboarding',
return_url: 'https://b8af79f41056.eu.ngrok.io?key1=value1'
})
};
fetch('https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link', 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}/onboarding_link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'account_onboarding',
'return_url' => 'https://b8af79f41056.eu.ngrok.io?key1=value1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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}/onboarding_link"
payload := strings.NewReader("{\n \"type\": \"account_onboarding\",\n \"return_url\": \"https://b8af79f41056.eu.ngrok.io?key1=value1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-partner-apikey", "<x-partner-apikey>")
req.Header.Add("Content-Type", "application/json")
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}/onboarding_link")
.header("x-partner-apikey", "<x-partner-apikey>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"account_onboarding\",\n \"return_url\": \"https://b8af79f41056.eu.ngrok.io?key1=value1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link")
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["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"account_onboarding\",\n \"return_url\": \"https://b8af79f41056.eu.ngrok.io?key1=value1\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-07-24T12:24:44+0530",
"expires_at": "2023-07-24T13:24:44+0530",
"onboarding_link": "https://merchant.cashfree.com/merchantwebapp/validate/..token..?goto=onboarding"
}{
"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"
}Headers
Your partner API key for authentication
API version to be used for the request
Path Parameters
Unique identifier for the merchant
Body
application/json
Was this page helpful?
āI