Mass Create Price Records
curl --request POST \
--url https://api.merchantops.ai/api/pricing/records/mass-create \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"effective_from": "<string>",
"product_key": "<string>",
"variant_keys": [
"<string>"
],
"batch_key": "<string>",
"batch_name": "<string>",
"batch_strategy": "auto",
"price_type": "map"
}
'import requests
url = "https://api.merchantops.ai/api/pricing/records/mass-create"
payload = {
"amount": 123,
"effective_from": "<string>",
"product_key": "<string>",
"variant_keys": ["<string>"],
"batch_key": "<string>",
"batch_name": "<string>",
"batch_strategy": "auto",
"price_type": "map"
}
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({
amount: 123,
effective_from: '<string>',
product_key: '<string>',
variant_keys: ['<string>'],
batch_key: '<string>',
batch_name: '<string>',
batch_strategy: 'auto',
price_type: 'map'
})
};
fetch('https://api.merchantops.ai/api/pricing/records/mass-create', 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/pricing/records/mass-create",
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([
'amount' => 123,
'effective_from' => '<string>',
'product_key' => '<string>',
'variant_keys' => [
'<string>'
],
'batch_key' => '<string>',
'batch_name' => '<string>',
'batch_strategy' => 'auto',
'price_type' => 'map'
]),
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/pricing/records/mass-create"
payload := strings.NewReader("{\n \"amount\": 123,\n \"effective_from\": \"<string>\",\n \"product_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"batch_key\": \"<string>\",\n \"batch_name\": \"<string>\",\n \"batch_strategy\": \"auto\",\n \"price_type\": \"map\"\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/pricing/records/mass-create")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"effective_from\": \"<string>\",\n \"product_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"batch_key\": \"<string>\",\n \"batch_name\": \"<string>\",\n \"batch_strategy\": \"auto\",\n \"price_type\": \"map\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.merchantops.ai/api/pricing/records/mass-create")
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 \"amount\": 123,\n \"effective_from\": \"<string>\",\n \"product_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"batch_key\": \"<string>\",\n \"batch_name\": \"<string>\",\n \"batch_strategy\": \"auto\",\n \"price_type\": \"map\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Pricing
Mass Create Price Records
Mass create price records for multiple variants of a product.
POST
/
api
/
pricing
/
records
/
mass-create
Mass Create Price Records
curl --request POST \
--url https://api.merchantops.ai/api/pricing/records/mass-create \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"effective_from": "<string>",
"product_key": "<string>",
"variant_keys": [
"<string>"
],
"batch_key": "<string>",
"batch_name": "<string>",
"batch_strategy": "auto",
"price_type": "map"
}
'import requests
url = "https://api.merchantops.ai/api/pricing/records/mass-create"
payload = {
"amount": 123,
"effective_from": "<string>",
"product_key": "<string>",
"variant_keys": ["<string>"],
"batch_key": "<string>",
"batch_name": "<string>",
"batch_strategy": "auto",
"price_type": "map"
}
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({
amount: 123,
effective_from: '<string>',
product_key: '<string>',
variant_keys: ['<string>'],
batch_key: '<string>',
batch_name: '<string>',
batch_strategy: 'auto',
price_type: 'map'
})
};
fetch('https://api.merchantops.ai/api/pricing/records/mass-create', 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/pricing/records/mass-create",
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([
'amount' => 123,
'effective_from' => '<string>',
'product_key' => '<string>',
'variant_keys' => [
'<string>'
],
'batch_key' => '<string>',
'batch_name' => '<string>',
'batch_strategy' => 'auto',
'price_type' => 'map'
]),
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/pricing/records/mass-create"
payload := strings.NewReader("{\n \"amount\": 123,\n \"effective_from\": \"<string>\",\n \"product_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"batch_key\": \"<string>\",\n \"batch_name\": \"<string>\",\n \"batch_strategy\": \"auto\",\n \"price_type\": \"map\"\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/pricing/records/mass-create")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"effective_from\": \"<string>\",\n \"product_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"batch_key\": \"<string>\",\n \"batch_name\": \"<string>\",\n \"batch_strategy\": \"auto\",\n \"price_type\": \"map\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.merchantops.ai/api/pricing/records/mass-create")
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 \"amount\": 123,\n \"effective_from\": \"<string>\",\n \"product_key\": \"<string>\",\n \"variant_keys\": [\n \"<string>\"\n ],\n \"batch_key\": \"<string>\",\n \"batch_name\": \"<string>\",\n \"batch_strategy\": \"auto\",\n \"price_type\": \"map\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Cookies
Body
application/json
Request body for mass creating price records across variants.
Batch strategy controls whether the created records are associated with a price batch on creation. Options:
- "auto": find-or-create an open batch keyed on (org, effective_date, brand).
- "existing": attach to the batch identified by batch_key (must be open).
- "new": create a new batch using batch_name (effective_date + brand inferred).
- "none": skip batch association entirely (legacy behavior).
Required when batch_strategy='existing'
Required when batch_strategy='new'
'auto' | 'existing' | 'new' | 'none'
Response
Successful Response