Price Relay Rules
Update a price relay source rule
PUT
/
api
/
v1
/
{team_slug}
/
{app_slug}
/
price-relay-source-rules
/
{rule_id}
Update a price relay source rule
curl --request PUT \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/price-relay-source-rules/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"market_slug": "<string>",
"name": "<string>",
"relay_status_store_group_slug": "<string>",
"store_groups": [
{
"store_group_slug": "<string>",
"amount_from": "<string>",
"sale_price_from": "<string>"
}
],
"active": true,
"filters": {
"brand_ids": [
"<string>"
],
"category_ids": [
"<string>"
],
"collection_ids": [
"<string>"
],
"tag_ids": [
"<string>"
]
},
"force_on_sale": true,
"percentage_of_source": 123,
"percentage_of_source_decimals": 123,
"relay_on_sale_store_group_slug": "<string>",
"rounding": {
"round_down": true,
"round_up": true,
"targets": [
"<string>"
]
},
"tax_country_code": "<string>"
}
'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/price-relay-source-rules/{rule_id}"
payload = {
"market_slug": "<string>",
"name": "<string>",
"relay_status_store_group_slug": "<string>",
"store_groups": [
{
"store_group_slug": "<string>",
"amount_from": "<string>",
"sale_price_from": "<string>"
}
],
"active": True,
"filters": {
"brand_ids": ["<string>"],
"category_ids": ["<string>"],
"collection_ids": ["<string>"],
"tag_ids": ["<string>"]
},
"force_on_sale": True,
"percentage_of_source": 123,
"percentage_of_source_decimals": 123,
"relay_on_sale_store_group_slug": "<string>",
"rounding": {
"round_down": True,
"round_up": True,
"targets": ["<string>"]
},
"tax_country_code": "<string>"
}
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({
market_slug: '<string>',
name: '<string>',
relay_status_store_group_slug: '<string>',
store_groups: [
{
store_group_slug: '<string>',
amount_from: '<string>',
sale_price_from: '<string>'
}
],
active: true,
filters: {
brand_ids: ['<string>'],
category_ids: ['<string>'],
collection_ids: ['<string>'],
tag_ids: ['<string>']
},
force_on_sale: true,
percentage_of_source: 123,
percentage_of_source_decimals: 123,
relay_on_sale_store_group_slug: '<string>',
rounding: {round_down: true, round_up: true, targets: ['<string>']},
tax_country_code: '<string>'
})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/price-relay-source-rules/{rule_id}', 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}/price-relay-source-rules/{rule_id}",
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([
'market_slug' => '<string>',
'name' => '<string>',
'relay_status_store_group_slug' => '<string>',
'store_groups' => [
[
'store_group_slug' => '<string>',
'amount_from' => '<string>',
'sale_price_from' => '<string>'
]
],
'active' => true,
'filters' => [
'brand_ids' => [
'<string>'
],
'category_ids' => [
'<string>'
],
'collection_ids' => [
'<string>'
],
'tag_ids' => [
'<string>'
]
],
'force_on_sale' => true,
'percentage_of_source' => 123,
'percentage_of_source_decimals' => 123,
'relay_on_sale_store_group_slug' => '<string>',
'rounding' => [
'round_down' => true,
'round_up' => true,
'targets' => [
'<string>'
]
],
'tax_country_code' => '<string>'
]),
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}/price-relay-source-rules/{rule_id}"
payload := strings.NewReader("{\n \"market_slug\": \"<string>\",\n \"name\": \"<string>\",\n \"relay_status_store_group_slug\": \"<string>\",\n \"store_groups\": [\n {\n \"store_group_slug\": \"<string>\",\n \"amount_from\": \"<string>\",\n \"sale_price_from\": \"<string>\"\n }\n ],\n \"active\": true,\n \"filters\": {\n \"brand_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"collection_ids\": [\n \"<string>\"\n ],\n \"tag_ids\": [\n \"<string>\"\n ]\n },\n \"force_on_sale\": true,\n \"percentage_of_source\": 123,\n \"percentage_of_source_decimals\": 123,\n \"relay_on_sale_store_group_slug\": \"<string>\",\n \"rounding\": {\n \"round_down\": true,\n \"round_up\": true,\n \"targets\": [\n \"<string>\"\n ]\n },\n \"tax_country_code\": \"<string>\"\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}/price-relay-source-rules/{rule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"market_slug\": \"<string>\",\n \"name\": \"<string>\",\n \"relay_status_store_group_slug\": \"<string>\",\n \"store_groups\": [\n {\n \"store_group_slug\": \"<string>\",\n \"amount_from\": \"<string>\",\n \"sale_price_from\": \"<string>\"\n }\n ],\n \"active\": true,\n \"filters\": {\n \"brand_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"collection_ids\": [\n \"<string>\"\n ],\n \"tag_ids\": [\n \"<string>\"\n ]\n },\n \"force_on_sale\": true,\n \"percentage_of_source\": 123,\n \"percentage_of_source_decimals\": 123,\n \"relay_on_sale_store_group_slug\": \"<string>\",\n \"rounding\": {\n \"round_down\": true,\n \"round_up\": true,\n \"targets\": [\n \"<string>\"\n ]\n },\n \"tax_country_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/price-relay-source-rules/{rule_id}")
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 \"market_slug\": \"<string>\",\n \"name\": \"<string>\",\n \"relay_status_store_group_slug\": \"<string>\",\n \"store_groups\": [\n {\n \"store_group_slug\": \"<string>\",\n \"amount_from\": \"<string>\",\n \"sale_price_from\": \"<string>\"\n }\n ],\n \"active\": true,\n \"filters\": {\n \"brand_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"collection_ids\": [\n \"<string>\"\n ],\n \"tag_ids\": [\n \"<string>\"\n ]\n },\n \"force_on_sale\": true,\n \"percentage_of_source\": 123,\n \"percentage_of_source_decimals\": 123,\n \"relay_on_sale_store_group_slug\": \"<string>\",\n \"rounding\": {\n \"round_down\": true,\n \"round_up\": true,\n \"targets\": [\n \"<string>\"\n ]\n },\n \"tax_country_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"active": true,
"app_id": "<string>",
"created_at": "<string>",
"filters": {
"brand_ids": [
"<string>"
],
"category_ids": [
"<string>"
],
"collection_ids": [
"<string>"
],
"tag_ids": [
"<string>"
]
},
"force_on_sale": true,
"id": "<string>",
"market": "<string>",
"market_slug": "<string>",
"name": "<string>",
"percentage_of_source": 123,
"percentage_of_source_decimals": 123,
"relay_on_sale_store_group": "<string>",
"relay_status_store_group": "<string>",
"rounding": {
"round_down": true,
"round_up": true,
"targets": [
"<string>"
]
},
"store_groups": [
{
"amount_from": "<string>",
"sale_price_from": "<string>",
"store_group": "<string>",
"store_group_slug": "<string>"
}
],
"tax_country_code": "<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
App slug
Team slug
Source rule ID
Body
application/json
source rule details
The target inherits its status from this store group's price; falls back to the target's own status, or the source status when the target has no price yet. Must be one of store_groups.
The store groups whose prices are summed into the relayed price.
Minimum array length:
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Overrides the target's on-sale flag with this value; when omitted the flag is left to relay_on_sale_store_group and the target's own state.
When set, the target inherits its on-sale flag and sale window from this store group's price; omit to leave the target's own. Must be one of store_groups.
Show child attributes
Show child attributes
⌘I
Update a price relay source rule
curl --request PUT \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/price-relay-source-rules/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"market_slug": "<string>",
"name": "<string>",
"relay_status_store_group_slug": "<string>",
"store_groups": [
{
"store_group_slug": "<string>",
"amount_from": "<string>",
"sale_price_from": "<string>"
}
],
"active": true,
"filters": {
"brand_ids": [
"<string>"
],
"category_ids": [
"<string>"
],
"collection_ids": [
"<string>"
],
"tag_ids": [
"<string>"
]
},
"force_on_sale": true,
"percentage_of_source": 123,
"percentage_of_source_decimals": 123,
"relay_on_sale_store_group_slug": "<string>",
"rounding": {
"round_down": true,
"round_up": true,
"targets": [
"<string>"
]
},
"tax_country_code": "<string>"
}
'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/price-relay-source-rules/{rule_id}"
payload = {
"market_slug": "<string>",
"name": "<string>",
"relay_status_store_group_slug": "<string>",
"store_groups": [
{
"store_group_slug": "<string>",
"amount_from": "<string>",
"sale_price_from": "<string>"
}
],
"active": True,
"filters": {
"brand_ids": ["<string>"],
"category_ids": ["<string>"],
"collection_ids": ["<string>"],
"tag_ids": ["<string>"]
},
"force_on_sale": True,
"percentage_of_source": 123,
"percentage_of_source_decimals": 123,
"relay_on_sale_store_group_slug": "<string>",
"rounding": {
"round_down": True,
"round_up": True,
"targets": ["<string>"]
},
"tax_country_code": "<string>"
}
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({
market_slug: '<string>',
name: '<string>',
relay_status_store_group_slug: '<string>',
store_groups: [
{
store_group_slug: '<string>',
amount_from: '<string>',
sale_price_from: '<string>'
}
],
active: true,
filters: {
brand_ids: ['<string>'],
category_ids: ['<string>'],
collection_ids: ['<string>'],
tag_ids: ['<string>']
},
force_on_sale: true,
percentage_of_source: 123,
percentage_of_source_decimals: 123,
relay_on_sale_store_group_slug: '<string>',
rounding: {round_down: true, round_up: true, targets: ['<string>']},
tax_country_code: '<string>'
})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/price-relay-source-rules/{rule_id}', 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}/price-relay-source-rules/{rule_id}",
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([
'market_slug' => '<string>',
'name' => '<string>',
'relay_status_store_group_slug' => '<string>',
'store_groups' => [
[
'store_group_slug' => '<string>',
'amount_from' => '<string>',
'sale_price_from' => '<string>'
]
],
'active' => true,
'filters' => [
'brand_ids' => [
'<string>'
],
'category_ids' => [
'<string>'
],
'collection_ids' => [
'<string>'
],
'tag_ids' => [
'<string>'
]
],
'force_on_sale' => true,
'percentage_of_source' => 123,
'percentage_of_source_decimals' => 123,
'relay_on_sale_store_group_slug' => '<string>',
'rounding' => [
'round_down' => true,
'round_up' => true,
'targets' => [
'<string>'
]
],
'tax_country_code' => '<string>'
]),
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}/price-relay-source-rules/{rule_id}"
payload := strings.NewReader("{\n \"market_slug\": \"<string>\",\n \"name\": \"<string>\",\n \"relay_status_store_group_slug\": \"<string>\",\n \"store_groups\": [\n {\n \"store_group_slug\": \"<string>\",\n \"amount_from\": \"<string>\",\n \"sale_price_from\": \"<string>\"\n }\n ],\n \"active\": true,\n \"filters\": {\n \"brand_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"collection_ids\": [\n \"<string>\"\n ],\n \"tag_ids\": [\n \"<string>\"\n ]\n },\n \"force_on_sale\": true,\n \"percentage_of_source\": 123,\n \"percentage_of_source_decimals\": 123,\n \"relay_on_sale_store_group_slug\": \"<string>\",\n \"rounding\": {\n \"round_down\": true,\n \"round_up\": true,\n \"targets\": [\n \"<string>\"\n ]\n },\n \"tax_country_code\": \"<string>\"\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}/price-relay-source-rules/{rule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"market_slug\": \"<string>\",\n \"name\": \"<string>\",\n \"relay_status_store_group_slug\": \"<string>\",\n \"store_groups\": [\n {\n \"store_group_slug\": \"<string>\",\n \"amount_from\": \"<string>\",\n \"sale_price_from\": \"<string>\"\n }\n ],\n \"active\": true,\n \"filters\": {\n \"brand_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"collection_ids\": [\n \"<string>\"\n ],\n \"tag_ids\": [\n \"<string>\"\n ]\n },\n \"force_on_sale\": true,\n \"percentage_of_source\": 123,\n \"percentage_of_source_decimals\": 123,\n \"relay_on_sale_store_group_slug\": \"<string>\",\n \"rounding\": {\n \"round_down\": true,\n \"round_up\": true,\n \"targets\": [\n \"<string>\"\n ]\n },\n \"tax_country_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/price-relay-source-rules/{rule_id}")
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 \"market_slug\": \"<string>\",\n \"name\": \"<string>\",\n \"relay_status_store_group_slug\": \"<string>\",\n \"store_groups\": [\n {\n \"store_group_slug\": \"<string>\",\n \"amount_from\": \"<string>\",\n \"sale_price_from\": \"<string>\"\n }\n ],\n \"active\": true,\n \"filters\": {\n \"brand_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"collection_ids\": [\n \"<string>\"\n ],\n \"tag_ids\": [\n \"<string>\"\n ]\n },\n \"force_on_sale\": true,\n \"percentage_of_source\": 123,\n \"percentage_of_source_decimals\": 123,\n \"relay_on_sale_store_group_slug\": \"<string>\",\n \"rounding\": {\n \"round_down\": true,\n \"round_up\": true,\n \"targets\": [\n \"<string>\"\n ]\n },\n \"tax_country_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"active": true,
"app_id": "<string>",
"created_at": "<string>",
"filters": {
"brand_ids": [
"<string>"
],
"category_ids": [
"<string>"
],
"collection_ids": [
"<string>"
],
"tag_ids": [
"<string>"
]
},
"force_on_sale": true,
"id": "<string>",
"market": "<string>",
"market_slug": "<string>",
"name": "<string>",
"percentage_of_source": 123,
"percentage_of_source_decimals": 123,
"relay_on_sale_store_group": "<string>",
"relay_status_store_group": "<string>",
"rounding": {
"round_down": true,
"round_up": true,
"targets": [
"<string>"
]
},
"store_groups": [
{
"amount_from": "<string>",
"sale_price_from": "<string>",
"store_group": "<string>",
"store_group_slug": "<string>"
}
],
"tax_country_code": "<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>"
}