Variants
Batch create or update variant prices
Creates or updates multiple prices for a product variant across different markets within a store group in a single request.
PUT
/
api
/
v1
/
{team_slug}
/
{app_slug}
/
products
/
{product_id}
/
variants
/
{variant_id}
/
prices-batch
Batch create or update variant prices
curl --request PUT \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prices": [
{
"market_slug": "<string>",
"amount_cents_with_tax": 1,
"on_sale": true,
"reference_price_with_tax": 1,
"sale_end_timestamp": "<string>",
"sale_price_with_tax": 1,
"sale_start_timestamp": "<string>"
}
],
"store_group_slug": "<string>",
"dont_update_price_if_on_sale": true
}
'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch"
payload = {
"prices": [
{
"market_slug": "<string>",
"amount_cents_with_tax": 1,
"on_sale": True,
"reference_price_with_tax": 1,
"sale_end_timestamp": "<string>",
"sale_price_with_tax": 1,
"sale_start_timestamp": "<string>"
}
],
"store_group_slug": "<string>",
"dont_update_price_if_on_sale": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prices: [
{
market_slug: '<string>',
amount_cents_with_tax: 1,
on_sale: true,
reference_price_with_tax: 1,
sale_end_timestamp: '<string>',
sale_price_with_tax: 1,
sale_start_timestamp: '<string>'
}
],
store_group_slug: '<string>',
dont_update_price_if_on_sale: true
})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch', 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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'prices' => [
[
'market_slug' => '<string>',
'amount_cents_with_tax' => 1,
'on_sale' => true,
'reference_price_with_tax' => 1,
'sale_end_timestamp' => '<string>',
'sale_price_with_tax' => 1,
'sale_start_timestamp' => '<string>'
]
],
'store_group_slug' => '<string>',
'dont_update_price_if_on_sale' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch"
payload := strings.NewReader("{\n \"prices\": [\n {\n \"market_slug\": \"<string>\",\n \"amount_cents_with_tax\": 1,\n \"on_sale\": true,\n \"reference_price_with_tax\": 1,\n \"sale_end_timestamp\": \"<string>\",\n \"sale_price_with_tax\": 1,\n \"sale_start_timestamp\": \"<string>\"\n }\n ],\n \"store_group_slug\": \"<string>\",\n \"dont_update_price_if_on_sale\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prices\": [\n {\n \"market_slug\": \"<string>\",\n \"amount_cents_with_tax\": 1,\n \"on_sale\": true,\n \"reference_price_with_tax\": 1,\n \"sale_end_timestamp\": \"<string>\",\n \"sale_price_with_tax\": 1,\n \"sale_start_timestamp\": \"<string>\"\n }\n ],\n \"store_group_slug\": \"<string>\",\n \"dont_update_price_if_on_sale\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prices\": [\n {\n \"market_slug\": \"<string>\",\n \"amount_cents_with_tax\": 1,\n \"on_sale\": true,\n \"reference_price_with_tax\": 1,\n \"sale_end_timestamp\": \"<string>\",\n \"sale_price_with_tax\": 1,\n \"sale_start_timestamp\": \"<string>\"\n }\n ],\n \"store_group_slug\": \"<string>\",\n \"dont_update_price_if_on_sale\": true\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"amount_cents_with_tax": 123,
"created_at": "<string>",
"id": "<string>",
"market": {
"active": true,
"country_codes": [
"<string>"
],
"created_at": "<string>",
"currency_code": "<string>",
"id": "<string>",
"locale": "<string>",
"name": "<string>",
"slug": "<string>",
"updated_at": "<string>"
},
"on_sale": true,
"reference_price_with_tax": 123,
"sale_end_timestamp": "<string>",
"sale_price_with_tax": 123,
"sale_start_timestamp": "<string>",
"status": "active",
"store_group": {
"country_of_sale": "<string>",
"created_at": "<string>",
"description": "<string>",
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"store_type": "<string>",
"updated_at": "<string>"
},
"updated_at": "<string>"
}
],
"success": true,
"details": [
"<string>"
]
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}Authorizations
Management API token, sent as Authorization: Bearer <token>.
Path Parameters
Variant ID
App slug
Team slug
Body
application/json
Batch price data with store group and array of market prices
Response
List of created or updated prices with store group and market details
⌘I
Batch create or update variant prices
curl --request PUT \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prices": [
{
"market_slug": "<string>",
"amount_cents_with_tax": 1,
"on_sale": true,
"reference_price_with_tax": 1,
"sale_end_timestamp": "<string>",
"sale_price_with_tax": 1,
"sale_start_timestamp": "<string>"
}
],
"store_group_slug": "<string>",
"dont_update_price_if_on_sale": true
}
'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch"
payload = {
"prices": [
{
"market_slug": "<string>",
"amount_cents_with_tax": 1,
"on_sale": True,
"reference_price_with_tax": 1,
"sale_end_timestamp": "<string>",
"sale_price_with_tax": 1,
"sale_start_timestamp": "<string>"
}
],
"store_group_slug": "<string>",
"dont_update_price_if_on_sale": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prices: [
{
market_slug: '<string>',
amount_cents_with_tax: 1,
on_sale: true,
reference_price_with_tax: 1,
sale_end_timestamp: '<string>',
sale_price_with_tax: 1,
sale_start_timestamp: '<string>'
}
],
store_group_slug: '<string>',
dont_update_price_if_on_sale: true
})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch', 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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'prices' => [
[
'market_slug' => '<string>',
'amount_cents_with_tax' => 1,
'on_sale' => true,
'reference_price_with_tax' => 1,
'sale_end_timestamp' => '<string>',
'sale_price_with_tax' => 1,
'sale_start_timestamp' => '<string>'
]
],
'store_group_slug' => '<string>',
'dont_update_price_if_on_sale' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch"
payload := strings.NewReader("{\n \"prices\": [\n {\n \"market_slug\": \"<string>\",\n \"amount_cents_with_tax\": 1,\n \"on_sale\": true,\n \"reference_price_with_tax\": 1,\n \"sale_end_timestamp\": \"<string>\",\n \"sale_price_with_tax\": 1,\n \"sale_start_timestamp\": \"<string>\"\n }\n ],\n \"store_group_slug\": \"<string>\",\n \"dont_update_price_if_on_sale\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prices\": [\n {\n \"market_slug\": \"<string>\",\n \"amount_cents_with_tax\": 1,\n \"on_sale\": true,\n \"reference_price_with_tax\": 1,\n \"sale_end_timestamp\": \"<string>\",\n \"sale_price_with_tax\": 1,\n \"sale_start_timestamp\": \"<string>\"\n }\n ],\n \"store_group_slug\": \"<string>\",\n \"dont_update_price_if_on_sale\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/variants/{variant_id}/prices-batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prices\": [\n {\n \"market_slug\": \"<string>\",\n \"amount_cents_with_tax\": 1,\n \"on_sale\": true,\n \"reference_price_with_tax\": 1,\n \"sale_end_timestamp\": \"<string>\",\n \"sale_price_with_tax\": 1,\n \"sale_start_timestamp\": \"<string>\"\n }\n ],\n \"store_group_slug\": \"<string>\",\n \"dont_update_price_if_on_sale\": true\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"amount_cents_with_tax": 123,
"created_at": "<string>",
"id": "<string>",
"market": {
"active": true,
"country_codes": [
"<string>"
],
"created_at": "<string>",
"currency_code": "<string>",
"id": "<string>",
"locale": "<string>",
"name": "<string>",
"slug": "<string>",
"updated_at": "<string>"
},
"on_sale": true,
"reference_price_with_tax": 123,
"sale_end_timestamp": "<string>",
"sale_price_with_tax": 123,
"sale_start_timestamp": "<string>",
"status": "active",
"store_group": {
"country_of_sale": "<string>",
"created_at": "<string>",
"description": "<string>",
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"store_type": "<string>",
"updated_at": "<string>"
},
"updated_at": "<string>"
}
],
"success": true,
"details": [
"<string>"
]
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}