curl --request POST \
--url https://api.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace \
--header 'Content-Type: application/json' \
--data '
{
"find": "<string>",
"property_key": "<string>",
"variant_keys": [
"<string>"
],
"case_sensitive": false,
"expected_will_change": 1,
"replace": ""
}
'import requests
url = "https://api.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace"
payload = {
"find": "<string>",
"property_key": "<string>",
"variant_keys": ["<string>"],
"case_sensitive": False,
"expected_will_change": 1,
"replace": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
find: '<string>',
property_key: '<string>',
variant_keys: ['<string>'],
case_sensitive: false,
expected_will_change: 1,
replace: ''
})
};
fetch('https://api.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace', 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.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace",
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([
'find' => '<string>',
'property_key' => '<string>',
'variant_keys' => [
'<string>'
],
'case_sensitive' => false,
'expected_will_change' => 1,
'replace' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace"
payload := strings.NewReader("{\n \"find\": \"<string>\",\n \"property_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"case_sensitive\": false,\n \"expected_will_change\": 1,\n \"replace\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace")
.header("Content-Type", "application/json")
.body("{\n \"find\": \"<string>\",\n \"property_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"case_sensitive\": false,\n \"expected_will_change\": 1,\n \"replace\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"find\": \"<string>\",\n \"property_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"case_sensitive\": false,\n \"expected_will_change\": 1,\n \"replace\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"matched": 123,
"modified": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Apply Variant Find Replace
Apply a literal find-and-replace inside one text property.
Per-variant values (they differ per variant), constraint-validated
against one sibling fetch, all-or-nothing: a violation returns 400
with {message, failures, error} and nothing is written. Each
changed variant is stamped with the manual-edit override (R0.2) in the
same write, so the next feed import keeps the edit.
Send expected_will_change (the count the user confirmed from the
preview): if the count recomputed now differs, the write is refused
with error: "will_change_mismatch" (plus the recomputed
will_change for callers without a preview to re-run).
Authentication Required: Requires variant:write permission.
curl --request POST \
--url https://api.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace \
--header 'Content-Type: application/json' \
--data '
{
"find": "<string>",
"property_key": "<string>",
"variant_keys": [
"<string>"
],
"case_sensitive": false,
"expected_will_change": 1,
"replace": ""
}
'import requests
url = "https://api.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace"
payload = {
"find": "<string>",
"property_key": "<string>",
"variant_keys": ["<string>"],
"case_sensitive": False,
"expected_will_change": 1,
"replace": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
find: '<string>',
property_key: '<string>',
variant_keys: ['<string>'],
case_sensitive: false,
expected_will_change: 1,
replace: ''
})
};
fetch('https://api.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace', 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.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace",
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([
'find' => '<string>',
'property_key' => '<string>',
'variant_keys' => [
'<string>'
],
'case_sensitive' => false,
'expected_will_change' => 1,
'replace' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace"
payload := strings.NewReader("{\n \"find\": \"<string>\",\n \"property_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"case_sensitive\": false,\n \"expected_will_change\": 1,\n \"replace\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace")
.header("Content-Type", "application/json")
.body("{\n \"find\": \"<string>\",\n \"property_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"case_sensitive\": false,\n \"expected_will_change\": 1,\n \"replace\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.merchantops.ai/api/products/{product_key}/variants/bulk/find-replace")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"find\": \"<string>\",\n \"property_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"case_sensitive\": false,\n \"expected_will_change\": 1,\n \"replace\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"matched": 123,
"modified": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Path Parameters
Cookies
Body
Body for BOTH the preview (dry run) and the apply route.
Literal text to find (never a regex).
1Variant-level property to edit.
11 - 5000 elementsDefault: case-insensitive matching.
Apply only: the will_change count the user confirmed from the preview. When set and it differs from the count recomputed at apply time, the write is refused with error 'will_change_mismatch' and the recomputed count. Ignored by preview.
x >= 0Literal replacement; may be empty (deletes the match).