Pricing Hub
PUT
Configure External Price Source
{{baseUrl}}/config
HEADERS
Accept
Content-Type
X-VTEX-API-AppKey
X-VTEX-API-AppToken
BODY json
{
"active": false,
"appName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/config");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: ");
headers = curl_slist_append(headers, "content-type: application/json");
headers = curl_slist_append(headers, "x-vtex-api-appkey: ");
headers = curl_slist_append(headers, "x-vtex-api-apptoken: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/config" {:headers {:accept ""
:x-vtex-api-appkey ""
:x-vtex-api-apptoken ""}
:content-type :json
:form-params {:active true
:appName "apiexamples_app_name"}})
require "http/client"
url = "{{baseUrl}}/config"
headers = HTTP::Headers{
"accept" => ""
"content-type" => "application/json"
"x-vtex-api-appkey" => ""
"x-vtex-api-apptoken" => ""
}
reqBody = "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/config"),
Headers =
{
{ "accept", "" },
{ "x-vtex-api-appkey", "" },
{ "x-vtex-api-apptoken", "" },
},
Content = new StringContent("{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/config");
var request = new RestRequest("", Method.Put);
request.AddHeader("accept", "");
request.AddHeader("content-type", "application/json");
request.AddHeader("x-vtex-api-appkey", "");
request.AddHeader("x-vtex-api-apptoken", "");
request.AddParameter("application/json", "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/config"
payload := strings.NewReader("{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("accept", "")
req.Header.Add("content-type", "application/json")
req.Header.Add("x-vtex-api-appkey", "")
req.Header.Add("x-vtex-api-apptoken", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/config HTTP/1.1
Accept:
Content-Type: application/json
X-Vtex-Api-Appkey:
X-Vtex-Api-Apptoken:
Host: example.com
Content-Length: 57
{
"active": true,
"appName": "apiexamples_app_name"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/config")
.setHeader("accept", "")
.setHeader("content-type", "application/json")
.setHeader("x-vtex-api-appkey", "")
.setHeader("x-vtex-api-apptoken", "")
.setBody("{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/config"))
.header("accept", "")
.header("content-type", "application/json")
.header("x-vtex-api-appkey", "")
.header("x-vtex-api-apptoken", "")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/config")
.put(body)
.addHeader("accept", "")
.addHeader("content-type", "application/json")
.addHeader("x-vtex-api-appkey", "")
.addHeader("x-vtex-api-apptoken", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/config")
.header("accept", "")
.header("content-type", "application/json")
.header("x-vtex-api-appkey", "")
.header("x-vtex-api-apptoken", "")
.body("{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}")
.asString();
const data = JSON.stringify({
active: true,
appName: 'apiexamples_app_name'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/config');
xhr.setRequestHeader('accept', '');
xhr.setRequestHeader('content-type', 'application/json');
xhr.setRequestHeader('x-vtex-api-appkey', '');
xhr.setRequestHeader('x-vtex-api-apptoken', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/config',
headers: {
accept: '',
'content-type': 'application/json',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
data: {active: true, appName: 'apiexamples_app_name'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/config';
const options = {
method: 'PUT',
headers: {
accept: '',
'content-type': 'application/json',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
body: '{"active":true,"appName":"apiexamples_app_name"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/config',
method: 'PUT',
headers: {
accept: '',
'content-type': 'application/json',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
processData: false,
data: '{\n "active": true,\n "appName": "apiexamples_app_name"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/config")
.put(body)
.addHeader("accept", "")
.addHeader("content-type", "application/json")
.addHeader("x-vtex-api-appkey", "")
.addHeader("x-vtex-api-apptoken", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/config',
headers: {
accept: '',
'content-type': 'application/json',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({active: true, appName: 'apiexamples_app_name'}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/config',
headers: {
accept: '',
'content-type': 'application/json',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
body: {active: true, appName: 'apiexamples_app_name'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/config');
req.headers({
accept: '',
'content-type': 'application/json',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
});
req.type('json');
req.send({
active: true,
appName: 'apiexamples_app_name'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/config',
headers: {
accept: '',
'content-type': 'application/json',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
data: {active: true, appName: 'apiexamples_app_name'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/config';
const options = {
method: 'PUT',
headers: {
accept: '',
'content-type': 'application/json',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
body: '{"active":true,"appName":"apiexamples_app_name"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"accept": @"",
@"content-type": @"application/json",
@"x-vtex-api-appkey": @"",
@"x-vtex-api-apptoken": @"" };
NSDictionary *parameters = @{ @"active": @YES,
@"appName": @"apiexamples_app_name" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/config"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/config" in
let headers = Header.add_list (Header.init ()) [
("accept", "");
("content-type", "application/json");
("x-vtex-api-appkey", "");
("x-vtex-api-apptoken", "");
] in
let body = Cohttp_lwt_body.of_string "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/config",
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([
'active' => null,
'appName' => 'apiexamples_app_name'
]),
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: application/json",
"x-vtex-api-appkey: ",
"x-vtex-api-apptoken: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/config', [
'body' => '{
"active": true,
"appName": "apiexamples_app_name"
}',
'headers' => [
'accept' => '',
'content-type' => 'application/json',
'x-vtex-api-appkey' => '',
'x-vtex-api-apptoken' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/config');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'accept' => '',
'content-type' => 'application/json',
'x-vtex-api-appkey' => '',
'x-vtex-api-apptoken' => ''
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'active' => null,
'appName' => 'apiexamples_app_name'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'active' => null,
'appName' => 'apiexamples_app_name'
]));
$request->setRequestUrl('{{baseUrl}}/config');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'accept' => '',
'content-type' => 'application/json',
'x-vtex-api-appkey' => '',
'x-vtex-api-apptoken' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("accept", "")
$headers.Add("content-type", "application/json")
$headers.Add("x-vtex-api-appkey", "")
$headers.Add("x-vtex-api-apptoken", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/config' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"active": true,
"appName": "apiexamples_app_name"
}'
$headers=@{}
$headers.Add("accept", "")
$headers.Add("content-type", "application/json")
$headers.Add("x-vtex-api-appkey", "")
$headers.Add("x-vtex-api-apptoken", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/config' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"active": true,
"appName": "apiexamples_app_name"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}"
headers = {
'accept': "",
'content-type': "application/json",
'x-vtex-api-appkey': "",
'x-vtex-api-apptoken': ""
}
conn.request("PUT", "/baseUrl/config", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/config"
payload = {
"active": True,
"appName": "apiexamples_app_name"
}
headers = {
"accept": "",
"content-type": "application/json",
"x-vtex-api-appkey": "",
"x-vtex-api-apptoken": ""
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/config"
payload <- "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-vtex-api-appkey' = '', 'x-vtex-api-apptoken' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["accept"] = ''
request["content-type"] = 'application/json'
request["x-vtex-api-appkey"] = ''
request["x-vtex-api-apptoken"] = ''
request.body = "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/config') do |req|
req.headers['accept'] = ''
req.headers['x-vtex-api-appkey'] = ''
req.headers['x-vtex-api-apptoken'] = ''
req.body = "{\n \"active\": true,\n \"appName\": \"apiexamples_app_name\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/config";
let payload = json!({
"active": true,
"appName": "apiexamples_app_name"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("accept", "".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
headers.insert("x-vtex-api-appkey", "".parse().unwrap());
headers.insert("x-vtex-api-apptoken", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/config \
--header 'accept: ' \
--header 'content-type: application/json' \
--header 'x-vtex-api-appkey: ' \
--header 'x-vtex-api-apptoken: ' \
--data '{
"active": true,
"appName": "apiexamples_app_name"
}'
echo '{
"active": true,
"appName": "apiexamples_app_name"
}' | \
http PUT {{baseUrl}}/config \
accept:'' \
content-type:application/json \
x-vtex-api-appkey:'' \
x-vtex-api-apptoken:''
wget --quiet \
--method PUT \
--header 'accept: ' \
--header 'content-type: application/json' \
--header 'x-vtex-api-appkey: ' \
--header 'x-vtex-api-apptoken: ' \
--body-data '{\n "active": true,\n "appName": "apiexamples_app_name"\n}' \
--output-document \
- {{baseUrl}}/config
import Foundation
let headers = [
"accept": "",
"content-type": "application/json",
"x-vtex-api-appkey": "",
"x-vtex-api-apptoken": ""
]
let parameters = [
"active": true,
"appName": "apiexamples_app_name"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/config")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Get Prices
{{baseUrl}}/api/pricing-hub/prices
HEADERS
Accept
Content-Type
X-VTEX-API-AppKey
X-VTEX-API-AppToken
QUERY PARAMS
accountName
BODY json
{
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
{
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
}
],
"salesChannel": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/api/pricing-hub/prices?accountName=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: ");
headers = curl_slist_append(headers, "content-type: ");
headers = curl_slist_append(headers, "x-vtex-api-appkey: ");
headers = curl_slist_append(headers, "x-vtex-api-apptoken: ");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/api/pricing-hub/prices" {:headers {:accept ""
:x-vtex-api-appkey ""
:x-vtex-api-apptoken ""}
:query-params {:accountName ""}
:content-type :json
:form-params {:UtmCampaign ""
:UtmInternalCampaign ""
:UtmMedium ""
:UtmSource ""
:email ""
:items [{:brandId ""
:categoriesIds []
:index 0
:priceTableIds []
:quantity 0
:sellerId ""
:skuId ""}]
:salesChannel ""}})
require "http/client"
url = "{{baseUrl}}/api/pricing-hub/prices?accountName="
headers = HTTP::Headers{
"accept" => ""
"content-type" => ""
"x-vtex-api-appkey" => ""
"x-vtex-api-apptoken" => ""
}
reqBody = "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/api/pricing-hub/prices?accountName="),
Headers =
{
{ "accept", "" },
{ "x-vtex-api-appkey", "" },
{ "x-vtex-api-apptoken", "" },
},
Content = new StringContent("{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/api/pricing-hub/prices?accountName=");
var request = new RestRequest("", Method.Post);
request.AddHeader("accept", "");
request.AddHeader("content-type", "");
request.AddHeader("x-vtex-api-appkey", "");
request.AddHeader("x-vtex-api-apptoken", "");
request.AddParameter("", "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/api/pricing-hub/prices?accountName="
payload := strings.NewReader("{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("accept", "")
req.Header.Add("content-type", "")
req.Header.Add("x-vtex-api-appkey", "")
req.Header.Add("x-vtex-api-apptoken", "")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/api/pricing-hub/prices?accountName= HTTP/1.1
Accept:
Content-Type:
X-Vtex-Api-Appkey:
X-Vtex-Api-Apptoken:
Host: example.com
Content-Length: 311
{
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
{
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
}
],
"salesChannel": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/api/pricing-hub/prices?accountName=")
.setHeader("accept", "")
.setHeader("content-type", "")
.setHeader("x-vtex-api-appkey", "")
.setHeader("x-vtex-api-apptoken", "")
.setBody("{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/api/pricing-hub/prices?accountName="))
.header("accept", "")
.header("content-type", "")
.header("x-vtex-api-appkey", "")
.header("x-vtex-api-apptoken", "")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/pricing-hub/prices?accountName=")
.post(body)
.addHeader("accept", "")
.addHeader("content-type", "")
.addHeader("x-vtex-api-appkey", "")
.addHeader("x-vtex-api-apptoken", "")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/api/pricing-hub/prices?accountName=")
.header("accept", "")
.header("content-type", "")
.header("x-vtex-api-appkey", "")
.header("x-vtex-api-apptoken", "")
.body("{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}")
.asString();
const data = JSON.stringify({
UtmCampaign: '',
UtmInternalCampaign: '',
UtmMedium: '',
UtmSource: '',
email: '',
items: [
{
brandId: '',
categoriesIds: [],
index: 0,
priceTableIds: [],
quantity: 0,
sellerId: '',
skuId: ''
}
],
salesChannel: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/api/pricing-hub/prices?accountName=');
xhr.setRequestHeader('accept', '');
xhr.setRequestHeader('content-type', '');
xhr.setRequestHeader('x-vtex-api-appkey', '');
xhr.setRequestHeader('x-vtex-api-apptoken', '');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/api/pricing-hub/prices',
params: {accountName: ''},
headers: {
accept: '',
'content-type': '',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
data: {
UtmCampaign: '',
UtmInternalCampaign: '',
UtmMedium: '',
UtmSource: '',
email: '',
items: [
{
brandId: '',
categoriesIds: [],
index: 0,
priceTableIds: [],
quantity: 0,
sellerId: '',
skuId: ''
}
],
salesChannel: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/api/pricing-hub/prices?accountName=';
const options = {
method: 'POST',
headers: {
accept: '',
'content-type': '',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
body: '{"UtmCampaign":"","UtmInternalCampaign":"","UtmMedium":"","UtmSource":"","email":"","items":[{"brandId":"","categoriesIds":[],"index":0,"priceTableIds":[],"quantity":0,"sellerId":"","skuId":""}],"salesChannel":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/api/pricing-hub/prices?accountName=',
method: 'POST',
headers: {
accept: '',
'content-type': '',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
processData: false,
data: '{\n "UtmCampaign": "",\n "UtmInternalCampaign": "",\n "UtmMedium": "",\n "UtmSource": "",\n "email": "",\n "items": [\n {\n "brandId": "",\n "categoriesIds": [],\n "index": 0,\n "priceTableIds": [],\n "quantity": 0,\n "sellerId": "",\n "skuId": ""\n }\n ],\n "salesChannel": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/api/pricing-hub/prices?accountName=")
.post(body)
.addHeader("accept", "")
.addHeader("content-type", "")
.addHeader("x-vtex-api-appkey", "")
.addHeader("x-vtex-api-apptoken", "")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/api/pricing-hub/prices?accountName=',
headers: {
accept: '',
'content-type': '',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
UtmCampaign: '',
UtmInternalCampaign: '',
UtmMedium: '',
UtmSource: '',
email: '',
items: [
{
brandId: '',
categoriesIds: [],
index: 0,
priceTableIds: [],
quantity: 0,
sellerId: '',
skuId: ''
}
],
salesChannel: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/api/pricing-hub/prices',
qs: {accountName: ''},
headers: {
accept: '',
'content-type': '',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
body: {
UtmCampaign: '',
UtmInternalCampaign: '',
UtmMedium: '',
UtmSource: '',
email: '',
items: [
{
brandId: '',
categoriesIds: [],
index: 0,
priceTableIds: [],
quantity: 0,
sellerId: '',
skuId: ''
}
],
salesChannel: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/api/pricing-hub/prices');
req.query({
accountName: ''
});
req.headers({
accept: '',
'content-type': '',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
});
req.type('json');
req.send({
UtmCampaign: '',
UtmInternalCampaign: '',
UtmMedium: '',
UtmSource: '',
email: '',
items: [
{
brandId: '',
categoriesIds: [],
index: 0,
priceTableIds: [],
quantity: 0,
sellerId: '',
skuId: ''
}
],
salesChannel: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/api/pricing-hub/prices',
params: {accountName: ''},
headers: {
accept: '',
'content-type': '',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
data: {
UtmCampaign: '',
UtmInternalCampaign: '',
UtmMedium: '',
UtmSource: '',
email: '',
items: [
{
brandId: '',
categoriesIds: [],
index: 0,
priceTableIds: [],
quantity: 0,
sellerId: '',
skuId: ''
}
],
salesChannel: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/api/pricing-hub/prices?accountName=';
const options = {
method: 'POST',
headers: {
accept: '',
'content-type': '',
'x-vtex-api-appkey': '',
'x-vtex-api-apptoken': ''
},
body: '{"UtmCampaign":"","UtmInternalCampaign":"","UtmMedium":"","UtmSource":"","email":"","items":[{"brandId":"","categoriesIds":[],"index":0,"priceTableIds":[],"quantity":0,"sellerId":"","skuId":""}],"salesChannel":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"accept": @"",
@"content-type": @"",
@"x-vtex-api-appkey": @"",
@"x-vtex-api-apptoken": @"" };
NSDictionary *parameters = @{ @"UtmCampaign": @"",
@"UtmInternalCampaign": @"",
@"UtmMedium": @"",
@"UtmSource": @"",
@"email": @"",
@"items": @[ @{ @"brandId": @"", @"categoriesIds": @[ ], @"index": @0, @"priceTableIds": @[ ], @"quantity": @0, @"sellerId": @"", @"skuId": @"" } ],
@"salesChannel": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/api/pricing-hub/prices?accountName="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/api/pricing-hub/prices?accountName=" in
let headers = Header.add_list (Header.init ()) [
("accept", "");
("content-type", "");
("x-vtex-api-appkey", "");
("x-vtex-api-apptoken", "");
] in
let body = Cohttp_lwt_body.of_string "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/api/pricing-hub/prices?accountName=",
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([
'UtmCampaign' => '',
'UtmInternalCampaign' => '',
'UtmMedium' => '',
'UtmSource' => '',
'email' => '',
'items' => [
[
'brandId' => '',
'categoriesIds' => [
],
'index' => 0,
'priceTableIds' => [
],
'quantity' => 0,
'sellerId' => '',
'skuId' => ''
]
],
'salesChannel' => ''
]),
CURLOPT_HTTPHEADER => [
"accept: ",
"content-type: ",
"x-vtex-api-appkey: ",
"x-vtex-api-apptoken: "
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/api/pricing-hub/prices?accountName=', [
'body' => '{
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
{
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
}
],
"salesChannel": ""
}',
'headers' => [
'accept' => '',
'content-type' => '',
'x-vtex-api-appkey' => '',
'x-vtex-api-apptoken' => '',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/api/pricing-hub/prices');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'accountName' => ''
]);
$request->setHeaders([
'accept' => '',
'content-type' => '',
'x-vtex-api-appkey' => '',
'x-vtex-api-apptoken' => ''
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'UtmCampaign' => '',
'UtmInternalCampaign' => '',
'UtmMedium' => '',
'UtmSource' => '',
'email' => '',
'items' => [
[
'brandId' => '',
'categoriesIds' => [
],
'index' => 0,
'priceTableIds' => [
],
'quantity' => 0,
'sellerId' => '',
'skuId' => ''
]
],
'salesChannel' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'UtmCampaign' => '',
'UtmInternalCampaign' => '',
'UtmMedium' => '',
'UtmSource' => '',
'email' => '',
'items' => [
[
'brandId' => '',
'categoriesIds' => [
],
'index' => 0,
'priceTableIds' => [
],
'quantity' => 0,
'sellerId' => '',
'skuId' => ''
]
],
'salesChannel' => ''
]));
$request->setRequestUrl('{{baseUrl}}/api/pricing-hub/prices');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'accountName' => ''
]));
$request->setHeaders([
'accept' => '',
'content-type' => '',
'x-vtex-api-appkey' => '',
'x-vtex-api-apptoken' => ''
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("accept", "")
$headers.Add("content-type", "")
$headers.Add("x-vtex-api-appkey", "")
$headers.Add("x-vtex-api-apptoken", "")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/api/pricing-hub/prices?accountName=' -Method POST -Headers $headers -ContentType '' -Body '{
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
{
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
}
],
"salesChannel": ""
}'
$headers=@{}
$headers.Add("accept", "")
$headers.Add("content-type", "")
$headers.Add("x-vtex-api-appkey", "")
$headers.Add("x-vtex-api-apptoken", "")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/api/pricing-hub/prices?accountName=' -Method POST -Headers $headers -ContentType '' -Body '{
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
{
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
}
],
"salesChannel": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}"
headers = {
'accept': "",
'content-type': "",
'x-vtex-api-appkey': "",
'x-vtex-api-apptoken': ""
}
conn.request("POST", "/baseUrl/api/pricing-hub/prices?accountName=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/api/pricing-hub/prices"
querystring = {"accountName":""}
payload = {
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
{
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
}
],
"salesChannel": ""
}
headers = {
"accept": "",
"content-type": "",
"x-vtex-api-appkey": "",
"x-vtex-api-apptoken": ""
}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/api/pricing-hub/prices"
queryString <- list(accountName = "")
payload <- "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, add_headers('x-vtex-api-appkey' = '', 'x-vtex-api-apptoken' = ''), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/api/pricing-hub/prices?accountName=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = ''
request["content-type"] = ''
request["x-vtex-api-appkey"] = ''
request["x-vtex-api-apptoken"] = ''
request.body = "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/api/pricing-hub/prices') do |req|
req.headers['accept'] = ''
req.headers['x-vtex-api-appkey'] = ''
req.headers['x-vtex-api-apptoken'] = ''
req.params['accountName'] = ''
req.body = "{\n \"UtmCampaign\": \"\",\n \"UtmInternalCampaign\": \"\",\n \"UtmMedium\": \"\",\n \"UtmSource\": \"\",\n \"email\": \"\",\n \"items\": [\n {\n \"brandId\": \"\",\n \"categoriesIds\": [],\n \"index\": 0,\n \"priceTableIds\": [],\n \"quantity\": 0,\n \"sellerId\": \"\",\n \"skuId\": \"\"\n }\n ],\n \"salesChannel\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/api/pricing-hub/prices";
let querystring = [
("accountName", ""),
];
let payload = json!({
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": (
json!({
"brandId": "",
"categoriesIds": (),
"index": 0,
"priceTableIds": (),
"quantity": 0,
"sellerId": "",
"skuId": ""
})
),
"salesChannel": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("accept", "".parse().unwrap());
headers.insert("content-type", "".parse().unwrap());
headers.insert("x-vtex-api-appkey", "".parse().unwrap());
headers.insert("x-vtex-api-apptoken", "".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/api/pricing-hub/prices?accountName=' \
--header 'accept: ' \
--header 'content-type: ' \
--header 'x-vtex-api-appkey: ' \
--header 'x-vtex-api-apptoken: ' \
--data '{
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
{
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
}
],
"salesChannel": ""
}'
echo '{
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
{
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
}
],
"salesChannel": ""
}' | \
http POST '{{baseUrl}}/api/pricing-hub/prices?accountName=' \
accept:'' \
content-type:'' \
x-vtex-api-appkey:'' \
x-vtex-api-apptoken:''
wget --quiet \
--method POST \
--header 'accept: ' \
--header 'content-type: ' \
--header 'x-vtex-api-appkey: ' \
--header 'x-vtex-api-apptoken: ' \
--body-data '{\n "UtmCampaign": "",\n "UtmInternalCampaign": "",\n "UtmMedium": "",\n "UtmSource": "",\n "email": "",\n "items": [\n {\n "brandId": "",\n "categoriesIds": [],\n "index": 0,\n "priceTableIds": [],\n "quantity": 0,\n "sellerId": "",\n "skuId": ""\n }\n ],\n "salesChannel": ""\n}' \
--output-document \
- '{{baseUrl}}/api/pricing-hub/prices?accountName='
import Foundation
let headers = [
"accept": "",
"content-type": "",
"x-vtex-api-appkey": "",
"x-vtex-api-apptoken": ""
]
let parameters = [
"UtmCampaign": "",
"UtmInternalCampaign": "",
"UtmMedium": "",
"UtmSource": "",
"email": "",
"items": [
[
"brandId": "",
"categoriesIds": [],
"index": 0,
"priceTableIds": [],
"quantity": 0,
"sellerId": "",
"skuId": ""
]
],
"salesChannel": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/api/pricing-hub/prices?accountName=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"items": [
{
"costPrice": 750,
"index": 0,
"listPrice": 2500,
"price": 1875,
"priceTable": "1",
"priceValidUntil": "2022-03-24T14:57:19Z",
"skuId": "14"
},
{
"costPrice": 200,
"index": 0,
"listPrice": 200,
"price": 200,
"priceTable": "1",
"priceValidUntil": "2022-03-04T20:00:18Z",
"skuId": "14"
}
]
}