Skip to main content
POST
/
merchants
/
{merchant_id}
/
onboarding_link
/
standard
Create Standard Onboarding Link (with login required by merchant)
curl --request POST \
  --url https://api-sandbox.cashfree.com/partners/merchants/{merchant_id}/onboarding_link/standard \
  --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/standard"

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/standard', 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/standard",
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/standard"

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/standard")
.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/standard")

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",
  "onboarding_link": "https://merchant.cashfree.com/onboarding/login/?token=..token.."
}
{
"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

x-partner-apikey
string
required

Your partner API key for authentication

x-api-version
string
default:2023-01-01

API version to be used for the request

Path Parameters

merchant_id
string
required

Unique identifier for the merchant

Body

application/json
type
string

The type of onboarding link. Value should be "account_onboarding".

return_url
string

The URL to which the user will be redirected after KYC submission

Response

OK

created_at
string

Timestamp when onboarding link was created

URL for onboarding link. Share this with your merchant.