Blocklist - Clone Entries
curl --request POST \
--url https://sandbox.hyperswitch.io/blocklist/clone \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"target_profile_ids": [
"<string>"
]
}
'import requests
url = "https://sandbox.hyperswitch.io/blocklist/clone"
payload = { "target_profile_ids": ["<string>"] }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_profile_ids: ['<string>']})
};
fetch('https://sandbox.hyperswitch.io/blocklist/clone', 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.hyperswitch.io/blocklist/clone",
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([
'target_profile_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <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.hyperswitch.io/blocklist/clone"
payload := strings.NewReader("{\n \"target_profile_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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://sandbox.hyperswitch.io/blocklist/clone")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target_profile_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/blocklist/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_profile_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"source_profile_id": "pro_abcdefghijklmnop",
"job_id": "<string>",
"status": "initiated",
"target_profile_ids": [
"<string>"
]
}Blocklist
Blocklist - Clone Entries
Copies a business profile’s blocklist entries onto other profiles of the same merchant. The
copy runs as one background job whose process tracker clones onto the targets one at a time.
Poll /blocklist/batch/{job_id} for per-target progress in the job metadata.
POST
/
blocklist
/
clone
Blocklist - Clone Entries
curl --request POST \
--url https://sandbox.hyperswitch.io/blocklist/clone \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"target_profile_ids": [
"<string>"
]
}
'import requests
url = "https://sandbox.hyperswitch.io/blocklist/clone"
payload = { "target_profile_ids": ["<string>"] }
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_profile_ids: ['<string>']})
};
fetch('https://sandbox.hyperswitch.io/blocklist/clone', 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.hyperswitch.io/blocklist/clone",
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([
'target_profile_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <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.hyperswitch.io/blocklist/clone"
payload := strings.NewReader("{\n \"target_profile_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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://sandbox.hyperswitch.io/blocklist/clone")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target_profile_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/blocklist/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_profile_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"source_profile_id": "pro_abcdefghijklmnop",
"job_id": "<string>",
"status": "initiated",
"target_profile_ids": [
"<string>"
]
}Authorizations
api_keyjwt_key
Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.
Headers
Source profile whose entries are copied; it also owns the clone job. Required when the authenticated dashboard session does not provide a profile context
Body
application/json
Response
One background job was started; it clones onto the target profiles one at a time
Was this page helpful?