Content API for Shopping
GET
content.accounts.authinfo
{{baseUrl}}/accounts/authinfo
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/authinfo");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounts/authinfo")
require "http/client"
url = "{{baseUrl}}/accounts/authinfo"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounts/authinfo"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounts/authinfo");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/authinfo"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounts/authinfo HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounts/authinfo")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/authinfo"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/authinfo")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounts/authinfo")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounts/authinfo');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/accounts/authinfo'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/authinfo';
const options = {method: 'GET'};
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}}/accounts/authinfo',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounts/authinfo")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/authinfo',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/accounts/authinfo'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounts/authinfo');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/accounts/authinfo'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/authinfo';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/authinfo"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/accounts/authinfo" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/authinfo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounts/authinfo');
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/authinfo');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounts/authinfo');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/authinfo' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/authinfo' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/accounts/authinfo")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/authinfo"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/authinfo"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/authinfo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounts/authinfo') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/authinfo";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounts/authinfo
http GET {{baseUrl}}/accounts/authinfo
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/accounts/authinfo
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/authinfo")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.accounts.claimwebsite
{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite")
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/accounts/:accountId/claimwebsite HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite';
const options = {method: 'POST'};
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}}/:merchantId/accounts/:accountId/claimwebsite',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId/claimwebsite',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite');
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}}/:merchantId/accounts/:accountId/claimwebsite'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/:merchantId/accounts/:accountId/claimwebsite" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/:merchantId/accounts/:accountId/claimwebsite")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/:merchantId/accounts/:accountId/claimwebsite') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite
http POST {{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId/claimwebsite")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
content.accounts.credentials.create
{{baseUrl}}/accounts/:accountId/credentials
QUERY PARAMS
accountId
BODY json
{
"accessToken": "",
"expiresIn": "",
"purpose": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/credentials");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounts/:accountId/credentials" {:content-type :json
:form-params {:accessToken ""
:expiresIn ""
:purpose ""}})
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/credentials"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\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}}/accounts/:accountId/credentials"),
Content = new StringContent("{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\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}}/accounts/:accountId/credentials");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/credentials"
payload := strings.NewReader("{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/accounts/:accountId/credentials HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"accessToken": "",
"expiresIn": "",
"purpose": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounts/:accountId/credentials")
.setHeader("content-type", "application/json")
.setBody("{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/credentials"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\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 \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/credentials")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounts/:accountId/credentials")
.header("content-type", "application/json")
.body("{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}")
.asString();
const data = JSON.stringify({
accessToken: '',
expiresIn: '',
purpose: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounts/:accountId/credentials');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounts/:accountId/credentials',
headers: {'content-type': 'application/json'},
data: {accessToken: '', expiresIn: '', purpose: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/credentials';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accessToken":"","expiresIn":"","purpose":""}'
};
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}}/accounts/:accountId/credentials',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accessToken": "",\n "expiresIn": "",\n "purpose": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/credentials")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/credentials',
headers: {
'content-type': 'application/json'
}
};
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({accessToken: '', expiresIn: '', purpose: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounts/:accountId/credentials',
headers: {'content-type': 'application/json'},
body: {accessToken: '', expiresIn: '', purpose: ''},
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}}/accounts/:accountId/credentials');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accessToken: '',
expiresIn: '',
purpose: ''
});
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}}/accounts/:accountId/credentials',
headers: {'content-type': 'application/json'},
data: {accessToken: '', expiresIn: '', purpose: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/credentials';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accessToken":"","expiresIn":"","purpose":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accessToken": @"",
@"expiresIn": @"",
@"purpose": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/credentials"]
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}}/accounts/:accountId/credentials" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/credentials",
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([
'accessToken' => '',
'expiresIn' => '',
'purpose' => ''
]),
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;
}
request('POST', '{{baseUrl}}/accounts/:accountId/credentials', [
'body' => '{
"accessToken": "",
"expiresIn": "",
"purpose": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/credentials');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accessToken' => '',
'expiresIn' => '',
'purpose' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accessToken' => '',
'expiresIn' => '',
'purpose' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounts/:accountId/credentials');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/credentials' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accessToken": "",
"expiresIn": "",
"purpose": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/credentials' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accessToken": "",
"expiresIn": "",
"purpose": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/accounts/:accountId/credentials", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/credentials"
payload = {
"accessToken": "",
"expiresIn": "",
"purpose": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/credentials"
payload <- "{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/credentials")
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 \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\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.post('/baseUrl/accounts/:accountId/credentials') do |req|
req.body = "{\n \"accessToken\": \"\",\n \"expiresIn\": \"\",\n \"purpose\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/:accountId/credentials";
let payload = json!({
"accessToken": "",
"expiresIn": "",
"purpose": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounts/:accountId/credentials \
--header 'content-type: application/json' \
--data '{
"accessToken": "",
"expiresIn": "",
"purpose": ""
}'
echo '{
"accessToken": "",
"expiresIn": "",
"purpose": ""
}' | \
http POST {{baseUrl}}/accounts/:accountId/credentials \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accessToken": "",\n "expiresIn": "",\n "purpose": ""\n}' \
--output-document \
- {{baseUrl}}/accounts/:accountId/credentials
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accessToken": "",
"expiresIn": "",
"purpose": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/credentials")! 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()
POST
content.accounts.custombatch
{{baseUrl}}/accounts/batch
BODY json
{
"entries": [
{
"account": {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
},
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": [],
"linkRequest": {
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
},
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounts/batch" {:content-type :json
:form-params {:entries [{:account {:accountManagement ""
:adsLinks [{:adsId ""
:status ""}]
:adultContent false
:automaticImprovements {:imageImprovements {:accountImageImprovementsSettings {:allowAutomaticImageImprovements false}
:effectiveAllowAutomaticImageImprovements false}
:itemUpdates {:accountItemUpdatesSettings {:allowAvailabilityUpdates false
:allowConditionUpdates false
:allowPriceUpdates false
:allowStrictAvailabilityUpdates false}
:effectiveAllowAvailabilityUpdates false
:effectiveAllowConditionUpdates false
:effectiveAllowPriceUpdates false
:effectiveAllowStrictAvailabilityUpdates false}
:shippingImprovements {:allowShippingImprovements false}}
:automaticLabelIds []
:businessInformation {:address {:country ""
:locality ""
:postalCode ""
:region ""
:streetAddress ""}
:customerService {:email ""
:phoneNumber ""
:url ""}
:koreanBusinessRegistrationNumber ""
:phoneNumber ""
:phoneVerificationStatus ""}
:conversionSettings {:freeListingsAutoTaggingEnabled false}
:cssId ""
:googleMyBusinessLink {:gmbAccountId ""
:gmbEmail ""
:status ""}
:id ""
:kind ""
:labelIds []
:name ""
:sellerId ""
:users [{:admin false
:emailAddress ""
:orderManager false
:paymentsAnalyst false
:paymentsManager false
:reportingManager false}]
:websiteUrl ""
:youtubeChannelLinks [{:channelId ""
:status ""}]}
:accountId ""
:batchId 0
:force false
:labelIds []
:linkRequest {:action ""
:linkType ""
:linkedAccountId ""
:services []}
:merchantId ""
:method ""
:overwrite false
:view ""}]}})
require "http/client"
url = "{{baseUrl}}/accounts/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\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}}/accounts/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\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}}/accounts/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/accounts/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2668
{
"entries": [
{
"account": {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
},
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": [],
"linkRequest": {
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
},
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounts/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounts/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
account: {
accountManagement: '',
adsLinks: [
{
adsId: '',
status: ''
}
],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {
allowAutomaticImageImprovements: false
},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {
allowShippingImprovements: false
}
},
automaticLabelIds: [],
businessInformation: {
address: {
country: '',
locality: '',
postalCode: '',
region: '',
streetAddress: ''
},
customerService: {
email: '',
phoneNumber: '',
url: ''
},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {
freeListingsAutoTaggingEnabled: false
},
cssId: '',
googleMyBusinessLink: {
gmbAccountId: '',
gmbEmail: '',
status: ''
},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [
{
channelId: '',
status: ''
}
]
},
accountId: '',
batchId: 0,
force: false,
labelIds: [],
linkRequest: {
action: '',
linkType: '',
linkedAccountId: '',
services: []
},
merchantId: '',
method: '',
overwrite: false,
view: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounts/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounts/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
account: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
},
accountId: '',
batchId: 0,
force: false,
labelIds: [],
linkRequest: {action: '', linkType: '', linkedAccountId: '', services: []},
merchantId: '',
method: '',
overwrite: false,
view: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"account":{"accountManagement":"","adsLinks":[{"adsId":"","status":""}],"adultContent":false,"automaticImprovements":{"imageImprovements":{"accountImageImprovementsSettings":{"allowAutomaticImageImprovements":false},"effectiveAllowAutomaticImageImprovements":false},"itemUpdates":{"accountItemUpdatesSettings":{"allowAvailabilityUpdates":false,"allowConditionUpdates":false,"allowPriceUpdates":false,"allowStrictAvailabilityUpdates":false},"effectiveAllowAvailabilityUpdates":false,"effectiveAllowConditionUpdates":false,"effectiveAllowPriceUpdates":false,"effectiveAllowStrictAvailabilityUpdates":false},"shippingImprovements":{"allowShippingImprovements":false}},"automaticLabelIds":[],"businessInformation":{"address":{"country":"","locality":"","postalCode":"","region":"","streetAddress":""},"customerService":{"email":"","phoneNumber":"","url":""},"koreanBusinessRegistrationNumber":"","phoneNumber":"","phoneVerificationStatus":""},"conversionSettings":{"freeListingsAutoTaggingEnabled":false},"cssId":"","googleMyBusinessLink":{"gmbAccountId":"","gmbEmail":"","status":""},"id":"","kind":"","labelIds":[],"name":"","sellerId":"","users":[{"admin":false,"emailAddress":"","orderManager":false,"paymentsAnalyst":false,"paymentsManager":false,"reportingManager":false}],"websiteUrl":"","youtubeChannelLinks":[{"channelId":"","status":""}]},"accountId":"","batchId":0,"force":false,"labelIds":[],"linkRequest":{"action":"","linkType":"","linkedAccountId":"","services":[]},"merchantId":"","method":"","overwrite":false,"view":""}]}'
};
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}}/accounts/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "account": {\n "accountManagement": "",\n "adsLinks": [\n {\n "adsId": "",\n "status": ""\n }\n ],\n "adultContent": false,\n "automaticImprovements": {\n "imageImprovements": {\n "accountImageImprovementsSettings": {\n "allowAutomaticImageImprovements": false\n },\n "effectiveAllowAutomaticImageImprovements": false\n },\n "itemUpdates": {\n "accountItemUpdatesSettings": {\n "allowAvailabilityUpdates": false,\n "allowConditionUpdates": false,\n "allowPriceUpdates": false,\n "allowStrictAvailabilityUpdates": false\n },\n "effectiveAllowAvailabilityUpdates": false,\n "effectiveAllowConditionUpdates": false,\n "effectiveAllowPriceUpdates": false,\n "effectiveAllowStrictAvailabilityUpdates": false\n },\n "shippingImprovements": {\n "allowShippingImprovements": false\n }\n },\n "automaticLabelIds": [],\n "businessInformation": {\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "region": "",\n "streetAddress": ""\n },\n "customerService": {\n "email": "",\n "phoneNumber": "",\n "url": ""\n },\n "koreanBusinessRegistrationNumber": "",\n "phoneNumber": "",\n "phoneVerificationStatus": ""\n },\n "conversionSettings": {\n "freeListingsAutoTaggingEnabled": false\n },\n "cssId": "",\n "googleMyBusinessLink": {\n "gmbAccountId": "",\n "gmbEmail": "",\n "status": ""\n },\n "id": "",\n "kind": "",\n "labelIds": [],\n "name": "",\n "sellerId": "",\n "users": [\n {\n "admin": false,\n "emailAddress": "",\n "orderManager": false,\n "paymentsAnalyst": false,\n "paymentsManager": false,\n "reportingManager": false\n }\n ],\n "websiteUrl": "",\n "youtubeChannelLinks": [\n {\n "channelId": "",\n "status": ""\n }\n ]\n },\n "accountId": "",\n "batchId": 0,\n "force": false,\n "labelIds": [],\n "linkRequest": {\n "action": "",\n "linkType": "",\n "linkedAccountId": "",\n "services": []\n },\n "merchantId": "",\n "method": "",\n "overwrite": false,\n "view": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounts/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
account: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
},
accountId: '',
batchId: 0,
force: false,
labelIds: [],
linkRequest: {action: '', linkType: '', linkedAccountId: '', services: []},
merchantId: '',
method: '',
overwrite: false,
view: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounts/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
account: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
},
accountId: '',
batchId: 0,
force: false,
labelIds: [],
linkRequest: {action: '', linkType: '', linkedAccountId: '', services: []},
merchantId: '',
method: '',
overwrite: false,
view: ''
}
]
},
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}}/accounts/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
account: {
accountManagement: '',
adsLinks: [
{
adsId: '',
status: ''
}
],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {
allowAutomaticImageImprovements: false
},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {
allowShippingImprovements: false
}
},
automaticLabelIds: [],
businessInformation: {
address: {
country: '',
locality: '',
postalCode: '',
region: '',
streetAddress: ''
},
customerService: {
email: '',
phoneNumber: '',
url: ''
},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {
freeListingsAutoTaggingEnabled: false
},
cssId: '',
googleMyBusinessLink: {
gmbAccountId: '',
gmbEmail: '',
status: ''
},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [
{
channelId: '',
status: ''
}
]
},
accountId: '',
batchId: 0,
force: false,
labelIds: [],
linkRequest: {
action: '',
linkType: '',
linkedAccountId: '',
services: []
},
merchantId: '',
method: '',
overwrite: false,
view: ''
}
]
});
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}}/accounts/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
account: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
},
accountId: '',
batchId: 0,
force: false,
labelIds: [],
linkRequest: {action: '', linkType: '', linkedAccountId: '', services: []},
merchantId: '',
method: '',
overwrite: false,
view: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"account":{"accountManagement":"","adsLinks":[{"adsId":"","status":""}],"adultContent":false,"automaticImprovements":{"imageImprovements":{"accountImageImprovementsSettings":{"allowAutomaticImageImprovements":false},"effectiveAllowAutomaticImageImprovements":false},"itemUpdates":{"accountItemUpdatesSettings":{"allowAvailabilityUpdates":false,"allowConditionUpdates":false,"allowPriceUpdates":false,"allowStrictAvailabilityUpdates":false},"effectiveAllowAvailabilityUpdates":false,"effectiveAllowConditionUpdates":false,"effectiveAllowPriceUpdates":false,"effectiveAllowStrictAvailabilityUpdates":false},"shippingImprovements":{"allowShippingImprovements":false}},"automaticLabelIds":[],"businessInformation":{"address":{"country":"","locality":"","postalCode":"","region":"","streetAddress":""},"customerService":{"email":"","phoneNumber":"","url":""},"koreanBusinessRegistrationNumber":"","phoneNumber":"","phoneVerificationStatus":""},"conversionSettings":{"freeListingsAutoTaggingEnabled":false},"cssId":"","googleMyBusinessLink":{"gmbAccountId":"","gmbEmail":"","status":""},"id":"","kind":"","labelIds":[],"name":"","sellerId":"","users":[{"admin":false,"emailAddress":"","orderManager":false,"paymentsAnalyst":false,"paymentsManager":false,"reportingManager":false}],"websiteUrl":"","youtubeChannelLinks":[{"channelId":"","status":""}]},"accountId":"","batchId":0,"force":false,"labelIds":[],"linkRequest":{"action":"","linkType":"","linkedAccountId":"","services":[]},"merchantId":"","method":"","overwrite":false,"view":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"account": @{ @"accountManagement": @"", @"adsLinks": @[ @{ @"adsId": @"", @"status": @"" } ], @"adultContent": @NO, @"automaticImprovements": @{ @"imageImprovements": @{ @"accountImageImprovementsSettings": @{ @"allowAutomaticImageImprovements": @NO }, @"effectiveAllowAutomaticImageImprovements": @NO }, @"itemUpdates": @{ @"accountItemUpdatesSettings": @{ @"allowAvailabilityUpdates": @NO, @"allowConditionUpdates": @NO, @"allowPriceUpdates": @NO, @"allowStrictAvailabilityUpdates": @NO }, @"effectiveAllowAvailabilityUpdates": @NO, @"effectiveAllowConditionUpdates": @NO, @"effectiveAllowPriceUpdates": @NO, @"effectiveAllowStrictAvailabilityUpdates": @NO }, @"shippingImprovements": @{ @"allowShippingImprovements": @NO } }, @"automaticLabelIds": @[ ], @"businessInformation": @{ @"address": @{ @"country": @"", @"locality": @"", @"postalCode": @"", @"region": @"", @"streetAddress": @"" }, @"customerService": @{ @"email": @"", @"phoneNumber": @"", @"url": @"" }, @"koreanBusinessRegistrationNumber": @"", @"phoneNumber": @"", @"phoneVerificationStatus": @"" }, @"conversionSettings": @{ @"freeListingsAutoTaggingEnabled": @NO }, @"cssId": @"", @"googleMyBusinessLink": @{ @"gmbAccountId": @"", @"gmbEmail": @"", @"status": @"" }, @"id": @"", @"kind": @"", @"labelIds": @[ ], @"name": @"", @"sellerId": @"", @"users": @[ @{ @"admin": @NO, @"emailAddress": @"", @"orderManager": @NO, @"paymentsAnalyst": @NO, @"paymentsManager": @NO, @"reportingManager": @NO } ], @"websiteUrl": @"", @"youtubeChannelLinks": @[ @{ @"channelId": @"", @"status": @"" } ] }, @"accountId": @"", @"batchId": @0, @"force": @NO, @"labelIds": @[ ], @"linkRequest": @{ @"action": @"", @"linkType": @"", @"linkedAccountId": @"", @"services": @[ ] }, @"merchantId": @"", @"method": @"", @"overwrite": @NO, @"view": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/batch"]
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}}/accounts/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/batch",
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([
'entries' => [
[
'account' => [
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
],
'accountId' => '',
'batchId' => 0,
'force' => null,
'labelIds' => [
],
'linkRequest' => [
'action' => '',
'linkType' => '',
'linkedAccountId' => '',
'services' => [
]
],
'merchantId' => '',
'method' => '',
'overwrite' => null,
'view' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/accounts/batch', [
'body' => '{
"entries": [
{
"account": {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
},
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": [],
"linkRequest": {
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
},
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'account' => [
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
],
'accountId' => '',
'batchId' => 0,
'force' => null,
'labelIds' => [
],
'linkRequest' => [
'action' => '',
'linkType' => '',
'linkedAccountId' => '',
'services' => [
]
],
'merchantId' => '',
'method' => '',
'overwrite' => null,
'view' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'account' => [
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
],
'accountId' => '',
'batchId' => 0,
'force' => null,
'labelIds' => [
],
'linkRequest' => [
'action' => '',
'linkType' => '',
'linkedAccountId' => '',
'services' => [
]
],
'merchantId' => '',
'method' => '',
'overwrite' => null,
'view' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/accounts/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"account": {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
},
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": [],
"linkRequest": {
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
},
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"account": {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
},
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": [],
"linkRequest": {
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
},
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/accounts/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/batch"
payload = { "entries": [
{
"account": {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": False,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": { "allowAutomaticImageImprovements": False },
"effectiveAllowAutomaticImageImprovements": False
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": False,
"allowConditionUpdates": False,
"allowPriceUpdates": False,
"allowStrictAvailabilityUpdates": False
},
"effectiveAllowAvailabilityUpdates": False,
"effectiveAllowConditionUpdates": False,
"effectiveAllowPriceUpdates": False,
"effectiveAllowStrictAvailabilityUpdates": False
},
"shippingImprovements": { "allowShippingImprovements": False }
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": { "freeListingsAutoTaggingEnabled": False },
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": False,
"emailAddress": "",
"orderManager": False,
"paymentsAnalyst": False,
"paymentsManager": False,
"reportingManager": False
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
},
"accountId": "",
"batchId": 0,
"force": False,
"labelIds": [],
"linkRequest": {
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
},
"merchantId": "",
"method": "",
"overwrite": False,
"view": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/batch"
payload <- "{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/batch")
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 \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\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.post('/baseUrl/accounts/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"account\": {\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n },\n \"accountId\": \"\",\n \"batchId\": 0,\n \"force\": false,\n \"labelIds\": [],\n \"linkRequest\": {\n \"action\": \"\",\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"services\": []\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"overwrite\": false,\n \"view\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/batch";
let payload = json!({"entries": (
json!({
"account": json!({
"accountManagement": "",
"adsLinks": (
json!({
"adsId": "",
"status": ""
})
),
"adultContent": false,
"automaticImprovements": json!({
"imageImprovements": json!({
"accountImageImprovementsSettings": json!({"allowAutomaticImageImprovements": false}),
"effectiveAllowAutomaticImageImprovements": false
}),
"itemUpdates": json!({
"accountItemUpdatesSettings": json!({
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
}),
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
}),
"shippingImprovements": json!({"allowShippingImprovements": false})
}),
"automaticLabelIds": (),
"businessInformation": json!({
"address": json!({
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
}),
"customerService": json!({
"email": "",
"phoneNumber": "",
"url": ""
}),
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
}),
"conversionSettings": json!({"freeListingsAutoTaggingEnabled": false}),
"cssId": "",
"googleMyBusinessLink": json!({
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
}),
"id": "",
"kind": "",
"labelIds": (),
"name": "",
"sellerId": "",
"users": (
json!({
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
})
),
"websiteUrl": "",
"youtubeChannelLinks": (
json!({
"channelId": "",
"status": ""
})
)
}),
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": (),
"linkRequest": json!({
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": ()
}),
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounts/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"account": {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
},
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": [],
"linkRequest": {
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
},
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
}
]
}'
echo '{
"entries": [
{
"account": {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
},
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": [],
"linkRequest": {
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
},
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
}
]
}' | \
http POST {{baseUrl}}/accounts/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "account": {\n "accountManagement": "",\n "adsLinks": [\n {\n "adsId": "",\n "status": ""\n }\n ],\n "adultContent": false,\n "automaticImprovements": {\n "imageImprovements": {\n "accountImageImprovementsSettings": {\n "allowAutomaticImageImprovements": false\n },\n "effectiveAllowAutomaticImageImprovements": false\n },\n "itemUpdates": {\n "accountItemUpdatesSettings": {\n "allowAvailabilityUpdates": false,\n "allowConditionUpdates": false,\n "allowPriceUpdates": false,\n "allowStrictAvailabilityUpdates": false\n },\n "effectiveAllowAvailabilityUpdates": false,\n "effectiveAllowConditionUpdates": false,\n "effectiveAllowPriceUpdates": false,\n "effectiveAllowStrictAvailabilityUpdates": false\n },\n "shippingImprovements": {\n "allowShippingImprovements": false\n }\n },\n "automaticLabelIds": [],\n "businessInformation": {\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "region": "",\n "streetAddress": ""\n },\n "customerService": {\n "email": "",\n "phoneNumber": "",\n "url": ""\n },\n "koreanBusinessRegistrationNumber": "",\n "phoneNumber": "",\n "phoneVerificationStatus": ""\n },\n "conversionSettings": {\n "freeListingsAutoTaggingEnabled": false\n },\n "cssId": "",\n "googleMyBusinessLink": {\n "gmbAccountId": "",\n "gmbEmail": "",\n "status": ""\n },\n "id": "",\n "kind": "",\n "labelIds": [],\n "name": "",\n "sellerId": "",\n "users": [\n {\n "admin": false,\n "emailAddress": "",\n "orderManager": false,\n "paymentsAnalyst": false,\n "paymentsManager": false,\n "reportingManager": false\n }\n ],\n "websiteUrl": "",\n "youtubeChannelLinks": [\n {\n "channelId": "",\n "status": ""\n }\n ]\n },\n "accountId": "",\n "batchId": 0,\n "force": false,\n "labelIds": [],\n "linkRequest": {\n "action": "",\n "linkType": "",\n "linkedAccountId": "",\n "services": []\n },\n "merchantId": "",\n "method": "",\n "overwrite": false,\n "view": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/accounts/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"account": [
"accountManagement": "",
"adsLinks": [
[
"adsId": "",
"status": ""
]
],
"adultContent": false,
"automaticImprovements": [
"imageImprovements": [
"accountImageImprovementsSettings": ["allowAutomaticImageImprovements": false],
"effectiveAllowAutomaticImageImprovements": false
],
"itemUpdates": [
"accountItemUpdatesSettings": [
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
],
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
],
"shippingImprovements": ["allowShippingImprovements": false]
],
"automaticLabelIds": [],
"businessInformation": [
"address": [
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
],
"customerService": [
"email": "",
"phoneNumber": "",
"url": ""
],
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
],
"conversionSettings": ["freeListingsAutoTaggingEnabled": false],
"cssId": "",
"googleMyBusinessLink": [
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
],
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
[
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
]
],
"websiteUrl": "",
"youtubeChannelLinks": [
[
"channelId": "",
"status": ""
]
]
],
"accountId": "",
"batchId": 0,
"force": false,
"labelIds": [],
"linkRequest": [
"action": "",
"linkType": "",
"linkedAccountId": "",
"services": []
],
"merchantId": "",
"method": "",
"overwrite": false,
"view": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/batch")! 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()
DELETE
content.accounts.delete
{{baseUrl}}/:merchantId/accounts/:accountId
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/accounts/:accountId")
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accounts/:accountId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accounts/:accountId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/accounts/:accountId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/accounts/:accountId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/accounts/:accountId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/accounts/:accountId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/accounts/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId';
const options = {method: 'DELETE'};
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}}/:merchantId/accounts/:accountId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/accounts/:accountId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/accounts/:accountId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/accounts/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/accounts/:accountId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/accounts/:accountId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/accounts/:accountId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/accounts/:accountId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts/:accountId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/accounts/:accountId
http DELETE {{baseUrl}}/:merchantId/accounts/:accountId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.accounts.get
{{baseUrl}}/:merchantId/accounts/:accountId
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/accounts/:accountId")
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accounts/:accountId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accounts/:accountId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/accounts/:accountId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/accounts/:accountId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/accounts/:accountId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/accounts/:accountId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounts/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId';
const options = {method: 'GET'};
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}}/:merchantId/accounts/:accountId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounts/:accountId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/accounts/:accountId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounts/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/accounts/:accountId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/accounts/:accountId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/accounts/:accountId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/accounts/:accountId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts/:accountId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/accounts/:accountId
http GET {{baseUrl}}/:merchantId/accounts/:accountId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.accounts.insert
{{baseUrl}}/:merchantId/accounts
QUERY PARAMS
merchantId
BODY json
{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/accounts" {:content-type :json
:form-params {:accountManagement ""
:adsLinks [{:adsId ""
:status ""}]
:adultContent false
:automaticImprovements {:imageImprovements {:accountImageImprovementsSettings {:allowAutomaticImageImprovements false}
:effectiveAllowAutomaticImageImprovements false}
:itemUpdates {:accountItemUpdatesSettings {:allowAvailabilityUpdates false
:allowConditionUpdates false
:allowPriceUpdates false
:allowStrictAvailabilityUpdates false}
:effectiveAllowAvailabilityUpdates false
:effectiveAllowConditionUpdates false
:effectiveAllowPriceUpdates false
:effectiveAllowStrictAvailabilityUpdates false}
:shippingImprovements {:allowShippingImprovements false}}
:automaticLabelIds []
:businessInformation {:address {:country ""
:locality ""
:postalCode ""
:region ""
:streetAddress ""}
:customerService {:email ""
:phoneNumber ""
:url ""}
:koreanBusinessRegistrationNumber ""
:phoneNumber ""
:phoneVerificationStatus ""}
:conversionSettings {:freeListingsAutoTaggingEnabled false}
:cssId ""
:googleMyBusinessLink {:gmbAccountId ""
:gmbEmail ""
:status ""}
:id ""
:kind ""
:labelIds []
:name ""
:sellerId ""
:users [{:admin false
:emailAddress ""
:orderManager false
:paymentsAnalyst false
:paymentsManager false
:reportingManager false}]
:websiteUrl ""
:youtubeChannelLinks [{:channelId ""
:status ""}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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}}/:merchantId/accounts"),
Content = new StringContent("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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}}/:merchantId/accounts");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts"
payload := strings.NewReader("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/accounts HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1823
{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/accounts")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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 \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/accounts")
.header("content-type", "application/json")
.body("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
accountManagement: '',
adsLinks: [
{
adsId: '',
status: ''
}
],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {
allowAutomaticImageImprovements: false
},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {
allowShippingImprovements: false
}
},
automaticLabelIds: [],
businessInformation: {
address: {
country: '',
locality: '',
postalCode: '',
region: '',
streetAddress: ''
},
customerService: {
email: '',
phoneNumber: '',
url: ''
},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {
freeListingsAutoTaggingEnabled: false
},
cssId: '',
googleMyBusinessLink: {
gmbAccountId: '',
gmbEmail: '',
status: ''
},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [
{
channelId: '',
status: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/accounts');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts',
headers: {'content-type': 'application/json'},
data: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountManagement":"","adsLinks":[{"adsId":"","status":""}],"adultContent":false,"automaticImprovements":{"imageImprovements":{"accountImageImprovementsSettings":{"allowAutomaticImageImprovements":false},"effectiveAllowAutomaticImageImprovements":false},"itemUpdates":{"accountItemUpdatesSettings":{"allowAvailabilityUpdates":false,"allowConditionUpdates":false,"allowPriceUpdates":false,"allowStrictAvailabilityUpdates":false},"effectiveAllowAvailabilityUpdates":false,"effectiveAllowConditionUpdates":false,"effectiveAllowPriceUpdates":false,"effectiveAllowStrictAvailabilityUpdates":false},"shippingImprovements":{"allowShippingImprovements":false}},"automaticLabelIds":[],"businessInformation":{"address":{"country":"","locality":"","postalCode":"","region":"","streetAddress":""},"customerService":{"email":"","phoneNumber":"","url":""},"koreanBusinessRegistrationNumber":"","phoneNumber":"","phoneVerificationStatus":""},"conversionSettings":{"freeListingsAutoTaggingEnabled":false},"cssId":"","googleMyBusinessLink":{"gmbAccountId":"","gmbEmail":"","status":""},"id":"","kind":"","labelIds":[],"name":"","sellerId":"","users":[{"admin":false,"emailAddress":"","orderManager":false,"paymentsAnalyst":false,"paymentsManager":false,"reportingManager":false}],"websiteUrl":"","youtubeChannelLinks":[{"channelId":"","status":""}]}'
};
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}}/:merchantId/accounts',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountManagement": "",\n "adsLinks": [\n {\n "adsId": "",\n "status": ""\n }\n ],\n "adultContent": false,\n "automaticImprovements": {\n "imageImprovements": {\n "accountImageImprovementsSettings": {\n "allowAutomaticImageImprovements": false\n },\n "effectiveAllowAutomaticImageImprovements": false\n },\n "itemUpdates": {\n "accountItemUpdatesSettings": {\n "allowAvailabilityUpdates": false,\n "allowConditionUpdates": false,\n "allowPriceUpdates": false,\n "allowStrictAvailabilityUpdates": false\n },\n "effectiveAllowAvailabilityUpdates": false,\n "effectiveAllowConditionUpdates": false,\n "effectiveAllowPriceUpdates": false,\n "effectiveAllowStrictAvailabilityUpdates": false\n },\n "shippingImprovements": {\n "allowShippingImprovements": false\n }\n },\n "automaticLabelIds": [],\n "businessInformation": {\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "region": "",\n "streetAddress": ""\n },\n "customerService": {\n "email": "",\n "phoneNumber": "",\n "url": ""\n },\n "koreanBusinessRegistrationNumber": "",\n "phoneNumber": "",\n "phoneVerificationStatus": ""\n },\n "conversionSettings": {\n "freeListingsAutoTaggingEnabled": false\n },\n "cssId": "",\n "googleMyBusinessLink": {\n "gmbAccountId": "",\n "gmbEmail": "",\n "status": ""\n },\n "id": "",\n "kind": "",\n "labelIds": [],\n "name": "",\n "sellerId": "",\n "users": [\n {\n "admin": false,\n "emailAddress": "",\n "orderManager": false,\n "paymentsAnalyst": false,\n "paymentsManager": false,\n "reportingManager": false\n }\n ],\n "websiteUrl": "",\n "youtubeChannelLinks": [\n {\n "channelId": "",\n "status": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts',
headers: {
'content-type': 'application/json'
}
};
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({
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts',
headers: {'content-type': 'application/json'},
body: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
},
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}}/:merchantId/accounts');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountManagement: '',
adsLinks: [
{
adsId: '',
status: ''
}
],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {
allowAutomaticImageImprovements: false
},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {
allowShippingImprovements: false
}
},
automaticLabelIds: [],
businessInformation: {
address: {
country: '',
locality: '',
postalCode: '',
region: '',
streetAddress: ''
},
customerService: {
email: '',
phoneNumber: '',
url: ''
},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {
freeListingsAutoTaggingEnabled: false
},
cssId: '',
googleMyBusinessLink: {
gmbAccountId: '',
gmbEmail: '',
status: ''
},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [
{
channelId: '',
status: ''
}
]
});
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}}/:merchantId/accounts',
headers: {'content-type': 'application/json'},
data: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountManagement":"","adsLinks":[{"adsId":"","status":""}],"adultContent":false,"automaticImprovements":{"imageImprovements":{"accountImageImprovementsSettings":{"allowAutomaticImageImprovements":false},"effectiveAllowAutomaticImageImprovements":false},"itemUpdates":{"accountItemUpdatesSettings":{"allowAvailabilityUpdates":false,"allowConditionUpdates":false,"allowPriceUpdates":false,"allowStrictAvailabilityUpdates":false},"effectiveAllowAvailabilityUpdates":false,"effectiveAllowConditionUpdates":false,"effectiveAllowPriceUpdates":false,"effectiveAllowStrictAvailabilityUpdates":false},"shippingImprovements":{"allowShippingImprovements":false}},"automaticLabelIds":[],"businessInformation":{"address":{"country":"","locality":"","postalCode":"","region":"","streetAddress":""},"customerService":{"email":"","phoneNumber":"","url":""},"koreanBusinessRegistrationNumber":"","phoneNumber":"","phoneVerificationStatus":""},"conversionSettings":{"freeListingsAutoTaggingEnabled":false},"cssId":"","googleMyBusinessLink":{"gmbAccountId":"","gmbEmail":"","status":""},"id":"","kind":"","labelIds":[],"name":"","sellerId":"","users":[{"admin":false,"emailAddress":"","orderManager":false,"paymentsAnalyst":false,"paymentsManager":false,"reportingManager":false}],"websiteUrl":"","youtubeChannelLinks":[{"channelId":"","status":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accountManagement": @"",
@"adsLinks": @[ @{ @"adsId": @"", @"status": @"" } ],
@"adultContent": @NO,
@"automaticImprovements": @{ @"imageImprovements": @{ @"accountImageImprovementsSettings": @{ @"allowAutomaticImageImprovements": @NO }, @"effectiveAllowAutomaticImageImprovements": @NO }, @"itemUpdates": @{ @"accountItemUpdatesSettings": @{ @"allowAvailabilityUpdates": @NO, @"allowConditionUpdates": @NO, @"allowPriceUpdates": @NO, @"allowStrictAvailabilityUpdates": @NO }, @"effectiveAllowAvailabilityUpdates": @NO, @"effectiveAllowConditionUpdates": @NO, @"effectiveAllowPriceUpdates": @NO, @"effectiveAllowStrictAvailabilityUpdates": @NO }, @"shippingImprovements": @{ @"allowShippingImprovements": @NO } },
@"automaticLabelIds": @[ ],
@"businessInformation": @{ @"address": @{ @"country": @"", @"locality": @"", @"postalCode": @"", @"region": @"", @"streetAddress": @"" }, @"customerService": @{ @"email": @"", @"phoneNumber": @"", @"url": @"" }, @"koreanBusinessRegistrationNumber": @"", @"phoneNumber": @"", @"phoneVerificationStatus": @"" },
@"conversionSettings": @{ @"freeListingsAutoTaggingEnabled": @NO },
@"cssId": @"",
@"googleMyBusinessLink": @{ @"gmbAccountId": @"", @"gmbEmail": @"", @"status": @"" },
@"id": @"",
@"kind": @"",
@"labelIds": @[ ],
@"name": @"",
@"sellerId": @"",
@"users": @[ @{ @"admin": @NO, @"emailAddress": @"", @"orderManager": @NO, @"paymentsAnalyst": @NO, @"paymentsManager": @NO, @"reportingManager": @NO } ],
@"websiteUrl": @"",
@"youtubeChannelLinks": @[ @{ @"channelId": @"", @"status": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts"]
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}}/:merchantId/accounts" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts",
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([
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/accounts', [
'body' => '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/accounts');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/accounts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts"
payload = {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": False,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": { "allowAutomaticImageImprovements": False },
"effectiveAllowAutomaticImageImprovements": False
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": False,
"allowConditionUpdates": False,
"allowPriceUpdates": False,
"allowStrictAvailabilityUpdates": False
},
"effectiveAllowAvailabilityUpdates": False,
"effectiveAllowConditionUpdates": False,
"effectiveAllowPriceUpdates": False,
"effectiveAllowStrictAvailabilityUpdates": False
},
"shippingImprovements": { "allowShippingImprovements": False }
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": { "freeListingsAutoTaggingEnabled": False },
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": False,
"emailAddress": "",
"orderManager": False,
"paymentsAnalyst": False,
"paymentsManager": False,
"reportingManager": False
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts"
payload <- "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts")
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 \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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.post('/baseUrl/:merchantId/accounts') do |req|
req.body = "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts";
let payload = json!({
"accountManagement": "",
"adsLinks": (
json!({
"adsId": "",
"status": ""
})
),
"adultContent": false,
"automaticImprovements": json!({
"imageImprovements": json!({
"accountImageImprovementsSettings": json!({"allowAutomaticImageImprovements": false}),
"effectiveAllowAutomaticImageImprovements": false
}),
"itemUpdates": json!({
"accountItemUpdatesSettings": json!({
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
}),
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
}),
"shippingImprovements": json!({"allowShippingImprovements": false})
}),
"automaticLabelIds": (),
"businessInformation": json!({
"address": json!({
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
}),
"customerService": json!({
"email": "",
"phoneNumber": "",
"url": ""
}),
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
}),
"conversionSettings": json!({"freeListingsAutoTaggingEnabled": false}),
"cssId": "",
"googleMyBusinessLink": json!({
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
}),
"id": "",
"kind": "",
"labelIds": (),
"name": "",
"sellerId": "",
"users": (
json!({
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
})
),
"websiteUrl": "",
"youtubeChannelLinks": (
json!({
"channelId": "",
"status": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/accounts \
--header 'content-type: application/json' \
--data '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}'
echo '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}' | \
http POST {{baseUrl}}/:merchantId/accounts \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountManagement": "",\n "adsLinks": [\n {\n "adsId": "",\n "status": ""\n }\n ],\n "adultContent": false,\n "automaticImprovements": {\n "imageImprovements": {\n "accountImageImprovementsSettings": {\n "allowAutomaticImageImprovements": false\n },\n "effectiveAllowAutomaticImageImprovements": false\n },\n "itemUpdates": {\n "accountItemUpdatesSettings": {\n "allowAvailabilityUpdates": false,\n "allowConditionUpdates": false,\n "allowPriceUpdates": false,\n "allowStrictAvailabilityUpdates": false\n },\n "effectiveAllowAvailabilityUpdates": false,\n "effectiveAllowConditionUpdates": false,\n "effectiveAllowPriceUpdates": false,\n "effectiveAllowStrictAvailabilityUpdates": false\n },\n "shippingImprovements": {\n "allowShippingImprovements": false\n }\n },\n "automaticLabelIds": [],\n "businessInformation": {\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "region": "",\n "streetAddress": ""\n },\n "customerService": {\n "email": "",\n "phoneNumber": "",\n "url": ""\n },\n "koreanBusinessRegistrationNumber": "",\n "phoneNumber": "",\n "phoneVerificationStatus": ""\n },\n "conversionSettings": {\n "freeListingsAutoTaggingEnabled": false\n },\n "cssId": "",\n "googleMyBusinessLink": {\n "gmbAccountId": "",\n "gmbEmail": "",\n "status": ""\n },\n "id": "",\n "kind": "",\n "labelIds": [],\n "name": "",\n "sellerId": "",\n "users": [\n {\n "admin": false,\n "emailAddress": "",\n "orderManager": false,\n "paymentsAnalyst": false,\n "paymentsManager": false,\n "reportingManager": false\n }\n ],\n "websiteUrl": "",\n "youtubeChannelLinks": [\n {\n "channelId": "",\n "status": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/accounts
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountManagement": "",
"adsLinks": [
[
"adsId": "",
"status": ""
]
],
"adultContent": false,
"automaticImprovements": [
"imageImprovements": [
"accountImageImprovementsSettings": ["allowAutomaticImageImprovements": false],
"effectiveAllowAutomaticImageImprovements": false
],
"itemUpdates": [
"accountItemUpdatesSettings": [
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
],
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
],
"shippingImprovements": ["allowShippingImprovements": false]
],
"automaticLabelIds": [],
"businessInformation": [
"address": [
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
],
"customerService": [
"email": "",
"phoneNumber": "",
"url": ""
],
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
],
"conversionSettings": ["freeListingsAutoTaggingEnabled": false],
"cssId": "",
"googleMyBusinessLink": [
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
],
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
[
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
]
],
"websiteUrl": "",
"youtubeChannelLinks": [
[
"channelId": "",
"status": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts")! 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()
POST
content.accounts.labels.create
{{baseUrl}}/accounts/:accountId/labels
QUERY PARAMS
accountId
BODY json
{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/labels");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounts/:accountId/labels" {:content-type :json
:form-params {:accountId ""
:description ""
:labelId ""
:labelType ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/labels"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\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}}/accounts/:accountId/labels"),
Content = new StringContent("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"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}}/accounts/:accountId/labels");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/labels"
payload := strings.NewReader("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/accounts/:accountId/labels HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 92
{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounts/:accountId/labels")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/labels"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"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 \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/labels")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounts/:accountId/labels")
.header("content-type", "application/json")
.body("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
accountId: '',
description: '',
labelId: '',
labelType: '',
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounts/:accountId/labels');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounts/:accountId/labels',
headers: {'content-type': 'application/json'},
data: {accountId: '', description: '', labelId: '', labelType: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/labels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","description":"","labelId":"","labelType":"","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}}/accounts/:accountId/labels',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountId": "",\n "description": "",\n "labelId": "",\n "labelType": "",\n "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 \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/labels")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/labels',
headers: {
'content-type': 'application/json'
}
};
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({accountId: '', description: '', labelId: '', labelType: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounts/:accountId/labels',
headers: {'content-type': 'application/json'},
body: {accountId: '', description: '', labelId: '', labelType: '', 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('POST', '{{baseUrl}}/accounts/:accountId/labels');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountId: '',
description: '',
labelId: '',
labelType: '',
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: 'POST',
url: '{{baseUrl}}/accounts/:accountId/labels',
headers: {'content-type': 'application/json'},
data: {accountId: '', description: '', labelId: '', labelType: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/labels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","description":"","labelId":"","labelType":"","name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accountId": @"",
@"description": @"",
@"labelId": @"",
@"labelType": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/labels"]
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}}/accounts/:accountId/labels" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/labels",
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([
'accountId' => '',
'description' => '',
'labelId' => '',
'labelType' => '',
'name' => ''
]),
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;
}
request('POST', '{{baseUrl}}/accounts/:accountId/labels', [
'body' => '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/labels');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountId' => '',
'description' => '',
'labelId' => '',
'labelType' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountId' => '',
'description' => '',
'labelId' => '',
'labelType' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounts/:accountId/labels');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/labels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/labels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/accounts/:accountId/labels", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/labels"
payload = {
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/labels"
payload <- "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/labels")
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 \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"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.post('/baseUrl/accounts/:accountId/labels') do |req|
req.body = "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/:accountId/labels";
let payload = json!({
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounts/:accountId/labels \
--header 'content-type: application/json' \
--data '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}'
echo '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}' | \
http POST {{baseUrl}}/accounts/:accountId/labels \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountId": "",\n "description": "",\n "labelId": "",\n "labelType": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/accounts/:accountId/labels
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/labels")! 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()
DELETE
content.accounts.labels.delete
{{baseUrl}}/accounts/:accountId/labels/:labelId
QUERY PARAMS
accountId
labelId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/labels/:labelId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounts/:accountId/labels/:labelId")
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/labels/:labelId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounts/:accountId/labels/:labelId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounts/:accountId/labels/:labelId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/labels/:labelId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounts/:accountId/labels/:labelId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounts/:accountId/labels/:labelId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/labels/:labelId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/labels/:labelId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounts/:accountId/labels/:labelId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounts/:accountId/labels/:labelId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounts/:accountId/labels/:labelId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/labels/:labelId';
const options = {method: 'DELETE'};
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}}/accounts/:accountId/labels/:labelId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/labels/:labelId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/labels/:labelId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounts/:accountId/labels/:labelId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounts/:accountId/labels/:labelId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounts/:accountId/labels/:labelId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/labels/:labelId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/labels/:labelId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/accounts/:accountId/labels/:labelId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/labels/:labelId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounts/:accountId/labels/:labelId');
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/labels/:labelId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounts/:accountId/labels/:labelId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/labels/:labelId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/labels/:labelId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/accounts/:accountId/labels/:labelId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/labels/:labelId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/labels/:labelId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/labels/:labelId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounts/:accountId/labels/:labelId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/:accountId/labels/:labelId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounts/:accountId/labels/:labelId
http DELETE {{baseUrl}}/accounts/:accountId/labels/:labelId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/accounts/:accountId/labels/:labelId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/labels/:labelId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.accounts.labels.list
{{baseUrl}}/accounts/:accountId/labels
QUERY PARAMS
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/labels");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounts/:accountId/labels")
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/labels"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounts/:accountId/labels"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounts/:accountId/labels");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/labels"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounts/:accountId/labels HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounts/:accountId/labels")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/labels"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/labels")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounts/:accountId/labels")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounts/:accountId/labels');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/accounts/:accountId/labels'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/labels';
const options = {method: 'GET'};
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}}/accounts/:accountId/labels',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/labels")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/labels',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/accounts/:accountId/labels'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounts/:accountId/labels');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/accounts/:accountId/labels'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/labels';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/labels"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/accounts/:accountId/labels" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/labels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounts/:accountId/labels');
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/labels');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounts/:accountId/labels');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/labels' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/labels' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/accounts/:accountId/labels")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/labels"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/labels"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/labels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounts/:accountId/labels') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/:accountId/labels";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounts/:accountId/labels
http GET {{baseUrl}}/accounts/:accountId/labels
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/accounts/:accountId/labels
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/labels")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PATCH
content.accounts.labels.patch
{{baseUrl}}/accounts/:accountId/labels/:labelId
QUERY PARAMS
accountId
labelId
BODY json
{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/labels/:labelId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounts/:accountId/labels/:labelId" {:content-type :json
:form-params {:accountId ""
:description ""
:labelId ""
:labelType ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/labels/:labelId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounts/:accountId/labels/:labelId"),
Content = new StringContent("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"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}}/accounts/:accountId/labels/:labelId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/labels/:labelId"
payload := strings.NewReader("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounts/:accountId/labels/:labelId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 92
{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounts/:accountId/labels/:labelId")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/labels/:labelId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"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 \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/labels/:labelId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounts/:accountId/labels/:labelId")
.header("content-type", "application/json")
.body("{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
accountId: '',
description: '',
labelId: '',
labelType: '',
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounts/:accountId/labels/:labelId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounts/:accountId/labels/:labelId',
headers: {'content-type': 'application/json'},
data: {accountId: '', description: '', labelId: '', labelType: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/labels/:labelId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","description":"","labelId":"","labelType":"","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}}/accounts/:accountId/labels/:labelId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountId": "",\n "description": "",\n "labelId": "",\n "labelType": "",\n "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 \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/labels/:labelId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/labels/:labelId',
headers: {
'content-type': 'application/json'
}
};
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({accountId: '', description: '', labelId: '', labelType: '', name: ''}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounts/:accountId/labels/:labelId',
headers: {'content-type': 'application/json'},
body: {accountId: '', description: '', labelId: '', labelType: '', 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('PATCH', '{{baseUrl}}/accounts/:accountId/labels/:labelId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountId: '',
description: '',
labelId: '',
labelType: '',
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: 'PATCH',
url: '{{baseUrl}}/accounts/:accountId/labels/:labelId',
headers: {'content-type': 'application/json'},
data: {accountId: '', description: '', labelId: '', labelType: '', name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/labels/:labelId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","description":"","labelId":"","labelType":"","name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accountId": @"",
@"description": @"",
@"labelId": @"",
@"labelType": @"",
@"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/labels/:labelId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/accounts/:accountId/labels/:labelId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/labels/:labelId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '',
'description' => '',
'labelId' => '',
'labelType' => '',
'name' => ''
]),
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;
}
request('PATCH', '{{baseUrl}}/accounts/:accountId/labels/:labelId', [
'body' => '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/labels/:labelId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountId' => '',
'description' => '',
'labelId' => '',
'labelType' => '',
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountId' => '',
'description' => '',
'labelId' => '',
'labelType' => '',
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounts/:accountId/labels/:labelId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/labels/:labelId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/labels/:labelId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/accounts/:accountId/labels/:labelId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/labels/:labelId"
payload = {
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/labels/:labelId"
payload <- "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/labels/:labelId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"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.patch('/baseUrl/accounts/:accountId/labels/:labelId') do |req|
req.body = "{\n \"accountId\": \"\",\n \"description\": \"\",\n \"labelId\": \"\",\n \"labelType\": \"\",\n \"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}}/accounts/:accountId/labels/:labelId";
let payload = json!({
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounts/:accountId/labels/:labelId \
--header 'content-type: application/json' \
--data '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}'
echo '{
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
}' | \
http PATCH {{baseUrl}}/accounts/:accountId/labels/:labelId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "accountId": "",\n "description": "",\n "labelId": "",\n "labelType": "",\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/accounts/:accountId/labels/:labelId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountId": "",
"description": "",
"labelId": "",
"labelType": "",
"name": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/labels/:labelId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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
content.accounts.link
{{baseUrl}}/:merchantId/accounts/:accountId/link
QUERY PARAMS
merchantId
accountId
BODY json
{
"action": "",
"eCommercePlatformLinkInfo": {
"externalAccountId": ""
},
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": {
"externalAccountBusinessCountry": "",
"externalAccountId": ""
},
"services": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId/link");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/accounts/:accountId/link" {:content-type :json
:form-params {:action ""
:eCommercePlatformLinkInfo {:externalAccountId ""}
:linkType ""
:linkedAccountId ""
:paymentServiceProviderLinkInfo {:externalAccountBusinessCountry ""
:externalAccountId ""}
:services []}})
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId/link"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\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}}/:merchantId/accounts/:accountId/link"),
Content = new StringContent("{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\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}}/:merchantId/accounts/:accountId/link");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId/link"
payload := strings.NewReader("{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/accounts/:accountId/link HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 258
{
"action": "",
"eCommercePlatformLinkInfo": {
"externalAccountId": ""
},
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": {
"externalAccountBusinessCountry": "",
"externalAccountId": ""
},
"services": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/accounts/:accountId/link")
.setHeader("content-type", "application/json")
.setBody("{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId/link"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\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 \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/link")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/accounts/:accountId/link")
.header("content-type", "application/json")
.body("{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}")
.asString();
const data = JSON.stringify({
action: '',
eCommercePlatformLinkInfo: {
externalAccountId: ''
},
linkType: '',
linkedAccountId: '',
paymentServiceProviderLinkInfo: {
externalAccountBusinessCountry: '',
externalAccountId: ''
},
services: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/link');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/link',
headers: {'content-type': 'application/json'},
data: {
action: '',
eCommercePlatformLinkInfo: {externalAccountId: ''},
linkType: '',
linkedAccountId: '',
paymentServiceProviderLinkInfo: {externalAccountBusinessCountry: '', externalAccountId: ''},
services: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/link';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"action":"","eCommercePlatformLinkInfo":{"externalAccountId":""},"linkType":"","linkedAccountId":"","paymentServiceProviderLinkInfo":{"externalAccountBusinessCountry":"","externalAccountId":""},"services":[]}'
};
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}}/:merchantId/accounts/:accountId/link',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "action": "",\n "eCommercePlatformLinkInfo": {\n "externalAccountId": ""\n },\n "linkType": "",\n "linkedAccountId": "",\n "paymentServiceProviderLinkInfo": {\n "externalAccountBusinessCountry": "",\n "externalAccountId": ""\n },\n "services": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/link")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId/link',
headers: {
'content-type': 'application/json'
}
};
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({
action: '',
eCommercePlatformLinkInfo: {externalAccountId: ''},
linkType: '',
linkedAccountId: '',
paymentServiceProviderLinkInfo: {externalAccountBusinessCountry: '', externalAccountId: ''},
services: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/link',
headers: {'content-type': 'application/json'},
body: {
action: '',
eCommercePlatformLinkInfo: {externalAccountId: ''},
linkType: '',
linkedAccountId: '',
paymentServiceProviderLinkInfo: {externalAccountBusinessCountry: '', externalAccountId: ''},
services: []
},
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}}/:merchantId/accounts/:accountId/link');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
action: '',
eCommercePlatformLinkInfo: {
externalAccountId: ''
},
linkType: '',
linkedAccountId: '',
paymentServiceProviderLinkInfo: {
externalAccountBusinessCountry: '',
externalAccountId: ''
},
services: []
});
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}}/:merchantId/accounts/:accountId/link',
headers: {'content-type': 'application/json'},
data: {
action: '',
eCommercePlatformLinkInfo: {externalAccountId: ''},
linkType: '',
linkedAccountId: '',
paymentServiceProviderLinkInfo: {externalAccountBusinessCountry: '', externalAccountId: ''},
services: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/link';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"action":"","eCommercePlatformLinkInfo":{"externalAccountId":""},"linkType":"","linkedAccountId":"","paymentServiceProviderLinkInfo":{"externalAccountBusinessCountry":"","externalAccountId":""},"services":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"action": @"",
@"eCommercePlatformLinkInfo": @{ @"externalAccountId": @"" },
@"linkType": @"",
@"linkedAccountId": @"",
@"paymentServiceProviderLinkInfo": @{ @"externalAccountBusinessCountry": @"", @"externalAccountId": @"" },
@"services": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId/link"]
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}}/:merchantId/accounts/:accountId/link" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId/link",
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([
'action' => '',
'eCommercePlatformLinkInfo' => [
'externalAccountId' => ''
],
'linkType' => '',
'linkedAccountId' => '',
'paymentServiceProviderLinkInfo' => [
'externalAccountBusinessCountry' => '',
'externalAccountId' => ''
],
'services' => [
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/link', [
'body' => '{
"action": "",
"eCommercePlatformLinkInfo": {
"externalAccountId": ""
},
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": {
"externalAccountBusinessCountry": "",
"externalAccountId": ""
},
"services": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId/link');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'action' => '',
'eCommercePlatformLinkInfo' => [
'externalAccountId' => ''
],
'linkType' => '',
'linkedAccountId' => '',
'paymentServiceProviderLinkInfo' => [
'externalAccountBusinessCountry' => '',
'externalAccountId' => ''
],
'services' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'action' => '',
'eCommercePlatformLinkInfo' => [
'externalAccountId' => ''
],
'linkType' => '',
'linkedAccountId' => '',
'paymentServiceProviderLinkInfo' => [
'externalAccountBusinessCountry' => '',
'externalAccountId' => ''
],
'services' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId/link');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/link' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"action": "",
"eCommercePlatformLinkInfo": {
"externalAccountId": ""
},
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": {
"externalAccountBusinessCountry": "",
"externalAccountId": ""
},
"services": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/link' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"action": "",
"eCommercePlatformLinkInfo": {
"externalAccountId": ""
},
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": {
"externalAccountBusinessCountry": "",
"externalAccountId": ""
},
"services": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/accounts/:accountId/link", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId/link"
payload = {
"action": "",
"eCommercePlatformLinkInfo": { "externalAccountId": "" },
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": {
"externalAccountBusinessCountry": "",
"externalAccountId": ""
},
"services": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId/link"
payload <- "{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId/link")
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 \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\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.post('/baseUrl/:merchantId/accounts/:accountId/link') do |req|
req.body = "{\n \"action\": \"\",\n \"eCommercePlatformLinkInfo\": {\n \"externalAccountId\": \"\"\n },\n \"linkType\": \"\",\n \"linkedAccountId\": \"\",\n \"paymentServiceProviderLinkInfo\": {\n \"externalAccountBusinessCountry\": \"\",\n \"externalAccountId\": \"\"\n },\n \"services\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts/:accountId/link";
let payload = json!({
"action": "",
"eCommercePlatformLinkInfo": json!({"externalAccountId": ""}),
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": json!({
"externalAccountBusinessCountry": "",
"externalAccountId": ""
}),
"services": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/accounts/:accountId/link \
--header 'content-type: application/json' \
--data '{
"action": "",
"eCommercePlatformLinkInfo": {
"externalAccountId": ""
},
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": {
"externalAccountBusinessCountry": "",
"externalAccountId": ""
},
"services": []
}'
echo '{
"action": "",
"eCommercePlatformLinkInfo": {
"externalAccountId": ""
},
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": {
"externalAccountBusinessCountry": "",
"externalAccountId": ""
},
"services": []
}' | \
http POST {{baseUrl}}/:merchantId/accounts/:accountId/link \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "action": "",\n "eCommercePlatformLinkInfo": {\n "externalAccountId": ""\n },\n "linkType": "",\n "linkedAccountId": "",\n "paymentServiceProviderLinkInfo": {\n "externalAccountBusinessCountry": "",\n "externalAccountId": ""\n },\n "services": []\n}' \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId/link
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"action": "",
"eCommercePlatformLinkInfo": ["externalAccountId": ""],
"linkType": "",
"linkedAccountId": "",
"paymentServiceProviderLinkInfo": [
"externalAccountBusinessCountry": "",
"externalAccountId": ""
],
"services": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId/link")! 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()
GET
content.accounts.list
{{baseUrl}}/:merchantId/accounts
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/accounts")
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accounts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accounts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/accounts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/accounts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/accounts")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/accounts');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accounts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts';
const options = {method: 'GET'};
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}}/:merchantId/accounts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accounts'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/accounts');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accounts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/accounts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/accounts');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accounts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/accounts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/accounts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/accounts
http GET {{baseUrl}}/:merchantId/accounts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/accounts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.accounts.listlinks
{{baseUrl}}/:merchantId/accounts/:accountId/listlinks
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks")
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accounts/:accountId/listlinks"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accounts/:accountId/listlinks");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/accounts/:accountId/listlinks HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId/listlinks"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/listlinks")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/accounts/:accountId/listlinks")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks';
const options = {method: 'GET'};
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}}/:merchantId/accounts/:accountId/listlinks',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/listlinks")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId/listlinks',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId/listlinks"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/accounts/:accountId/listlinks" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId/listlinks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId/listlinks');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId/listlinks');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/listlinks' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/accounts/:accountId/listlinks")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId/listlinks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/accounts/:accountId/listlinks') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/accounts/:accountId/listlinks
http GET {{baseUrl}}/:merchantId/accounts/:accountId/listlinks
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId/listlinks
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId/listlinks")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.accounts.requestphoneverification
{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification
QUERY PARAMS
merchantId
accountId
BODY json
{
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification" {:content-type :json
:form-params {:languageCode ""
:phoneNumber ""
:phoneRegionCode ""
:phoneVerificationMethod ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\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}}/:merchantId/accounts/:accountId/requestphoneverification"),
Content = new StringContent("{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\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}}/:merchantId/accounts/:accountId/requestphoneverification");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification"
payload := strings.NewReader("{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/accounts/:accountId/requestphoneverification HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 103
{
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification")
.setHeader("content-type", "application/json")
.setBody("{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\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 \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification")
.header("content-type", "application/json")
.body("{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}")
.asString();
const data = JSON.stringify({
languageCode: '',
phoneNumber: '',
phoneRegionCode: '',
phoneVerificationMethod: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification',
headers: {'content-type': 'application/json'},
data: {
languageCode: '',
phoneNumber: '',
phoneRegionCode: '',
phoneVerificationMethod: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"languageCode":"","phoneNumber":"","phoneRegionCode":"","phoneVerificationMethod":""}'
};
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}}/:merchantId/accounts/:accountId/requestphoneverification',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "languageCode": "",\n "phoneNumber": "",\n "phoneRegionCode": "",\n "phoneVerificationMethod": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId/requestphoneverification',
headers: {
'content-type': 'application/json'
}
};
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({
languageCode: '',
phoneNumber: '',
phoneRegionCode: '',
phoneVerificationMethod: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification',
headers: {'content-type': 'application/json'},
body: {
languageCode: '',
phoneNumber: '',
phoneRegionCode: '',
phoneVerificationMethod: ''
},
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}}/:merchantId/accounts/:accountId/requestphoneverification');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
languageCode: '',
phoneNumber: '',
phoneRegionCode: '',
phoneVerificationMethod: ''
});
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}}/:merchantId/accounts/:accountId/requestphoneverification',
headers: {'content-type': 'application/json'},
data: {
languageCode: '',
phoneNumber: '',
phoneRegionCode: '',
phoneVerificationMethod: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"languageCode":"","phoneNumber":"","phoneRegionCode":"","phoneVerificationMethod":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"languageCode": @"",
@"phoneNumber": @"",
@"phoneRegionCode": @"",
@"phoneVerificationMethod": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification"]
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}}/:merchantId/accounts/:accountId/requestphoneverification" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification",
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([
'languageCode' => '',
'phoneNumber' => '',
'phoneRegionCode' => '',
'phoneVerificationMethod' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification', [
'body' => '{
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'languageCode' => '',
'phoneNumber' => '',
'phoneRegionCode' => '',
'phoneVerificationMethod' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'languageCode' => '',
'phoneNumber' => '',
'phoneRegionCode' => '',
'phoneVerificationMethod' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/accounts/:accountId/requestphoneverification", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification"
payload = {
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification"
payload <- "{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification")
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 \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\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.post('/baseUrl/:merchantId/accounts/:accountId/requestphoneverification') do |req|
req.body = "{\n \"languageCode\": \"\",\n \"phoneNumber\": \"\",\n \"phoneRegionCode\": \"\",\n \"phoneVerificationMethod\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification";
let payload = json!({
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification \
--header 'content-type: application/json' \
--data '{
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
}'
echo '{
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
}' | \
http POST {{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "languageCode": "",\n "phoneNumber": "",\n "phoneRegionCode": "",\n "phoneVerificationMethod": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"languageCode": "",
"phoneNumber": "",
"phoneRegionCode": "",
"phoneVerificationMethod": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId/requestphoneverification")! 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()
POST
content.accounts.returncarrier.create
{{baseUrl}}/accounts/:accountId/returncarrier
QUERY PARAMS
accountId
BODY json
{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/returncarrier");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounts/:accountId/returncarrier" {:content-type :json
:form-params {:carrierAccountId ""
:carrierAccountName ""
:carrierAccountNumber ""
:carrierCode ""}})
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/returncarrier"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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}}/accounts/:accountId/returncarrier"),
Content = new StringContent("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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}}/accounts/:accountId/returncarrier");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/returncarrier"
payload := strings.NewReader("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/accounts/:accountId/returncarrier HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 107
{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounts/:accountId/returncarrier")
.setHeader("content-type", "application/json")
.setBody("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/returncarrier"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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 \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/returncarrier")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounts/:accountId/returncarrier")
.header("content-type", "application/json")
.body("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}")
.asString();
const data = JSON.stringify({
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounts/:accountId/returncarrier');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounts/:accountId/returncarrier',
headers: {'content-type': 'application/json'},
data: {
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/returncarrier';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"carrierAccountId":"","carrierAccountName":"","carrierAccountNumber":"","carrierCode":""}'
};
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}}/accounts/:accountId/returncarrier',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "carrierAccountId": "",\n "carrierAccountName": "",\n "carrierAccountNumber": "",\n "carrierCode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/returncarrier")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/returncarrier',
headers: {
'content-type': 'application/json'
}
};
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({
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounts/:accountId/returncarrier',
headers: {'content-type': 'application/json'},
body: {
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
},
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}}/accounts/:accountId/returncarrier');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
});
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}}/accounts/:accountId/returncarrier',
headers: {'content-type': 'application/json'},
data: {
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/returncarrier';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"carrierAccountId":"","carrierAccountName":"","carrierAccountNumber":"","carrierCode":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"carrierAccountId": @"",
@"carrierAccountName": @"",
@"carrierAccountNumber": @"",
@"carrierCode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/returncarrier"]
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}}/accounts/:accountId/returncarrier" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/returncarrier",
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([
'carrierAccountId' => '',
'carrierAccountName' => '',
'carrierAccountNumber' => '',
'carrierCode' => ''
]),
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;
}
request('POST', '{{baseUrl}}/accounts/:accountId/returncarrier', [
'body' => '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/returncarrier');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'carrierAccountId' => '',
'carrierAccountName' => '',
'carrierAccountNumber' => '',
'carrierCode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'carrierAccountId' => '',
'carrierAccountName' => '',
'carrierAccountNumber' => '',
'carrierCode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounts/:accountId/returncarrier');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/returncarrier' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/returncarrier' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/accounts/:accountId/returncarrier", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/returncarrier"
payload = {
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/returncarrier"
payload <- "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/returncarrier")
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 \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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.post('/baseUrl/accounts/:accountId/returncarrier') do |req|
req.body = "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/:accountId/returncarrier";
let payload = json!({
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounts/:accountId/returncarrier \
--header 'content-type: application/json' \
--data '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}'
echo '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}' | \
http POST {{baseUrl}}/accounts/:accountId/returncarrier \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "carrierAccountId": "",\n "carrierAccountName": "",\n "carrierAccountNumber": "",\n "carrierCode": ""\n}' \
--output-document \
- {{baseUrl}}/accounts/:accountId/returncarrier
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/returncarrier")! 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()
DELETE
content.accounts.returncarrier.delete
{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId
QUERY PARAMS
accountId
carrierAccountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/accounts/:accountId/returncarrier/:carrierAccountId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId';
const options = {method: 'DELETE'};
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}}/accounts/:accountId/returncarrier/:carrierAccountId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/returncarrier/:carrierAccountId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/accounts/:accountId/returncarrier/:carrierAccountId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/accounts/:accountId/returncarrier/:carrierAccountId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/accounts/:accountId/returncarrier/:carrierAccountId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId
http DELETE {{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.accounts.returncarrier.list
{{baseUrl}}/accounts/:accountId/returncarrier
QUERY PARAMS
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/returncarrier");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/accounts/:accountId/returncarrier")
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/returncarrier"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/accounts/:accountId/returncarrier"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/accounts/:accountId/returncarrier");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/returncarrier"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/accounts/:accountId/returncarrier HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/accounts/:accountId/returncarrier")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/returncarrier"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/returncarrier")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/accounts/:accountId/returncarrier")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/accounts/:accountId/returncarrier');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/accounts/:accountId/returncarrier'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/returncarrier';
const options = {method: 'GET'};
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}}/accounts/:accountId/returncarrier',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/returncarrier")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/returncarrier',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/accounts/:accountId/returncarrier'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/accounts/:accountId/returncarrier');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/accounts/:accountId/returncarrier'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/returncarrier';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/returncarrier"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/accounts/:accountId/returncarrier" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/returncarrier",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/accounts/:accountId/returncarrier');
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/returncarrier');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/accounts/:accountId/returncarrier');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/returncarrier' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/returncarrier' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/accounts/:accountId/returncarrier")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/returncarrier"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/returncarrier"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/returncarrier")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/accounts/:accountId/returncarrier') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounts/:accountId/returncarrier";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/accounts/:accountId/returncarrier
http GET {{baseUrl}}/accounts/:accountId/returncarrier
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/accounts/:accountId/returncarrier
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/returncarrier")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PATCH
content.accounts.returncarrier.patch
{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId
QUERY PARAMS
accountId
carrierAccountId
BODY json
{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId" {:content-type :json
:form-params {:carrierAccountId ""
:carrierAccountName ""
:carrierAccountNumber ""
:carrierCode ""}})
require "http/client"
url = "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"),
Content = new StringContent("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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}}/accounts/:accountId/returncarrier/:carrierAccountId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"
payload := strings.NewReader("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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(res)
fmt.Println(string(body))
}
PATCH /baseUrl/accounts/:accountId/returncarrier/:carrierAccountId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 107
{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
.setHeader("content-type", "application/json")
.setBody("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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 \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
.header("content-type", "application/json")
.body("{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}")
.asString();
const data = JSON.stringify({
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId',
headers: {'content-type': 'application/json'},
data: {
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"carrierAccountId":"","carrierAccountName":"","carrierAccountNumber":"","carrierCode":""}'
};
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}}/accounts/:accountId/returncarrier/:carrierAccountId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "carrierAccountId": "",\n "carrierAccountName": "",\n "carrierAccountNumber": "",\n "carrierCode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounts/:accountId/returncarrier/:carrierAccountId',
headers: {
'content-type': 'application/json'
}
};
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({
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId',
headers: {'content-type': 'application/json'},
body: {
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId',
headers: {'content-type': 'application/json'},
data: {
carrierAccountId: '',
carrierAccountName: '',
carrierAccountNumber: '',
carrierCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"carrierAccountId":"","carrierAccountName":"","carrierAccountNumber":"","carrierCode":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"carrierAccountId": @"",
@"carrierAccountName": @"",
@"carrierAccountNumber": @"",
@"carrierCode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/accounts/:accountId/returncarrier/:carrierAccountId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'carrierAccountId' => '',
'carrierAccountName' => '',
'carrierAccountNumber' => '',
'carrierCode' => ''
]),
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;
}
request('PATCH', '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId', [
'body' => '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'carrierAccountId' => '',
'carrierAccountName' => '',
'carrierAccountNumber' => '',
'carrierCode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'carrierAccountId' => '',
'carrierAccountName' => '',
'carrierAccountNumber' => '',
'carrierCode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/accounts/:accountId/returncarrier/:carrierAccountId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"
payload = {
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId"
payload <- "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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.patch('/baseUrl/accounts/:accountId/returncarrier/:carrierAccountId') do |req|
req.body = "{\n \"carrierAccountId\": \"\",\n \"carrierAccountName\": \"\",\n \"carrierAccountNumber\": \"\",\n \"carrierCode\": \"\"\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}}/accounts/:accountId/returncarrier/:carrierAccountId";
let payload = json!({
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId \
--header 'content-type: application/json' \
--data '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}'
echo '{
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
}' | \
http PATCH {{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "carrierAccountId": "",\n "carrierAccountName": "",\n "carrierAccountNumber": "",\n "carrierCode": ""\n}' \
--output-document \
- {{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"carrierAccountId": "",
"carrierAccountName": "",
"carrierAccountNumber": "",
"carrierCode": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounts/:accountId/returncarrier/:carrierAccountId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
PUT
content.accounts.update
{{baseUrl}}/:merchantId/accounts/:accountId
QUERY PARAMS
merchantId
accountId
BODY json
{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/:merchantId/accounts/:accountId" {:content-type :json
:form-params {:accountManagement ""
:adsLinks [{:adsId ""
:status ""}]
:adultContent false
:automaticImprovements {:imageImprovements {:accountImageImprovementsSettings {:allowAutomaticImageImprovements false}
:effectiveAllowAutomaticImageImprovements false}
:itemUpdates {:accountItemUpdatesSettings {:allowAvailabilityUpdates false
:allowConditionUpdates false
:allowPriceUpdates false
:allowStrictAvailabilityUpdates false}
:effectiveAllowAvailabilityUpdates false
:effectiveAllowConditionUpdates false
:effectiveAllowPriceUpdates false
:effectiveAllowStrictAvailabilityUpdates false}
:shippingImprovements {:allowShippingImprovements false}}
:automaticLabelIds []
:businessInformation {:address {:country ""
:locality ""
:postalCode ""
:region ""
:streetAddress ""}
:customerService {:email ""
:phoneNumber ""
:url ""}
:koreanBusinessRegistrationNumber ""
:phoneNumber ""
:phoneVerificationStatus ""}
:conversionSettings {:freeListingsAutoTaggingEnabled false}
:cssId ""
:googleMyBusinessLink {:gmbAccountId ""
:gmbEmail ""
:status ""}
:id ""
:kind ""
:labelIds []
:name ""
:sellerId ""
:users [{:admin false
:emailAddress ""
:orderManager false
:paymentsAnalyst false
:paymentsManager false
:reportingManager false}]
:websiteUrl ""
:youtubeChannelLinks [{:channelId ""
:status ""}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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}}/:merchantId/accounts/:accountId"),
Content = new StringContent("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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}}/:merchantId/accounts/:accountId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId"
payload := strings.NewReader("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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(res)
fmt.Println(string(body))
}
PUT /baseUrl/:merchantId/accounts/:accountId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1823
{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/:merchantId/accounts/:accountId")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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 \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/:merchantId/accounts/:accountId")
.header("content-type", "application/json")
.body("{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
accountManagement: '',
adsLinks: [
{
adsId: '',
status: ''
}
],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {
allowAutomaticImageImprovements: false
},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {
allowShippingImprovements: false
}
},
automaticLabelIds: [],
businessInformation: {
address: {
country: '',
locality: '',
postalCode: '',
region: '',
streetAddress: ''
},
customerService: {
email: '',
phoneNumber: '',
url: ''
},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {
freeListingsAutoTaggingEnabled: false
},
cssId: '',
googleMyBusinessLink: {
gmbAccountId: '',
gmbEmail: '',
status: ''
},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [
{
channelId: '',
status: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/:merchantId/accounts/:accountId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/accounts/:accountId',
headers: {'content-type': 'application/json'},
data: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accountManagement":"","adsLinks":[{"adsId":"","status":""}],"adultContent":false,"automaticImprovements":{"imageImprovements":{"accountImageImprovementsSettings":{"allowAutomaticImageImprovements":false},"effectiveAllowAutomaticImageImprovements":false},"itemUpdates":{"accountItemUpdatesSettings":{"allowAvailabilityUpdates":false,"allowConditionUpdates":false,"allowPriceUpdates":false,"allowStrictAvailabilityUpdates":false},"effectiveAllowAvailabilityUpdates":false,"effectiveAllowConditionUpdates":false,"effectiveAllowPriceUpdates":false,"effectiveAllowStrictAvailabilityUpdates":false},"shippingImprovements":{"allowShippingImprovements":false}},"automaticLabelIds":[],"businessInformation":{"address":{"country":"","locality":"","postalCode":"","region":"","streetAddress":""},"customerService":{"email":"","phoneNumber":"","url":""},"koreanBusinessRegistrationNumber":"","phoneNumber":"","phoneVerificationStatus":""},"conversionSettings":{"freeListingsAutoTaggingEnabled":false},"cssId":"","googleMyBusinessLink":{"gmbAccountId":"","gmbEmail":"","status":""},"id":"","kind":"","labelIds":[],"name":"","sellerId":"","users":[{"admin":false,"emailAddress":"","orderManager":false,"paymentsAnalyst":false,"paymentsManager":false,"reportingManager":false}],"websiteUrl":"","youtubeChannelLinks":[{"channelId":"","status":""}]}'
};
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}}/:merchantId/accounts/:accountId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountManagement": "",\n "adsLinks": [\n {\n "adsId": "",\n "status": ""\n }\n ],\n "adultContent": false,\n "automaticImprovements": {\n "imageImprovements": {\n "accountImageImprovementsSettings": {\n "allowAutomaticImageImprovements": false\n },\n "effectiveAllowAutomaticImageImprovements": false\n },\n "itemUpdates": {\n "accountItemUpdatesSettings": {\n "allowAvailabilityUpdates": false,\n "allowConditionUpdates": false,\n "allowPriceUpdates": false,\n "allowStrictAvailabilityUpdates": false\n },\n "effectiveAllowAvailabilityUpdates": false,\n "effectiveAllowConditionUpdates": false,\n "effectiveAllowPriceUpdates": false,\n "effectiveAllowStrictAvailabilityUpdates": false\n },\n "shippingImprovements": {\n "allowShippingImprovements": false\n }\n },\n "automaticLabelIds": [],\n "businessInformation": {\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "region": "",\n "streetAddress": ""\n },\n "customerService": {\n "email": "",\n "phoneNumber": "",\n "url": ""\n },\n "koreanBusinessRegistrationNumber": "",\n "phoneNumber": "",\n "phoneVerificationStatus": ""\n },\n "conversionSettings": {\n "freeListingsAutoTaggingEnabled": false\n },\n "cssId": "",\n "googleMyBusinessLink": {\n "gmbAccountId": "",\n "gmbEmail": "",\n "status": ""\n },\n "id": "",\n "kind": "",\n "labelIds": [],\n "name": "",\n "sellerId": "",\n "users": [\n {\n "admin": false,\n "emailAddress": "",\n "orderManager": false,\n "paymentsAnalyst": false,\n "paymentsManager": false,\n "reportingManager": false\n }\n ],\n "websiteUrl": "",\n "youtubeChannelLinks": [\n {\n "channelId": "",\n "status": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId',
headers: {
'content-type': 'application/json'
}
};
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({
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/accounts/:accountId',
headers: {'content-type': 'application/json'},
body: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
},
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}}/:merchantId/accounts/:accountId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountManagement: '',
adsLinks: [
{
adsId: '',
status: ''
}
],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {
allowAutomaticImageImprovements: false
},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {
allowShippingImprovements: false
}
},
automaticLabelIds: [],
businessInformation: {
address: {
country: '',
locality: '',
postalCode: '',
region: '',
streetAddress: ''
},
customerService: {
email: '',
phoneNumber: '',
url: ''
},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {
freeListingsAutoTaggingEnabled: false
},
cssId: '',
googleMyBusinessLink: {
gmbAccountId: '',
gmbEmail: '',
status: ''
},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [
{
channelId: '',
status: ''
}
]
});
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}}/:merchantId/accounts/:accountId',
headers: {'content-type': 'application/json'},
data: {
accountManagement: '',
adsLinks: [{adsId: '', status: ''}],
adultContent: false,
automaticImprovements: {
imageImprovements: {
accountImageImprovementsSettings: {allowAutomaticImageImprovements: false},
effectiveAllowAutomaticImageImprovements: false
},
itemUpdates: {
accountItemUpdatesSettings: {
allowAvailabilityUpdates: false,
allowConditionUpdates: false,
allowPriceUpdates: false,
allowStrictAvailabilityUpdates: false
},
effectiveAllowAvailabilityUpdates: false,
effectiveAllowConditionUpdates: false,
effectiveAllowPriceUpdates: false,
effectiveAllowStrictAvailabilityUpdates: false
},
shippingImprovements: {allowShippingImprovements: false}
},
automaticLabelIds: [],
businessInformation: {
address: {country: '', locality: '', postalCode: '', region: '', streetAddress: ''},
customerService: {email: '', phoneNumber: '', url: ''},
koreanBusinessRegistrationNumber: '',
phoneNumber: '',
phoneVerificationStatus: ''
},
conversionSettings: {freeListingsAutoTaggingEnabled: false},
cssId: '',
googleMyBusinessLink: {gmbAccountId: '', gmbEmail: '', status: ''},
id: '',
kind: '',
labelIds: [],
name: '',
sellerId: '',
users: [
{
admin: false,
emailAddress: '',
orderManager: false,
paymentsAnalyst: false,
paymentsManager: false,
reportingManager: false
}
],
websiteUrl: '',
youtubeChannelLinks: [{channelId: '', status: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accountManagement":"","adsLinks":[{"adsId":"","status":""}],"adultContent":false,"automaticImprovements":{"imageImprovements":{"accountImageImprovementsSettings":{"allowAutomaticImageImprovements":false},"effectiveAllowAutomaticImageImprovements":false},"itemUpdates":{"accountItemUpdatesSettings":{"allowAvailabilityUpdates":false,"allowConditionUpdates":false,"allowPriceUpdates":false,"allowStrictAvailabilityUpdates":false},"effectiveAllowAvailabilityUpdates":false,"effectiveAllowConditionUpdates":false,"effectiveAllowPriceUpdates":false,"effectiveAllowStrictAvailabilityUpdates":false},"shippingImprovements":{"allowShippingImprovements":false}},"automaticLabelIds":[],"businessInformation":{"address":{"country":"","locality":"","postalCode":"","region":"","streetAddress":""},"customerService":{"email":"","phoneNumber":"","url":""},"koreanBusinessRegistrationNumber":"","phoneNumber":"","phoneVerificationStatus":""},"conversionSettings":{"freeListingsAutoTaggingEnabled":false},"cssId":"","googleMyBusinessLink":{"gmbAccountId":"","gmbEmail":"","status":""},"id":"","kind":"","labelIds":[],"name":"","sellerId":"","users":[{"admin":false,"emailAddress":"","orderManager":false,"paymentsAnalyst":false,"paymentsManager":false,"reportingManager":false}],"websiteUrl":"","youtubeChannelLinks":[{"channelId":"","status":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accountManagement": @"",
@"adsLinks": @[ @{ @"adsId": @"", @"status": @"" } ],
@"adultContent": @NO,
@"automaticImprovements": @{ @"imageImprovements": @{ @"accountImageImprovementsSettings": @{ @"allowAutomaticImageImprovements": @NO }, @"effectiveAllowAutomaticImageImprovements": @NO }, @"itemUpdates": @{ @"accountItemUpdatesSettings": @{ @"allowAvailabilityUpdates": @NO, @"allowConditionUpdates": @NO, @"allowPriceUpdates": @NO, @"allowStrictAvailabilityUpdates": @NO }, @"effectiveAllowAvailabilityUpdates": @NO, @"effectiveAllowConditionUpdates": @NO, @"effectiveAllowPriceUpdates": @NO, @"effectiveAllowStrictAvailabilityUpdates": @NO }, @"shippingImprovements": @{ @"allowShippingImprovements": @NO } },
@"automaticLabelIds": @[ ],
@"businessInformation": @{ @"address": @{ @"country": @"", @"locality": @"", @"postalCode": @"", @"region": @"", @"streetAddress": @"" }, @"customerService": @{ @"email": @"", @"phoneNumber": @"", @"url": @"" }, @"koreanBusinessRegistrationNumber": @"", @"phoneNumber": @"", @"phoneVerificationStatus": @"" },
@"conversionSettings": @{ @"freeListingsAutoTaggingEnabled": @NO },
@"cssId": @"",
@"googleMyBusinessLink": @{ @"gmbAccountId": @"", @"gmbEmail": @"", @"status": @"" },
@"id": @"",
@"kind": @"",
@"labelIds": @[ ],
@"name": @"",
@"sellerId": @"",
@"users": @[ @{ @"admin": @NO, @"emailAddress": @"", @"orderManager": @NO, @"paymentsAnalyst": @NO, @"paymentsManager": @NO, @"reportingManager": @NO } ],
@"websiteUrl": @"",
@"youtubeChannelLinks": @[ @{ @"channelId": @"", @"status": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId"]
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}}/:merchantId/accounts/:accountId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId",
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([
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
]),
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;
}
request('PUT', '{{baseUrl}}/:merchantId/accounts/:accountId', [
'body' => '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountManagement' => '',
'adsLinks' => [
[
'adsId' => '',
'status' => ''
]
],
'adultContent' => null,
'automaticImprovements' => [
'imageImprovements' => [
'accountImageImprovementsSettings' => [
'allowAutomaticImageImprovements' => null
],
'effectiveAllowAutomaticImageImprovements' => null
],
'itemUpdates' => [
'accountItemUpdatesSettings' => [
'allowAvailabilityUpdates' => null,
'allowConditionUpdates' => null,
'allowPriceUpdates' => null,
'allowStrictAvailabilityUpdates' => null
],
'effectiveAllowAvailabilityUpdates' => null,
'effectiveAllowConditionUpdates' => null,
'effectiveAllowPriceUpdates' => null,
'effectiveAllowStrictAvailabilityUpdates' => null
],
'shippingImprovements' => [
'allowShippingImprovements' => null
]
],
'automaticLabelIds' => [
],
'businessInformation' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'region' => '',
'streetAddress' => ''
],
'customerService' => [
'email' => '',
'phoneNumber' => '',
'url' => ''
],
'koreanBusinessRegistrationNumber' => '',
'phoneNumber' => '',
'phoneVerificationStatus' => ''
],
'conversionSettings' => [
'freeListingsAutoTaggingEnabled' => null
],
'cssId' => '',
'googleMyBusinessLink' => [
'gmbAccountId' => '',
'gmbEmail' => '',
'status' => ''
],
'id' => '',
'kind' => '',
'labelIds' => [
],
'name' => '',
'sellerId' => '',
'users' => [
[
'admin' => null,
'emailAddress' => '',
'orderManager' => null,
'paymentsAnalyst' => null,
'paymentsManager' => null,
'reportingManager' => null
]
],
'websiteUrl' => '',
'youtubeChannelLinks' => [
[
'channelId' => '',
'status' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/:merchantId/accounts/:accountId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId"
payload = {
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": False,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": { "allowAutomaticImageImprovements": False },
"effectiveAllowAutomaticImageImprovements": False
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": False,
"allowConditionUpdates": False,
"allowPriceUpdates": False,
"allowStrictAvailabilityUpdates": False
},
"effectiveAllowAvailabilityUpdates": False,
"effectiveAllowConditionUpdates": False,
"effectiveAllowPriceUpdates": False,
"effectiveAllowStrictAvailabilityUpdates": False
},
"shippingImprovements": { "allowShippingImprovements": False }
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": { "freeListingsAutoTaggingEnabled": False },
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": False,
"emailAddress": "",
"orderManager": False,
"paymentsAnalyst": False,
"paymentsManager": False,
"reportingManager": False
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId"
payload <- "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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/:merchantId/accounts/:accountId') do |req|
req.body = "{\n \"accountManagement\": \"\",\n \"adsLinks\": [\n {\n \"adsId\": \"\",\n \"status\": \"\"\n }\n ],\n \"adultContent\": false,\n \"automaticImprovements\": {\n \"imageImprovements\": {\n \"accountImageImprovementsSettings\": {\n \"allowAutomaticImageImprovements\": false\n },\n \"effectiveAllowAutomaticImageImprovements\": false\n },\n \"itemUpdates\": {\n \"accountItemUpdatesSettings\": {\n \"allowAvailabilityUpdates\": false,\n \"allowConditionUpdates\": false,\n \"allowPriceUpdates\": false,\n \"allowStrictAvailabilityUpdates\": false\n },\n \"effectiveAllowAvailabilityUpdates\": false,\n \"effectiveAllowConditionUpdates\": false,\n \"effectiveAllowPriceUpdates\": false,\n \"effectiveAllowStrictAvailabilityUpdates\": false\n },\n \"shippingImprovements\": {\n \"allowShippingImprovements\": false\n }\n },\n \"automaticLabelIds\": [],\n \"businessInformation\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"region\": \"\",\n \"streetAddress\": \"\"\n },\n \"customerService\": {\n \"email\": \"\",\n \"phoneNumber\": \"\",\n \"url\": \"\"\n },\n \"koreanBusinessRegistrationNumber\": \"\",\n \"phoneNumber\": \"\",\n \"phoneVerificationStatus\": \"\"\n },\n \"conversionSettings\": {\n \"freeListingsAutoTaggingEnabled\": false\n },\n \"cssId\": \"\",\n \"googleMyBusinessLink\": {\n \"gmbAccountId\": \"\",\n \"gmbEmail\": \"\",\n \"status\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labelIds\": [],\n \"name\": \"\",\n \"sellerId\": \"\",\n \"users\": [\n {\n \"admin\": false,\n \"emailAddress\": \"\",\n \"orderManager\": false,\n \"paymentsAnalyst\": false,\n \"paymentsManager\": false,\n \"reportingManager\": false\n }\n ],\n \"websiteUrl\": \"\",\n \"youtubeChannelLinks\": [\n {\n \"channelId\": \"\",\n \"status\": \"\"\n }\n ]\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}}/:merchantId/accounts/:accountId";
let payload = json!({
"accountManagement": "",
"adsLinks": (
json!({
"adsId": "",
"status": ""
})
),
"adultContent": false,
"automaticImprovements": json!({
"imageImprovements": json!({
"accountImageImprovementsSettings": json!({"allowAutomaticImageImprovements": false}),
"effectiveAllowAutomaticImageImprovements": false
}),
"itemUpdates": json!({
"accountItemUpdatesSettings": json!({
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
}),
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
}),
"shippingImprovements": json!({"allowShippingImprovements": false})
}),
"automaticLabelIds": (),
"businessInformation": json!({
"address": json!({
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
}),
"customerService": json!({
"email": "",
"phoneNumber": "",
"url": ""
}),
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
}),
"conversionSettings": json!({"freeListingsAutoTaggingEnabled": false}),
"cssId": "",
"googleMyBusinessLink": json!({
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
}),
"id": "",
"kind": "",
"labelIds": (),
"name": "",
"sellerId": "",
"users": (
json!({
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
})
),
"websiteUrl": "",
"youtubeChannelLinks": (
json!({
"channelId": "",
"status": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".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}}/:merchantId/accounts/:accountId \
--header 'content-type: application/json' \
--data '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}'
echo '{
"accountManagement": "",
"adsLinks": [
{
"adsId": "",
"status": ""
}
],
"adultContent": false,
"automaticImprovements": {
"imageImprovements": {
"accountImageImprovementsSettings": {
"allowAutomaticImageImprovements": false
},
"effectiveAllowAutomaticImageImprovements": false
},
"itemUpdates": {
"accountItemUpdatesSettings": {
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
},
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
},
"shippingImprovements": {
"allowShippingImprovements": false
}
},
"automaticLabelIds": [],
"businessInformation": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
},
"customerService": {
"email": "",
"phoneNumber": "",
"url": ""
},
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
},
"conversionSettings": {
"freeListingsAutoTaggingEnabled": false
},
"cssId": "",
"googleMyBusinessLink": {
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
},
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
{
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
}
],
"websiteUrl": "",
"youtubeChannelLinks": [
{
"channelId": "",
"status": ""
}
]
}' | \
http PUT {{baseUrl}}/:merchantId/accounts/:accountId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "accountManagement": "",\n "adsLinks": [\n {\n "adsId": "",\n "status": ""\n }\n ],\n "adultContent": false,\n "automaticImprovements": {\n "imageImprovements": {\n "accountImageImprovementsSettings": {\n "allowAutomaticImageImprovements": false\n },\n "effectiveAllowAutomaticImageImprovements": false\n },\n "itemUpdates": {\n "accountItemUpdatesSettings": {\n "allowAvailabilityUpdates": false,\n "allowConditionUpdates": false,\n "allowPriceUpdates": false,\n "allowStrictAvailabilityUpdates": false\n },\n "effectiveAllowAvailabilityUpdates": false,\n "effectiveAllowConditionUpdates": false,\n "effectiveAllowPriceUpdates": false,\n "effectiveAllowStrictAvailabilityUpdates": false\n },\n "shippingImprovements": {\n "allowShippingImprovements": false\n }\n },\n "automaticLabelIds": [],\n "businessInformation": {\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "region": "",\n "streetAddress": ""\n },\n "customerService": {\n "email": "",\n "phoneNumber": "",\n "url": ""\n },\n "koreanBusinessRegistrationNumber": "",\n "phoneNumber": "",\n "phoneVerificationStatus": ""\n },\n "conversionSettings": {\n "freeListingsAutoTaggingEnabled": false\n },\n "cssId": "",\n "googleMyBusinessLink": {\n "gmbAccountId": "",\n "gmbEmail": "",\n "status": ""\n },\n "id": "",\n "kind": "",\n "labelIds": [],\n "name": "",\n "sellerId": "",\n "users": [\n {\n "admin": false,\n "emailAddress": "",\n "orderManager": false,\n "paymentsAnalyst": false,\n "paymentsManager": false,\n "reportingManager": false\n }\n ],\n "websiteUrl": "",\n "youtubeChannelLinks": [\n {\n "channelId": "",\n "status": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountManagement": "",
"adsLinks": [
[
"adsId": "",
"status": ""
]
],
"adultContent": false,
"automaticImprovements": [
"imageImprovements": [
"accountImageImprovementsSettings": ["allowAutomaticImageImprovements": false],
"effectiveAllowAutomaticImageImprovements": false
],
"itemUpdates": [
"accountItemUpdatesSettings": [
"allowAvailabilityUpdates": false,
"allowConditionUpdates": false,
"allowPriceUpdates": false,
"allowStrictAvailabilityUpdates": false
],
"effectiveAllowAvailabilityUpdates": false,
"effectiveAllowConditionUpdates": false,
"effectiveAllowPriceUpdates": false,
"effectiveAllowStrictAvailabilityUpdates": false
],
"shippingImprovements": ["allowShippingImprovements": false]
],
"automaticLabelIds": [],
"businessInformation": [
"address": [
"country": "",
"locality": "",
"postalCode": "",
"region": "",
"streetAddress": ""
],
"customerService": [
"email": "",
"phoneNumber": "",
"url": ""
],
"koreanBusinessRegistrationNumber": "",
"phoneNumber": "",
"phoneVerificationStatus": ""
],
"conversionSettings": ["freeListingsAutoTaggingEnabled": false],
"cssId": "",
"googleMyBusinessLink": [
"gmbAccountId": "",
"gmbEmail": "",
"status": ""
],
"id": "",
"kind": "",
"labelIds": [],
"name": "",
"sellerId": "",
"users": [
[
"admin": false,
"emailAddress": "",
"orderManager": false,
"paymentsAnalyst": false,
"paymentsManager": false,
"reportingManager": false
]
],
"websiteUrl": "",
"youtubeChannelLinks": [
[
"channelId": "",
"status": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId")! 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
content.accounts.updatelabels
{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels
QUERY PARAMS
merchantId
accountId
BODY json
{
"labelIds": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"labelIds\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels" {:content-type :json
:form-params {:labelIds []}})
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"labelIds\": []\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}}/:merchantId/accounts/:accountId/updatelabels"),
Content = new StringContent("{\n \"labelIds\": []\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}}/:merchantId/accounts/:accountId/updatelabels");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"labelIds\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels"
payload := strings.NewReader("{\n \"labelIds\": []\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/accounts/:accountId/updatelabels HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"labelIds": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels")
.setHeader("content-type", "application/json")
.setBody("{\n \"labelIds\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"labelIds\": []\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 \"labelIds\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels")
.header("content-type", "application/json")
.body("{\n \"labelIds\": []\n}")
.asString();
const data = JSON.stringify({
labelIds: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels',
headers: {'content-type': 'application/json'},
data: {labelIds: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"labelIds":[]}'
};
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}}/:merchantId/accounts/:accountId/updatelabels',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "labelIds": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"labelIds\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId/updatelabels',
headers: {
'content-type': 'application/json'
}
};
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({labelIds: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels',
headers: {'content-type': 'application/json'},
body: {labelIds: []},
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}}/:merchantId/accounts/:accountId/updatelabels');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
labelIds: []
});
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}}/:merchantId/accounts/:accountId/updatelabels',
headers: {'content-type': 'application/json'},
data: {labelIds: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"labelIds":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"labelIds": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels"]
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}}/:merchantId/accounts/:accountId/updatelabels" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"labelIds\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels",
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([
'labelIds' => [
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels', [
'body' => '{
"labelIds": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'labelIds' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'labelIds' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"labelIds": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"labelIds": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"labelIds\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/accounts/:accountId/updatelabels", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels"
payload = { "labelIds": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels"
payload <- "{\n \"labelIds\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels")
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 \"labelIds\": []\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.post('/baseUrl/:merchantId/accounts/:accountId/updatelabels') do |req|
req.body = "{\n \"labelIds\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels";
let payload = json!({"labelIds": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/accounts/:accountId/updatelabels \
--header 'content-type: application/json' \
--data '{
"labelIds": []
}'
echo '{
"labelIds": []
}' | \
http POST {{baseUrl}}/:merchantId/accounts/:accountId/updatelabels \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "labelIds": []\n}' \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId/updatelabels
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["labelIds": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId/updatelabels")! 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()
POST
content.accounts.verifyphonenumber
{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber
QUERY PARAMS
merchantId
accountId
BODY json
{
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber" {:content-type :json
:form-params {:phoneVerificationMethod ""
:verificationCode ""
:verificationId ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\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}}/:merchantId/accounts/:accountId/verifyphonenumber"),
Content = new StringContent("{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\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}}/:merchantId/accounts/:accountId/verifyphonenumber");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber"
payload := strings.NewReader("{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/accounts/:accountId/verifyphonenumber HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 85
{
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber")
.setHeader("content-type", "application/json")
.setBody("{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\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 \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber")
.header("content-type", "application/json")
.body("{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
phoneVerificationMethod: '',
verificationCode: '',
verificationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber',
headers: {'content-type': 'application/json'},
data: {phoneVerificationMethod: '', verificationCode: '', verificationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"phoneVerificationMethod":"","verificationCode":"","verificationId":""}'
};
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}}/:merchantId/accounts/:accountId/verifyphonenumber',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "phoneVerificationMethod": "",\n "verificationCode": "",\n "verificationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounts/:accountId/verifyphonenumber',
headers: {
'content-type': 'application/json'
}
};
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({phoneVerificationMethod: '', verificationCode: '', verificationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber',
headers: {'content-type': 'application/json'},
body: {phoneVerificationMethod: '', verificationCode: '', verificationId: ''},
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}}/:merchantId/accounts/:accountId/verifyphonenumber');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
phoneVerificationMethod: '',
verificationCode: '',
verificationId: ''
});
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}}/:merchantId/accounts/:accountId/verifyphonenumber',
headers: {'content-type': 'application/json'},
data: {phoneVerificationMethod: '', verificationCode: '', verificationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"phoneVerificationMethod":"","verificationCode":"","verificationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"phoneVerificationMethod": @"",
@"verificationCode": @"",
@"verificationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber"]
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}}/:merchantId/accounts/:accountId/verifyphonenumber" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber",
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([
'phoneVerificationMethod' => '',
'verificationCode' => '',
'verificationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber', [
'body' => '{
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'phoneVerificationMethod' => '',
'verificationCode' => '',
'verificationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'phoneVerificationMethod' => '',
'verificationCode' => '',
'verificationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/accounts/:accountId/verifyphonenumber", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber"
payload = {
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber"
payload <- "{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber")
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 \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\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.post('/baseUrl/:merchantId/accounts/:accountId/verifyphonenumber') do |req|
req.body = "{\n \"phoneVerificationMethod\": \"\",\n \"verificationCode\": \"\",\n \"verificationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber";
let payload = json!({
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber \
--header 'content-type: application/json' \
--data '{
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
}'
echo '{
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
}' | \
http POST {{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "phoneVerificationMethod": "",\n "verificationCode": "",\n "verificationId": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"phoneVerificationMethod": "",
"verificationCode": "",
"verificationId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounts/:accountId/verifyphonenumber")! 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()
POST
content.accountstatuses.custombatch
{{baseUrl}}/accountstatuses/batch
BODY json
{
"entries": [
{
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accountstatuses/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accountstatuses/batch" {:content-type :json
:form-params {:entries [{:accountId ""
:batchId 0
:destinations []
:merchantId ""
:method ""}]}})
require "http/client"
url = "{{baseUrl}}/accountstatuses/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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}}/accountstatuses/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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}}/accountstatuses/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accountstatuses/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/accountstatuses/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 146
{
"entries": [
{
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accountstatuses/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accountstatuses/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accountstatuses/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accountstatuses/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
accountId: '',
batchId: 0,
destinations: [],
merchantId: '',
method: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accountstatuses/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accountstatuses/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [{accountId: '', batchId: 0, destinations: [], merchantId: '', method: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accountstatuses/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"accountId":"","batchId":0,"destinations":[],"merchantId":"","method":""}]}'
};
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}}/accountstatuses/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "accountId": "",\n "batchId": 0,\n "destinations": [],\n "merchantId": "",\n "method": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accountstatuses/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accountstatuses/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [{accountId: '', batchId: 0, destinations: [], merchantId: '', method: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accountstatuses/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [{accountId: '', batchId: 0, destinations: [], merchantId: '', method: ''}]
},
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}}/accountstatuses/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
accountId: '',
batchId: 0,
destinations: [],
merchantId: '',
method: ''
}
]
});
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}}/accountstatuses/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [{accountId: '', batchId: 0, destinations: [], merchantId: '', method: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accountstatuses/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"accountId":"","batchId":0,"destinations":[],"merchantId":"","method":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"accountId": @"", @"batchId": @0, @"destinations": @[ ], @"merchantId": @"", @"method": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accountstatuses/batch"]
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}}/accountstatuses/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accountstatuses/batch",
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([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'destinations' => [
],
'merchantId' => '',
'method' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/accountstatuses/batch', [
'body' => '{
"entries": [
{
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accountstatuses/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'destinations' => [
],
'merchantId' => '',
'method' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'destinations' => [
],
'merchantId' => '',
'method' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/accountstatuses/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accountstatuses/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accountstatuses/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/accountstatuses/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accountstatuses/batch"
payload = { "entries": [
{
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accountstatuses/batch"
payload <- "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accountstatuses/batch")
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 \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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.post('/baseUrl/accountstatuses/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"destinations\": [],\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accountstatuses/batch";
let payload = json!({"entries": (
json!({
"accountId": "",
"batchId": 0,
"destinations": (),
"merchantId": "",
"method": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accountstatuses/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
}
]
}'
echo '{
"entries": [
{
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
}
]
}' | \
http POST {{baseUrl}}/accountstatuses/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "accountId": "",\n "batchId": 0,\n "destinations": [],\n "merchantId": "",\n "method": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/accountstatuses/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"accountId": "",
"batchId": 0,
"destinations": [],
"merchantId": "",
"method": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accountstatuses/batch")! 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()
GET
content.accountstatuses.get
{{baseUrl}}/:merchantId/accountstatuses/:accountId
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accountstatuses/:accountId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/accountstatuses/:accountId")
require "http/client"
url = "{{baseUrl}}/:merchantId/accountstatuses/:accountId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accountstatuses/:accountId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accountstatuses/:accountId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accountstatuses/:accountId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/accountstatuses/:accountId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/accountstatuses/:accountId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accountstatuses/:accountId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accountstatuses/:accountId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/accountstatuses/:accountId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/accountstatuses/:accountId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accountstatuses/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accountstatuses/:accountId';
const options = {method: 'GET'};
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}}/:merchantId/accountstatuses/:accountId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accountstatuses/:accountId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accountstatuses/:accountId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accountstatuses/:accountId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/accountstatuses/:accountId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accountstatuses/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accountstatuses/:accountId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accountstatuses/:accountId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/accountstatuses/:accountId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accountstatuses/:accountId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/accountstatuses/:accountId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accountstatuses/:accountId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accountstatuses/:accountId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accountstatuses/:accountId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accountstatuses/:accountId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/accountstatuses/:accountId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accountstatuses/:accountId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accountstatuses/:accountId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accountstatuses/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/accountstatuses/:accountId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accountstatuses/:accountId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/accountstatuses/:accountId
http GET {{baseUrl}}/:merchantId/accountstatuses/:accountId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/accountstatuses/:accountId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accountstatuses/:accountId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.accountstatuses.list
{{baseUrl}}/:merchantId/accountstatuses
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accountstatuses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/accountstatuses")
require "http/client"
url = "{{baseUrl}}/:merchantId/accountstatuses"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accountstatuses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accountstatuses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accountstatuses"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/accountstatuses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/accountstatuses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accountstatuses"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accountstatuses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/accountstatuses")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/accountstatuses');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accountstatuses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accountstatuses';
const options = {method: 'GET'};
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}}/:merchantId/accountstatuses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accountstatuses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accountstatuses',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accountstatuses'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/accountstatuses');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accountstatuses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accountstatuses';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accountstatuses"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/accountstatuses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accountstatuses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/accountstatuses');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accountstatuses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accountstatuses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accountstatuses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accountstatuses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/accountstatuses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accountstatuses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accountstatuses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accountstatuses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/accountstatuses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accountstatuses";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/accountstatuses
http GET {{baseUrl}}/:merchantId/accountstatuses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/accountstatuses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accountstatuses")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.accounttax.custombatch
{{baseUrl}}/accounttax/batch
BODY json
{
"entries": [
{
"accountId": "",
"accountTax": {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
},
"batchId": 0,
"merchantId": "",
"method": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/accounttax/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/accounttax/batch" {:content-type :json
:form-params {:entries [{:accountId ""
:accountTax {:accountId ""
:kind ""
:rules [{:country ""
:locationId ""
:ratePercent ""
:shippingTaxed false
:useGlobalRate false}]}
:batchId 0
:merchantId ""
:method ""}]}})
require "http/client"
url = "{{baseUrl}}/accounttax/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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}}/accounttax/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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}}/accounttax/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/accounttax/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/accounttax/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 408
{
"entries": [
{
"accountId": "",
"accountTax": {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
},
"batchId": 0,
"merchantId": "",
"method": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/accounttax/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/accounttax/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/accounttax/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/accounttax/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
accountId: '',
accountTax: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
},
batchId: 0,
merchantId: '',
method: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/accounttax/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/accounttax/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
accountId: '',
accountTax: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
},
batchId: 0,
merchantId: '',
method: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/accounttax/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"accountId":"","accountTax":{"accountId":"","kind":"","rules":[{"country":"","locationId":"","ratePercent":"","shippingTaxed":false,"useGlobalRate":false}]},"batchId":0,"merchantId":"","method":""}]}'
};
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}}/accounttax/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "accountId": "",\n "accountTax": {\n "accountId": "",\n "kind": "",\n "rules": [\n {\n "country": "",\n "locationId": "",\n "ratePercent": "",\n "shippingTaxed": false,\n "useGlobalRate": false\n }\n ]\n },\n "batchId": 0,\n "merchantId": "",\n "method": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/accounttax/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/accounttax/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
accountId: '',
accountTax: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
},
batchId: 0,
merchantId: '',
method: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/accounttax/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
accountId: '',
accountTax: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
},
batchId: 0,
merchantId: '',
method: ''
}
]
},
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}}/accounttax/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
accountId: '',
accountTax: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
},
batchId: 0,
merchantId: '',
method: ''
}
]
});
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}}/accounttax/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
accountId: '',
accountTax: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
},
batchId: 0,
merchantId: '',
method: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/accounttax/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"accountId":"","accountTax":{"accountId":"","kind":"","rules":[{"country":"","locationId":"","ratePercent":"","shippingTaxed":false,"useGlobalRate":false}]},"batchId":0,"merchantId":"","method":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"accountId": @"", @"accountTax": @{ @"accountId": @"", @"kind": @"", @"rules": @[ @{ @"country": @"", @"locationId": @"", @"ratePercent": @"", @"shippingTaxed": @NO, @"useGlobalRate": @NO } ] }, @"batchId": @0, @"merchantId": @"", @"method": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/accounttax/batch"]
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}}/accounttax/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/accounttax/batch",
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([
'entries' => [
[
'accountId' => '',
'accountTax' => [
'accountId' => '',
'kind' => '',
'rules' => [
[
'country' => '',
'locationId' => '',
'ratePercent' => '',
'shippingTaxed' => null,
'useGlobalRate' => null
]
]
],
'batchId' => 0,
'merchantId' => '',
'method' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/accounttax/batch', [
'body' => '{
"entries": [
{
"accountId": "",
"accountTax": {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
},
"batchId": 0,
"merchantId": "",
"method": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/accounttax/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'accountId' => '',
'accountTax' => [
'accountId' => '',
'kind' => '',
'rules' => [
[
'country' => '',
'locationId' => '',
'ratePercent' => '',
'shippingTaxed' => null,
'useGlobalRate' => null
]
]
],
'batchId' => 0,
'merchantId' => '',
'method' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'accountId' => '',
'accountTax' => [
'accountId' => '',
'kind' => '',
'rules' => [
[
'country' => '',
'locationId' => '',
'ratePercent' => '',
'shippingTaxed' => null,
'useGlobalRate' => null
]
]
],
'batchId' => 0,
'merchantId' => '',
'method' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/accounttax/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/accounttax/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"accountId": "",
"accountTax": {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
},
"batchId": 0,
"merchantId": "",
"method": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/accounttax/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"accountId": "",
"accountTax": {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
},
"batchId": 0,
"merchantId": "",
"method": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/accounttax/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/accounttax/batch"
payload = { "entries": [
{
"accountId": "",
"accountTax": {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": False,
"useGlobalRate": False
}
]
},
"batchId": 0,
"merchantId": "",
"method": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/accounttax/batch"
payload <- "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/accounttax/batch")
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 \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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.post('/baseUrl/accounttax/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"accountTax\": {\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n },\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/accounttax/batch";
let payload = json!({"entries": (
json!({
"accountId": "",
"accountTax": json!({
"accountId": "",
"kind": "",
"rules": (
json!({
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
})
)
}),
"batchId": 0,
"merchantId": "",
"method": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/accounttax/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"accountId": "",
"accountTax": {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
},
"batchId": 0,
"merchantId": "",
"method": ""
}
]
}'
echo '{
"entries": [
{
"accountId": "",
"accountTax": {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
},
"batchId": 0,
"merchantId": "",
"method": ""
}
]
}' | \
http POST {{baseUrl}}/accounttax/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "accountId": "",\n "accountTax": {\n "accountId": "",\n "kind": "",\n "rules": [\n {\n "country": "",\n "locationId": "",\n "ratePercent": "",\n "shippingTaxed": false,\n "useGlobalRate": false\n }\n ]\n },\n "batchId": 0,\n "merchantId": "",\n "method": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/accounttax/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"accountId": "",
"accountTax": [
"accountId": "",
"kind": "",
"rules": [
[
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
]
]
],
"batchId": 0,
"merchantId": "",
"method": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/accounttax/batch")! 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()
GET
content.accounttax.get
{{baseUrl}}/:merchantId/accounttax/:accountId
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounttax/:accountId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/accounttax/:accountId")
require "http/client"
url = "{{baseUrl}}/:merchantId/accounttax/:accountId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accounttax/:accountId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accounttax/:accountId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounttax/:accountId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/accounttax/:accountId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/accounttax/:accountId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounttax/:accountId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounttax/:accountId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/accounttax/:accountId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/accounttax/:accountId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounttax/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounttax/:accountId';
const options = {method: 'GET'};
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}}/:merchantId/accounttax/:accountId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounttax/:accountId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounttax/:accountId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounttax/:accountId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/accounttax/:accountId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/accounttax/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounttax/:accountId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounttax/:accountId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/accounttax/:accountId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounttax/:accountId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/accounttax/:accountId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounttax/:accountId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accounttax/:accountId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounttax/:accountId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounttax/:accountId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/accounttax/:accountId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounttax/:accountId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounttax/:accountId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounttax/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/accounttax/:accountId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounttax/:accountId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/accounttax/:accountId
http GET {{baseUrl}}/:merchantId/accounttax/:accountId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/accounttax/:accountId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounttax/:accountId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.accounttax.list
{{baseUrl}}/:merchantId/accounttax
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounttax");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/accounttax")
require "http/client"
url = "{{baseUrl}}/:merchantId/accounttax"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/accounttax"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/accounttax");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounttax"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/accounttax HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/accounttax")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounttax"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounttax")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/accounttax")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/accounttax');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accounttax'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounttax';
const options = {method: 'GET'};
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}}/:merchantId/accounttax',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounttax")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounttax',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accounttax'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/accounttax');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/accounttax'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounttax';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounttax"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/accounttax" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounttax",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/accounttax');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounttax');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/accounttax');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounttax' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounttax' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/accounttax")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounttax"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounttax"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounttax")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/accounttax') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/accounttax";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/accounttax
http GET {{baseUrl}}/:merchantId/accounttax
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/accounttax
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounttax")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PUT
content.accounttax.update
{{baseUrl}}/:merchantId/accounttax/:accountId
QUERY PARAMS
merchantId
accountId
BODY json
{
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/accounttax/:accountId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/:merchantId/accounttax/:accountId" {:content-type :json
:form-params {:accountId ""
:kind ""
:rules [{:country ""
:locationId ""
:ratePercent ""
:shippingTaxed false
:useGlobalRate false}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/accounttax/:accountId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\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}}/:merchantId/accounttax/:accountId"),
Content = new StringContent("{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\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}}/:merchantId/accounttax/:accountId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/accounttax/:accountId"
payload := strings.NewReader("{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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(res)
fmt.Println(string(body))
}
PUT /baseUrl/:merchantId/accounttax/:accountId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 194
{
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/:merchantId/accounttax/:accountId")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/accounttax/:accountId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\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 \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/accounttax/:accountId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/:merchantId/accounttax/:accountId")
.header("content-type", "application/json")
.body("{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}")
.asString();
const data = JSON.stringify({
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/:merchantId/accounttax/:accountId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/accounttax/:accountId',
headers: {'content-type': 'application/json'},
data: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/accounttax/:accountId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","kind":"","rules":[{"country":"","locationId":"","ratePercent":"","shippingTaxed":false,"useGlobalRate":false}]}'
};
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}}/:merchantId/accounttax/:accountId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountId": "",\n "kind": "",\n "rules": [\n {\n "country": "",\n "locationId": "",\n "ratePercent": "",\n "shippingTaxed": false,\n "useGlobalRate": false\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/accounttax/:accountId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/accounttax/:accountId',
headers: {
'content-type': 'application/json'
}
};
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({
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/accounttax/:accountId',
headers: {'content-type': 'application/json'},
body: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
},
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}}/:merchantId/accounttax/:accountId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
});
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}}/:merchantId/accounttax/:accountId',
headers: {'content-type': 'application/json'},
data: {
accountId: '',
kind: '',
rules: [
{
country: '',
locationId: '',
ratePercent: '',
shippingTaxed: false,
useGlobalRate: false
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/accounttax/:accountId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","kind":"","rules":[{"country":"","locationId":"","ratePercent":"","shippingTaxed":false,"useGlobalRate":false}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accountId": @"",
@"kind": @"",
@"rules": @[ @{ @"country": @"", @"locationId": @"", @"ratePercent": @"", @"shippingTaxed": @NO, @"useGlobalRate": @NO } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/accounttax/:accountId"]
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}}/:merchantId/accounttax/:accountId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/accounttax/:accountId",
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([
'accountId' => '',
'kind' => '',
'rules' => [
[
'country' => '',
'locationId' => '',
'ratePercent' => '',
'shippingTaxed' => null,
'useGlobalRate' => null
]
]
]),
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;
}
request('PUT', '{{baseUrl}}/:merchantId/accounttax/:accountId', [
'body' => '{
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/accounttax/:accountId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountId' => '',
'kind' => '',
'rules' => [
[
'country' => '',
'locationId' => '',
'ratePercent' => '',
'shippingTaxed' => null,
'useGlobalRate' => null
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountId' => '',
'kind' => '',
'rules' => [
[
'country' => '',
'locationId' => '',
'ratePercent' => '',
'shippingTaxed' => null,
'useGlobalRate' => null
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/accounttax/:accountId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/accounttax/:accountId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/accounttax/:accountId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/:merchantId/accounttax/:accountId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/accounttax/:accountId"
payload = {
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": False,
"useGlobalRate": False
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/accounttax/:accountId"
payload <- "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/accounttax/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\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/:merchantId/accounttax/:accountId') do |req|
req.body = "{\n \"accountId\": \"\",\n \"kind\": \"\",\n \"rules\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"ratePercent\": \"\",\n \"shippingTaxed\": false,\n \"useGlobalRate\": false\n }\n ]\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}}/:merchantId/accounttax/:accountId";
let payload = json!({
"accountId": "",
"kind": "",
"rules": (
json!({
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".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}}/:merchantId/accounttax/:accountId \
--header 'content-type: application/json' \
--data '{
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
}'
echo '{
"accountId": "",
"kind": "",
"rules": [
{
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
}
]
}' | \
http PUT {{baseUrl}}/:merchantId/accounttax/:accountId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "accountId": "",\n "kind": "",\n "rules": [\n {\n "country": "",\n "locationId": "",\n "ratePercent": "",\n "shippingTaxed": false,\n "useGlobalRate": false\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/accounttax/:accountId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountId": "",
"kind": "",
"rules": [
[
"country": "",
"locationId": "",
"ratePercent": "",
"shippingTaxed": false,
"useGlobalRate": false
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/accounttax/:accountId")! 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
content.buyongoogleprograms.activate
{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate
QUERY PARAMS
merchantId
regionCode
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/:merchantId/buyongoogleprograms/:regionCode/activate"),
Content = new StringContent("{}")
{
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}}/:merchantId/buyongoogleprograms/:regionCode/activate");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate"
payload := strings.NewReader("{}")
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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/buyongoogleprograms/:regionCode/activate HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/:merchantId/buyongoogleprograms/:regionCode/activate',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/buyongoogleprograms/:regionCode/activate',
headers: {
'content-type': 'application/json'
}
};
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate',
headers: {'content-type': 'application/json'},
body: {},
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}}/:merchantId/buyongoogleprograms/:regionCode/activate');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/:merchantId/buyongoogleprograms/:regionCode/activate',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate"]
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}}/:merchantId/buyongoogleprograms/:regionCode/activate" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate",
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([
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/buyongoogleprograms/:regionCode/activate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate"
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate")
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 = "{}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/:merchantId/buyongoogleprograms/:regionCode/activate') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/activate")! 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()
GET
content.buyongoogleprograms.get
{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode
QUERY PARAMS
merchantId
regionCode
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
require "http/client"
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/buyongoogleprograms/:regionCode HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode';
const options = {method: 'GET'};
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}}/:merchantId/buyongoogleprograms/:regionCode',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/buyongoogleprograms/:regionCode',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/buyongoogleprograms/:regionCode" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/buyongoogleprograms/:regionCode")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/buyongoogleprograms/:regionCode') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode
http GET {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.buyongoogleprograms.onboard
{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard
QUERY PARAMS
merchantId
regionCode
BODY json
{
"customerServiceEmail": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"customerServiceEmail\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard" {:content-type :json
:form-params {:customerServiceEmail ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"customerServiceEmail\": \"\"\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}}/:merchantId/buyongoogleprograms/:regionCode/onboard"),
Content = new StringContent("{\n \"customerServiceEmail\": \"\"\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}}/:merchantId/buyongoogleprograms/:regionCode/onboard");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"customerServiceEmail\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard"
payload := strings.NewReader("{\n \"customerServiceEmail\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/buyongoogleprograms/:regionCode/onboard HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 32
{
"customerServiceEmail": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard")
.setHeader("content-type", "application/json")
.setBody("{\n \"customerServiceEmail\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"customerServiceEmail\": \"\"\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 \"customerServiceEmail\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard")
.header("content-type", "application/json")
.body("{\n \"customerServiceEmail\": \"\"\n}")
.asString();
const data = JSON.stringify({
customerServiceEmail: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard',
headers: {'content-type': 'application/json'},
data: {customerServiceEmail: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"customerServiceEmail":""}'
};
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}}/:merchantId/buyongoogleprograms/:regionCode/onboard',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "customerServiceEmail": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"customerServiceEmail\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/buyongoogleprograms/:regionCode/onboard',
headers: {
'content-type': 'application/json'
}
};
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({customerServiceEmail: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard',
headers: {'content-type': 'application/json'},
body: {customerServiceEmail: ''},
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}}/:merchantId/buyongoogleprograms/:regionCode/onboard');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
customerServiceEmail: ''
});
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}}/:merchantId/buyongoogleprograms/:regionCode/onboard',
headers: {'content-type': 'application/json'},
data: {customerServiceEmail: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"customerServiceEmail":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"customerServiceEmail": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard"]
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}}/:merchantId/buyongoogleprograms/:regionCode/onboard" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"customerServiceEmail\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard",
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([
'customerServiceEmail' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard', [
'body' => '{
"customerServiceEmail": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'customerServiceEmail' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'customerServiceEmail' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customerServiceEmail": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customerServiceEmail": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"customerServiceEmail\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/buyongoogleprograms/:regionCode/onboard", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard"
payload = { "customerServiceEmail": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard"
payload <- "{\n \"customerServiceEmail\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard")
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 \"customerServiceEmail\": \"\"\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.post('/baseUrl/:merchantId/buyongoogleprograms/:regionCode/onboard') do |req|
req.body = "{\n \"customerServiceEmail\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard";
let payload = json!({"customerServiceEmail": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard \
--header 'content-type: application/json' \
--data '{
"customerServiceEmail": ""
}'
echo '{
"customerServiceEmail": ""
}' | \
http POST {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "customerServiceEmail": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["customerServiceEmail": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/onboard")! 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()
PATCH
content.buyongoogleprograms.patch
{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode
QUERY PARAMS
merchantId
regionCode
BODY json
{
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode" {:content-type :json
:form-params {:businessModel []
:customerServicePendingEmail ""
:customerServicePendingPhoneNumber ""
:customerServicePendingPhoneRegionCode ""
:customerServiceVerifiedEmail ""
:customerServiceVerifiedPhoneNumber ""
:customerServiceVerifiedPhoneRegionCode ""
:onlineSalesChannel ""
:participationStage ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"),
Content = new StringContent("{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\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}}/:merchantId/buyongoogleprograms/:regionCode");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"
payload := strings.NewReader("{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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(res)
fmt.Println(string(body))
}
PATCH /baseUrl/:merchantId/buyongoogleprograms/:regionCode HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 338
{
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
.setHeader("content-type", "application/json")
.setBody("{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\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 \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
.header("content-type", "application/json")
.body("{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}")
.asString();
const data = JSON.stringify({
businessModel: [],
customerServicePendingEmail: '',
customerServicePendingPhoneNumber: '',
customerServicePendingPhoneRegionCode: '',
customerServiceVerifiedEmail: '',
customerServiceVerifiedPhoneNumber: '',
customerServiceVerifiedPhoneRegionCode: '',
onlineSalesChannel: '',
participationStage: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode',
headers: {'content-type': 'application/json'},
data: {
businessModel: [],
customerServicePendingEmail: '',
customerServicePendingPhoneNumber: '',
customerServicePendingPhoneRegionCode: '',
customerServiceVerifiedEmail: '',
customerServiceVerifiedPhoneNumber: '',
customerServiceVerifiedPhoneRegionCode: '',
onlineSalesChannel: '',
participationStage: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"businessModel":[],"customerServicePendingEmail":"","customerServicePendingPhoneNumber":"","customerServicePendingPhoneRegionCode":"","customerServiceVerifiedEmail":"","customerServiceVerifiedPhoneNumber":"","customerServiceVerifiedPhoneRegionCode":"","onlineSalesChannel":"","participationStage":""}'
};
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}}/:merchantId/buyongoogleprograms/:regionCode',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "businessModel": [],\n "customerServicePendingEmail": "",\n "customerServicePendingPhoneNumber": "",\n "customerServicePendingPhoneRegionCode": "",\n "customerServiceVerifiedEmail": "",\n "customerServiceVerifiedPhoneNumber": "",\n "customerServiceVerifiedPhoneRegionCode": "",\n "onlineSalesChannel": "",\n "participationStage": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/buyongoogleprograms/:regionCode',
headers: {
'content-type': 'application/json'
}
};
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({
businessModel: [],
customerServicePendingEmail: '',
customerServicePendingPhoneNumber: '',
customerServicePendingPhoneRegionCode: '',
customerServiceVerifiedEmail: '',
customerServiceVerifiedPhoneNumber: '',
customerServiceVerifiedPhoneRegionCode: '',
onlineSalesChannel: '',
participationStage: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode',
headers: {'content-type': 'application/json'},
body: {
businessModel: [],
customerServicePendingEmail: '',
customerServicePendingPhoneNumber: '',
customerServicePendingPhoneRegionCode: '',
customerServiceVerifiedEmail: '',
customerServiceVerifiedPhoneNumber: '',
customerServiceVerifiedPhoneRegionCode: '',
onlineSalesChannel: '',
participationStage: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
businessModel: [],
customerServicePendingEmail: '',
customerServicePendingPhoneNumber: '',
customerServicePendingPhoneRegionCode: '',
customerServiceVerifiedEmail: '',
customerServiceVerifiedPhoneNumber: '',
customerServiceVerifiedPhoneRegionCode: '',
onlineSalesChannel: '',
participationStage: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode',
headers: {'content-type': 'application/json'},
data: {
businessModel: [],
customerServicePendingEmail: '',
customerServicePendingPhoneNumber: '',
customerServicePendingPhoneRegionCode: '',
customerServiceVerifiedEmail: '',
customerServiceVerifiedPhoneNumber: '',
customerServiceVerifiedPhoneRegionCode: '',
onlineSalesChannel: '',
participationStage: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"businessModel":[],"customerServicePendingEmail":"","customerServicePendingPhoneNumber":"","customerServicePendingPhoneRegionCode":"","customerServiceVerifiedEmail":"","customerServiceVerifiedPhoneNumber":"","customerServiceVerifiedPhoneRegionCode":"","onlineSalesChannel":"","participationStage":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"businessModel": @[ ],
@"customerServicePendingEmail": @"",
@"customerServicePendingPhoneNumber": @"",
@"customerServicePendingPhoneRegionCode": @"",
@"customerServiceVerifiedEmail": @"",
@"customerServiceVerifiedPhoneNumber": @"",
@"customerServiceVerifiedPhoneRegionCode": @"",
@"onlineSalesChannel": @"",
@"participationStage": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/:merchantId/buyongoogleprograms/:regionCode" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'businessModel' => [
],
'customerServicePendingEmail' => '',
'customerServicePendingPhoneNumber' => '',
'customerServicePendingPhoneRegionCode' => '',
'customerServiceVerifiedEmail' => '',
'customerServiceVerifiedPhoneNumber' => '',
'customerServiceVerifiedPhoneRegionCode' => '',
'onlineSalesChannel' => '',
'participationStage' => ''
]),
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;
}
request('PATCH', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode', [
'body' => '{
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'businessModel' => [
],
'customerServicePendingEmail' => '',
'customerServicePendingPhoneNumber' => '',
'customerServicePendingPhoneRegionCode' => '',
'customerServiceVerifiedEmail' => '',
'customerServiceVerifiedPhoneNumber' => '',
'customerServiceVerifiedPhoneRegionCode' => '',
'onlineSalesChannel' => '',
'participationStage' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'businessModel' => [
],
'customerServicePendingEmail' => '',
'customerServicePendingPhoneNumber' => '',
'customerServicePendingPhoneRegionCode' => '',
'customerServiceVerifiedEmail' => '',
'customerServiceVerifiedPhoneNumber' => '',
'customerServiceVerifiedPhoneRegionCode' => '',
'onlineSalesChannel' => '',
'participationStage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/:merchantId/buyongoogleprograms/:regionCode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"
payload = {
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode"
payload <- "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\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.patch('/baseUrl/:merchantId/buyongoogleprograms/:regionCode') do |req|
req.body = "{\n \"businessModel\": [],\n \"customerServicePendingEmail\": \"\",\n \"customerServicePendingPhoneNumber\": \"\",\n \"customerServicePendingPhoneRegionCode\": \"\",\n \"customerServiceVerifiedEmail\": \"\",\n \"customerServiceVerifiedPhoneNumber\": \"\",\n \"customerServiceVerifiedPhoneRegionCode\": \"\",\n \"onlineSalesChannel\": \"\",\n \"participationStage\": \"\"\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}}/:merchantId/buyongoogleprograms/:regionCode";
let payload = json!({
"businessModel": (),
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode \
--header 'content-type: application/json' \
--data '{
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
}'
echo '{
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
}' | \
http PATCH {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "businessModel": [],\n "customerServicePendingEmail": "",\n "customerServicePendingPhoneNumber": "",\n "customerServicePendingPhoneRegionCode": "",\n "customerServiceVerifiedEmail": "",\n "customerServiceVerifiedPhoneNumber": "",\n "customerServiceVerifiedPhoneRegionCode": "",\n "onlineSalesChannel": "",\n "participationStage": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"businessModel": [],
"customerServicePendingEmail": "",
"customerServicePendingPhoneNumber": "",
"customerServicePendingPhoneRegionCode": "",
"customerServiceVerifiedEmail": "",
"customerServiceVerifiedPhoneNumber": "",
"customerServiceVerifiedPhoneRegionCode": "",
"onlineSalesChannel": "",
"participationStage": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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
content.buyongoogleprograms.pause
{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause
QUERY PARAMS
merchantId
regionCode
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/:merchantId/buyongoogleprograms/:regionCode/pause"),
Content = new StringContent("{}")
{
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}}/:merchantId/buyongoogleprograms/:regionCode/pause");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause"
payload := strings.NewReader("{}")
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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/buyongoogleprograms/:regionCode/pause HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/:merchantId/buyongoogleprograms/:regionCode/pause',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/buyongoogleprograms/:regionCode/pause',
headers: {
'content-type': 'application/json'
}
};
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause',
headers: {'content-type': 'application/json'},
body: {},
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}}/:merchantId/buyongoogleprograms/:regionCode/pause');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/:merchantId/buyongoogleprograms/:regionCode/pause',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause"]
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}}/:merchantId/buyongoogleprograms/:regionCode/pause" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause",
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([
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/buyongoogleprograms/:regionCode/pause", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause"
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause")
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 = "{}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/:merchantId/buyongoogleprograms/:regionCode/pause') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/pause")! 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()
POST
content.buyongoogleprograms.requestreview
{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview
QUERY PARAMS
merchantId
regionCode
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/:merchantId/buyongoogleprograms/:regionCode/requestreview"),
Content = new StringContent("{}")
{
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}}/:merchantId/buyongoogleprograms/:regionCode/requestreview");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview"
payload := strings.NewReader("{}")
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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/buyongoogleprograms/:regionCode/requestreview HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/:merchantId/buyongoogleprograms/:regionCode/requestreview',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/buyongoogleprograms/:regionCode/requestreview',
headers: {
'content-type': 'application/json'
}
};
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview',
headers: {'content-type': 'application/json'},
body: {},
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}}/:merchantId/buyongoogleprograms/:regionCode/requestreview');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/:merchantId/buyongoogleprograms/:regionCode/requestreview',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview"]
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}}/:merchantId/buyongoogleprograms/:regionCode/requestreview" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview",
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([
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/buyongoogleprograms/:regionCode/requestreview", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview"
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview")
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 = "{}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/:merchantId/buyongoogleprograms/:regionCode/requestreview') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/buyongoogleprograms/:regionCode/requestreview")! 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()
POST
content.collections.create
{{baseUrl}}/:merchantId/collections
QUERY PARAMS
merchantId
BODY json
{
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
{
"offerId": "",
"x": "",
"y": ""
}
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/collections");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/collections" {:content-type :json
:form-params {:customLabel0 ""
:customLabel1 ""
:customLabel2 ""
:customLabel3 ""
:customLabel4 ""
:featuredProduct [{:offerId ""
:x ""
:y ""}]
:headline []
:id ""
:imageLink []
:language ""
:link ""
:mobileLink ""
:productCountry ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/collections"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\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}}/:merchantId/collections"),
Content = new StringContent("{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\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}}/:merchantId/collections");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/collections"
payload := strings.NewReader("{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/collections HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 327
{
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
{
"offerId": "",
"x": "",
"y": ""
}
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/collections")
.setHeader("content-type", "application/json")
.setBody("{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/collections"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\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 \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/collections")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/collections")
.header("content-type", "application/json")
.body("{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}")
.asString();
const data = JSON.stringify({
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
featuredProduct: [
{
offerId: '',
x: '',
y: ''
}
],
headline: [],
id: '',
imageLink: [],
language: '',
link: '',
mobileLink: '',
productCountry: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/collections');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/collections',
headers: {'content-type': 'application/json'},
data: {
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
featuredProduct: [{offerId: '', x: '', y: ''}],
headline: [],
id: '',
imageLink: [],
language: '',
link: '',
mobileLink: '',
productCountry: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/collections';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"customLabel0":"","customLabel1":"","customLabel2":"","customLabel3":"","customLabel4":"","featuredProduct":[{"offerId":"","x":"","y":""}],"headline":[],"id":"","imageLink":[],"language":"","link":"","mobileLink":"","productCountry":""}'
};
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}}/:merchantId/collections',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "customLabel0": "",\n "customLabel1": "",\n "customLabel2": "",\n "customLabel3": "",\n "customLabel4": "",\n "featuredProduct": [\n {\n "offerId": "",\n "x": "",\n "y": ""\n }\n ],\n "headline": [],\n "id": "",\n "imageLink": [],\n "language": "",\n "link": "",\n "mobileLink": "",\n "productCountry": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/collections")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/collections',
headers: {
'content-type': 'application/json'
}
};
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({
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
featuredProduct: [{offerId: '', x: '', y: ''}],
headline: [],
id: '',
imageLink: [],
language: '',
link: '',
mobileLink: '',
productCountry: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/collections',
headers: {'content-type': 'application/json'},
body: {
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
featuredProduct: [{offerId: '', x: '', y: ''}],
headline: [],
id: '',
imageLink: [],
language: '',
link: '',
mobileLink: '',
productCountry: ''
},
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}}/:merchantId/collections');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
featuredProduct: [
{
offerId: '',
x: '',
y: ''
}
],
headline: [],
id: '',
imageLink: [],
language: '',
link: '',
mobileLink: '',
productCountry: ''
});
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}}/:merchantId/collections',
headers: {'content-type': 'application/json'},
data: {
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
featuredProduct: [{offerId: '', x: '', y: ''}],
headline: [],
id: '',
imageLink: [],
language: '',
link: '',
mobileLink: '',
productCountry: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/collections';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"customLabel0":"","customLabel1":"","customLabel2":"","customLabel3":"","customLabel4":"","featuredProduct":[{"offerId":"","x":"","y":""}],"headline":[],"id":"","imageLink":[],"language":"","link":"","mobileLink":"","productCountry":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"customLabel0": @"",
@"customLabel1": @"",
@"customLabel2": @"",
@"customLabel3": @"",
@"customLabel4": @"",
@"featuredProduct": @[ @{ @"offerId": @"", @"x": @"", @"y": @"" } ],
@"headline": @[ ],
@"id": @"",
@"imageLink": @[ ],
@"language": @"",
@"link": @"",
@"mobileLink": @"",
@"productCountry": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/collections"]
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}}/:merchantId/collections" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/collections",
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([
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'featuredProduct' => [
[
'offerId' => '',
'x' => '',
'y' => ''
]
],
'headline' => [
],
'id' => '',
'imageLink' => [
],
'language' => '',
'link' => '',
'mobileLink' => '',
'productCountry' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/collections', [
'body' => '{
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
{
"offerId": "",
"x": "",
"y": ""
}
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/collections');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'featuredProduct' => [
[
'offerId' => '',
'x' => '',
'y' => ''
]
],
'headline' => [
],
'id' => '',
'imageLink' => [
],
'language' => '',
'link' => '',
'mobileLink' => '',
'productCountry' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'featuredProduct' => [
[
'offerId' => '',
'x' => '',
'y' => ''
]
],
'headline' => [
],
'id' => '',
'imageLink' => [
],
'language' => '',
'link' => '',
'mobileLink' => '',
'productCountry' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/collections');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/collections' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
{
"offerId": "",
"x": "",
"y": ""
}
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/collections' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
{
"offerId": "",
"x": "",
"y": ""
}
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/collections", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/collections"
payload = {
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
{
"offerId": "",
"x": "",
"y": ""
}
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/collections"
payload <- "{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/collections")
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 \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\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.post('/baseUrl/:merchantId/collections') do |req|
req.body = "{\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"featuredProduct\": [\n {\n \"offerId\": \"\",\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"headline\": [],\n \"id\": \"\",\n \"imageLink\": [],\n \"language\": \"\",\n \"link\": \"\",\n \"mobileLink\": \"\",\n \"productCountry\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/collections";
let payload = json!({
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": (
json!({
"offerId": "",
"x": "",
"y": ""
})
),
"headline": (),
"id": "",
"imageLink": (),
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/collections \
--header 'content-type: application/json' \
--data '{
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
{
"offerId": "",
"x": "",
"y": ""
}
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
}'
echo '{
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
{
"offerId": "",
"x": "",
"y": ""
}
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
}' | \
http POST {{baseUrl}}/:merchantId/collections \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "customLabel0": "",\n "customLabel1": "",\n "customLabel2": "",\n "customLabel3": "",\n "customLabel4": "",\n "featuredProduct": [\n {\n "offerId": "",\n "x": "",\n "y": ""\n }\n ],\n "headline": [],\n "id": "",\n "imageLink": [],\n "language": "",\n "link": "",\n "mobileLink": "",\n "productCountry": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/collections
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"featuredProduct": [
[
"offerId": "",
"x": "",
"y": ""
]
],
"headline": [],
"id": "",
"imageLink": [],
"language": "",
"link": "",
"mobileLink": "",
"productCountry": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/collections")! 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()
DELETE
content.collections.delete
{{baseUrl}}/:merchantId/collections/:collectionId
QUERY PARAMS
merchantId
collectionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/collections/:collectionId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/collections/:collectionId")
require "http/client"
url = "{{baseUrl}}/:merchantId/collections/:collectionId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/collections/:collectionId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/collections/:collectionId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/collections/:collectionId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/collections/:collectionId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/collections/:collectionId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/collections/:collectionId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/collections/:collectionId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/collections/:collectionId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/collections/:collectionId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/collections/:collectionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/collections/:collectionId';
const options = {method: 'DELETE'};
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}}/:merchantId/collections/:collectionId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/collections/:collectionId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/collections/:collectionId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/collections/:collectionId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/collections/:collectionId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/collections/:collectionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/collections/:collectionId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/collections/:collectionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/collections/:collectionId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/collections/:collectionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/collections/:collectionId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/collections/:collectionId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/collections/:collectionId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/collections/:collectionId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/collections/:collectionId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/collections/:collectionId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/collections/:collectionId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/collections/:collectionId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/collections/:collectionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/collections/:collectionId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/collections/:collectionId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/collections/:collectionId
http DELETE {{baseUrl}}/:merchantId/collections/:collectionId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/collections/:collectionId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/collections/:collectionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.collections.get
{{baseUrl}}/:merchantId/collections/:collectionId
QUERY PARAMS
merchantId
collectionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/collections/:collectionId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/collections/:collectionId")
require "http/client"
url = "{{baseUrl}}/:merchantId/collections/:collectionId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/collections/:collectionId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/collections/:collectionId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/collections/:collectionId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/collections/:collectionId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/collections/:collectionId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/collections/:collectionId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/collections/:collectionId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/collections/:collectionId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/collections/:collectionId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collections/:collectionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/collections/:collectionId';
const options = {method: 'GET'};
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}}/:merchantId/collections/:collectionId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/collections/:collectionId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/collections/:collectionId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collections/:collectionId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/collections/:collectionId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collections/:collectionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/collections/:collectionId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/collections/:collectionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/collections/:collectionId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/collections/:collectionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/collections/:collectionId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/collections/:collectionId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/collections/:collectionId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/collections/:collectionId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/collections/:collectionId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/collections/:collectionId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/collections/:collectionId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/collections/:collectionId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/collections/:collectionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/collections/:collectionId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/collections/:collectionId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/collections/:collectionId
http GET {{baseUrl}}/:merchantId/collections/:collectionId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/collections/:collectionId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/collections/:collectionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.collections.list
{{baseUrl}}/:merchantId/collections
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/collections");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/collections")
require "http/client"
url = "{{baseUrl}}/:merchantId/collections"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/collections"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/collections");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/collections"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/collections HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/collections")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/collections"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/collections")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/collections")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/collections');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/collections'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/collections';
const options = {method: 'GET'};
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}}/:merchantId/collections',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/collections")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/collections',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/collections'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/collections');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/collections'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/collections';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/collections"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/collections" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/collections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/collections');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/collections');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/collections');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/collections' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/collections' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/collections")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/collections"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/collections"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/collections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/collections') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/collections";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/collections
http GET {{baseUrl}}/:merchantId/collections
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/collections
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/collections")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.collectionstatuses.get
{{baseUrl}}/:merchantId/collectionstatuses/:collectionId
QUERY PARAMS
merchantId
collectionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId")
require "http/client"
url = "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/collectionstatuses/:collectionId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/collectionstatuses/:collectionId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/collectionstatuses/:collectionId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/collectionstatuses/:collectionId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/collectionstatuses/:collectionId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/collectionstatuses/:collectionId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId';
const options = {method: 'GET'};
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}}/:merchantId/collectionstatuses/:collectionId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/collectionstatuses/:collectionId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/collectionstatuses/:collectionId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/collectionstatuses/:collectionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/collectionstatuses/:collectionId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/collectionstatuses/:collectionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/collectionstatuses/:collectionId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/collectionstatuses/:collectionId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/collectionstatuses/:collectionId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/collectionstatuses/:collectionId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/collectionstatuses/:collectionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/collectionstatuses/:collectionId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/collectionstatuses/:collectionId
http GET {{baseUrl}}/:merchantId/collectionstatuses/:collectionId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/collectionstatuses/:collectionId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/collectionstatuses/:collectionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.collectionstatuses.list
{{baseUrl}}/:merchantId/collectionstatuses
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/collectionstatuses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/collectionstatuses")
require "http/client"
url = "{{baseUrl}}/:merchantId/collectionstatuses"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/collectionstatuses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/collectionstatuses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/collectionstatuses"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/collectionstatuses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/collectionstatuses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/collectionstatuses"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/collectionstatuses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/collectionstatuses")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/collectionstatuses');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collectionstatuses'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/collectionstatuses';
const options = {method: 'GET'};
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}}/:merchantId/collectionstatuses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/collectionstatuses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/collectionstatuses',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collectionstatuses'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/collectionstatuses');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/collectionstatuses'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/collectionstatuses';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/collectionstatuses"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/collectionstatuses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/collectionstatuses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/collectionstatuses');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/collectionstatuses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/collectionstatuses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/collectionstatuses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/collectionstatuses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/collectionstatuses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/collectionstatuses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/collectionstatuses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/collectionstatuses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/collectionstatuses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/collectionstatuses";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/collectionstatuses
http GET {{baseUrl}}/:merchantId/collectionstatuses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/collectionstatuses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/collectionstatuses")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.conversionsources.create
{{baseUrl}}/:merchantId/conversionsources
QUERY PARAMS
merchantId
BODY json
{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/conversionsources");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/conversionsources" {:content-type :json
:form-params {:conversionSourceId ""
:expireTime ""
:googleAnalyticsLink {:attributionSettings {:attributionLookbackWindowInDays 0
:attributionModel ""
:conversionType [{:includeInReporting false
:name ""}]}
:propertyId ""
:propertyName ""}
:merchantCenterDestination {:attributionSettings {}
:currencyCode ""
:destinationId ""
:displayName ""}
:state ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/conversionsources"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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}}/:merchantId/conversionsources"),
Content = new StringContent("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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}}/:merchantId/conversionsources");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/conversionsources"
payload := strings.NewReader("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/conversionsources HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 506
{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/conversionsources")
.setHeader("content-type", "application/json")
.setBody("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/conversionsources"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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 \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/conversionsources")
.header("content-type", "application/json")
.body("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}")
.asString();
const data = JSON.stringify({
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [
{
includeInReporting: false,
name: ''
}
]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {
attributionSettings: {},
currencyCode: '',
destinationId: '',
displayName: ''
},
state: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/conversionsources');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/conversionsources',
headers: {'content-type': 'application/json'},
data: {
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [{includeInReporting: false, name: ''}]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {attributionSettings: {}, currencyCode: '', destinationId: '', displayName: ''},
state: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/conversionsources';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"conversionSourceId":"","expireTime":"","googleAnalyticsLink":{"attributionSettings":{"attributionLookbackWindowInDays":0,"attributionModel":"","conversionType":[{"includeInReporting":false,"name":""}]},"propertyId":"","propertyName":""},"merchantCenterDestination":{"attributionSettings":{},"currencyCode":"","destinationId":"","displayName":""},"state":""}'
};
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}}/:merchantId/conversionsources',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "conversionSourceId": "",\n "expireTime": "",\n "googleAnalyticsLink": {\n "attributionSettings": {\n "attributionLookbackWindowInDays": 0,\n "attributionModel": "",\n "conversionType": [\n {\n "includeInReporting": false,\n "name": ""\n }\n ]\n },\n "propertyId": "",\n "propertyName": ""\n },\n "merchantCenterDestination": {\n "attributionSettings": {},\n "currencyCode": "",\n "destinationId": "",\n "displayName": ""\n },\n "state": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/conversionsources',
headers: {
'content-type': 'application/json'
}
};
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({
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [{includeInReporting: false, name: ''}]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {attributionSettings: {}, currencyCode: '', destinationId: '', displayName: ''},
state: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/conversionsources',
headers: {'content-type': 'application/json'},
body: {
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [{includeInReporting: false, name: ''}]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {attributionSettings: {}, currencyCode: '', destinationId: '', displayName: ''},
state: ''
},
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}}/:merchantId/conversionsources');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [
{
includeInReporting: false,
name: ''
}
]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {
attributionSettings: {},
currencyCode: '',
destinationId: '',
displayName: ''
},
state: ''
});
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}}/:merchantId/conversionsources',
headers: {'content-type': 'application/json'},
data: {
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [{includeInReporting: false, name: ''}]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {attributionSettings: {}, currencyCode: '', destinationId: '', displayName: ''},
state: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/conversionsources';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"conversionSourceId":"","expireTime":"","googleAnalyticsLink":{"attributionSettings":{"attributionLookbackWindowInDays":0,"attributionModel":"","conversionType":[{"includeInReporting":false,"name":""}]},"propertyId":"","propertyName":""},"merchantCenterDestination":{"attributionSettings":{},"currencyCode":"","destinationId":"","displayName":""},"state":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"conversionSourceId": @"",
@"expireTime": @"",
@"googleAnalyticsLink": @{ @"attributionSettings": @{ @"attributionLookbackWindowInDays": @0, @"attributionModel": @"", @"conversionType": @[ @{ @"includeInReporting": @NO, @"name": @"" } ] }, @"propertyId": @"", @"propertyName": @"" },
@"merchantCenterDestination": @{ @"attributionSettings": @{ }, @"currencyCode": @"", @"destinationId": @"", @"displayName": @"" },
@"state": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/conversionsources"]
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}}/:merchantId/conversionsources" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/conversionsources",
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([
'conversionSourceId' => '',
'expireTime' => '',
'googleAnalyticsLink' => [
'attributionSettings' => [
'attributionLookbackWindowInDays' => 0,
'attributionModel' => '',
'conversionType' => [
[
'includeInReporting' => null,
'name' => ''
]
]
],
'propertyId' => '',
'propertyName' => ''
],
'merchantCenterDestination' => [
'attributionSettings' => [
],
'currencyCode' => '',
'destinationId' => '',
'displayName' => ''
],
'state' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/conversionsources', [
'body' => '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/conversionsources');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'conversionSourceId' => '',
'expireTime' => '',
'googleAnalyticsLink' => [
'attributionSettings' => [
'attributionLookbackWindowInDays' => 0,
'attributionModel' => '',
'conversionType' => [
[
'includeInReporting' => null,
'name' => ''
]
]
],
'propertyId' => '',
'propertyName' => ''
],
'merchantCenterDestination' => [
'attributionSettings' => [
],
'currencyCode' => '',
'destinationId' => '',
'displayName' => ''
],
'state' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'conversionSourceId' => '',
'expireTime' => '',
'googleAnalyticsLink' => [
'attributionSettings' => [
'attributionLookbackWindowInDays' => 0,
'attributionModel' => '',
'conversionType' => [
[
'includeInReporting' => null,
'name' => ''
]
]
],
'propertyId' => '',
'propertyName' => ''
],
'merchantCenterDestination' => [
'attributionSettings' => [
],
'currencyCode' => '',
'destinationId' => '',
'displayName' => ''
],
'state' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/conversionsources');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/conversionsources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/conversionsources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/conversionsources", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/conversionsources"
payload = {
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": False,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/conversionsources"
payload <- "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/conversionsources")
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 \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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.post('/baseUrl/:merchantId/conversionsources') do |req|
req.body = "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/conversionsources";
let payload = json!({
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": json!({
"attributionSettings": json!({
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": (
json!({
"includeInReporting": false,
"name": ""
})
)
}),
"propertyId": "",
"propertyName": ""
}),
"merchantCenterDestination": json!({
"attributionSettings": json!({}),
"currencyCode": "",
"destinationId": "",
"displayName": ""
}),
"state": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/conversionsources \
--header 'content-type: application/json' \
--data '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}'
echo '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}' | \
http POST {{baseUrl}}/:merchantId/conversionsources \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "conversionSourceId": "",\n "expireTime": "",\n "googleAnalyticsLink": {\n "attributionSettings": {\n "attributionLookbackWindowInDays": 0,\n "attributionModel": "",\n "conversionType": [\n {\n "includeInReporting": false,\n "name": ""\n }\n ]\n },\n "propertyId": "",\n "propertyName": ""\n },\n "merchantCenterDestination": {\n "attributionSettings": {},\n "currencyCode": "",\n "destinationId": "",\n "displayName": ""\n },\n "state": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/conversionsources
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": [
"attributionSettings": [
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
[
"includeInReporting": false,
"name": ""
]
]
],
"propertyId": "",
"propertyName": ""
],
"merchantCenterDestination": [
"attributionSettings": [],
"currencyCode": "",
"destinationId": "",
"displayName": ""
],
"state": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/conversionsources")! 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()
DELETE
content.conversionsources.delete
{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
QUERY PARAMS
merchantId
conversionSourceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
require "http/client"
url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/conversionsources/:conversionSourceId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId';
const options = {method: 'DELETE'};
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}}/:merchantId/conversionsources/:conversionSourceId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/conversionsources/:conversionSourceId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/conversionsources/:conversionSourceId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/conversionsources/:conversionSourceId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/conversionsources/:conversionSourceId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
http DELETE {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.conversionsources.get
{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
QUERY PARAMS
merchantId
conversionSourceId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
require "http/client"
url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/conversionsources/:conversionSourceId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId';
const options = {method: 'GET'};
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}}/:merchantId/conversionsources/:conversionSourceId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/conversionsources/:conversionSourceId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/conversionsources/:conversionSourceId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/conversionsources/:conversionSourceId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/conversionsources/:conversionSourceId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
http GET {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.conversionsources.list
{{baseUrl}}/:merchantId/conversionsources
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/conversionsources");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/conversionsources")
require "http/client"
url = "{{baseUrl}}/:merchantId/conversionsources"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/conversionsources"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/conversionsources");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/conversionsources"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/conversionsources HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/conversionsources")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/conversionsources"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/conversionsources")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/conversionsources');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/conversionsources'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/conversionsources';
const options = {method: 'GET'};
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}}/:merchantId/conversionsources',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/conversionsources',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/conversionsources'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/conversionsources');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/conversionsources'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/conversionsources';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/conversionsources"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/conversionsources" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/conversionsources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/conversionsources');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/conversionsources');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/conversionsources');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/conversionsources' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/conversionsources' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/conversionsources")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/conversionsources"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/conversionsources"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/conversionsources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/conversionsources') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/conversionsources";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/conversionsources
http GET {{baseUrl}}/:merchantId/conversionsources
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/conversionsources
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/conversionsources")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PATCH
content.conversionsources.patch
{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
QUERY PARAMS
merchantId
conversionSourceId
BODY json
{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId" {:content-type :json
:form-params {:conversionSourceId ""
:expireTime ""
:googleAnalyticsLink {:attributionSettings {:attributionLookbackWindowInDays 0
:attributionModel ""
:conversionType [{:includeInReporting false
:name ""}]}
:propertyId ""
:propertyName ""}
:merchantCenterDestination {:attributionSettings {}
:currencyCode ""
:destinationId ""
:displayName ""}
:state ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"),
Content = new StringContent("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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}}/:merchantId/conversionsources/:conversionSourceId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
payload := strings.NewReader("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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(res)
fmt.Println(string(body))
}
PATCH /baseUrl/:merchantId/conversionsources/:conversionSourceId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 506
{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.setHeader("content-type", "application/json")
.setBody("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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 \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.header("content-type", "application/json")
.body("{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}")
.asString();
const data = JSON.stringify({
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [
{
includeInReporting: false,
name: ''
}
]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {
attributionSettings: {},
currencyCode: '',
destinationId: '',
displayName: ''
},
state: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId',
headers: {'content-type': 'application/json'},
data: {
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [{includeInReporting: false, name: ''}]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {attributionSettings: {}, currencyCode: '', destinationId: '', displayName: ''},
state: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"conversionSourceId":"","expireTime":"","googleAnalyticsLink":{"attributionSettings":{"attributionLookbackWindowInDays":0,"attributionModel":"","conversionType":[{"includeInReporting":false,"name":""}]},"propertyId":"","propertyName":""},"merchantCenterDestination":{"attributionSettings":{},"currencyCode":"","destinationId":"","displayName":""},"state":""}'
};
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}}/:merchantId/conversionsources/:conversionSourceId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "conversionSourceId": "",\n "expireTime": "",\n "googleAnalyticsLink": {\n "attributionSettings": {\n "attributionLookbackWindowInDays": 0,\n "attributionModel": "",\n "conversionType": [\n {\n "includeInReporting": false,\n "name": ""\n }\n ]\n },\n "propertyId": "",\n "propertyName": ""\n },\n "merchantCenterDestination": {\n "attributionSettings": {},\n "currencyCode": "",\n "destinationId": "",\n "displayName": ""\n },\n "state": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/conversionsources/:conversionSourceId',
headers: {
'content-type': 'application/json'
}
};
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({
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [{includeInReporting: false, name: ''}]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {attributionSettings: {}, currencyCode: '', destinationId: '', displayName: ''},
state: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId',
headers: {'content-type': 'application/json'},
body: {
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [{includeInReporting: false, name: ''}]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {attributionSettings: {}, currencyCode: '', destinationId: '', displayName: ''},
state: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [
{
includeInReporting: false,
name: ''
}
]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {
attributionSettings: {},
currencyCode: '',
destinationId: '',
displayName: ''
},
state: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId',
headers: {'content-type': 'application/json'},
data: {
conversionSourceId: '',
expireTime: '',
googleAnalyticsLink: {
attributionSettings: {
attributionLookbackWindowInDays: 0,
attributionModel: '',
conversionType: [{includeInReporting: false, name: ''}]
},
propertyId: '',
propertyName: ''
},
merchantCenterDestination: {attributionSettings: {}, currencyCode: '', destinationId: '', displayName: ''},
state: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"conversionSourceId":"","expireTime":"","googleAnalyticsLink":{"attributionSettings":{"attributionLookbackWindowInDays":0,"attributionModel":"","conversionType":[{"includeInReporting":false,"name":""}]},"propertyId":"","propertyName":""},"merchantCenterDestination":{"attributionSettings":{},"currencyCode":"","destinationId":"","displayName":""},"state":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"conversionSourceId": @"",
@"expireTime": @"",
@"googleAnalyticsLink": @{ @"attributionSettings": @{ @"attributionLookbackWindowInDays": @0, @"attributionModel": @"", @"conversionType": @[ @{ @"includeInReporting": @NO, @"name": @"" } ] }, @"propertyId": @"", @"propertyName": @"" },
@"merchantCenterDestination": @{ @"attributionSettings": @{ }, @"currencyCode": @"", @"destinationId": @"", @"displayName": @"" },
@"state": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/:merchantId/conversionsources/:conversionSourceId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'conversionSourceId' => '',
'expireTime' => '',
'googleAnalyticsLink' => [
'attributionSettings' => [
'attributionLookbackWindowInDays' => 0,
'attributionModel' => '',
'conversionType' => [
[
'includeInReporting' => null,
'name' => ''
]
]
],
'propertyId' => '',
'propertyName' => ''
],
'merchantCenterDestination' => [
'attributionSettings' => [
],
'currencyCode' => '',
'destinationId' => '',
'displayName' => ''
],
'state' => ''
]),
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;
}
request('PATCH', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId', [
'body' => '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'conversionSourceId' => '',
'expireTime' => '',
'googleAnalyticsLink' => [
'attributionSettings' => [
'attributionLookbackWindowInDays' => 0,
'attributionModel' => '',
'conversionType' => [
[
'includeInReporting' => null,
'name' => ''
]
]
],
'propertyId' => '',
'propertyName' => ''
],
'merchantCenterDestination' => [
'attributionSettings' => [
],
'currencyCode' => '',
'destinationId' => '',
'displayName' => ''
],
'state' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'conversionSourceId' => '',
'expireTime' => '',
'googleAnalyticsLink' => [
'attributionSettings' => [
'attributionLookbackWindowInDays' => 0,
'attributionModel' => '',
'conversionType' => [
[
'includeInReporting' => null,
'name' => ''
]
]
],
'propertyId' => '',
'propertyName' => ''
],
'merchantCenterDestination' => [
'attributionSettings' => [
],
'currencyCode' => '',
'destinationId' => '',
'displayName' => ''
],
'state' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/:merchantId/conversionsources/:conversionSourceId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
payload = {
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": False,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId"
payload <- "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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.patch('/baseUrl/:merchantId/conversionsources/:conversionSourceId') do |req|
req.body = "{\n \"conversionSourceId\": \"\",\n \"expireTime\": \"\",\n \"googleAnalyticsLink\": {\n \"attributionSettings\": {\n \"attributionLookbackWindowInDays\": 0,\n \"attributionModel\": \"\",\n \"conversionType\": [\n {\n \"includeInReporting\": false,\n \"name\": \"\"\n }\n ]\n },\n \"propertyId\": \"\",\n \"propertyName\": \"\"\n },\n \"merchantCenterDestination\": {\n \"attributionSettings\": {},\n \"currencyCode\": \"\",\n \"destinationId\": \"\",\n \"displayName\": \"\"\n },\n \"state\": \"\"\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}}/:merchantId/conversionsources/:conversionSourceId";
let payload = json!({
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": json!({
"attributionSettings": json!({
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": (
json!({
"includeInReporting": false,
"name": ""
})
)
}),
"propertyId": "",
"propertyName": ""
}),
"merchantCenterDestination": json!({
"attributionSettings": json!({}),
"currencyCode": "",
"destinationId": "",
"displayName": ""
}),
"state": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId \
--header 'content-type: application/json' \
--data '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}'
echo '{
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": {
"attributionSettings": {
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
{
"includeInReporting": false,
"name": ""
}
]
},
"propertyId": "",
"propertyName": ""
},
"merchantCenterDestination": {
"attributionSettings": {},
"currencyCode": "",
"destinationId": "",
"displayName": ""
},
"state": ""
}' | \
http PATCH {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "conversionSourceId": "",\n "expireTime": "",\n "googleAnalyticsLink": {\n "attributionSettings": {\n "attributionLookbackWindowInDays": 0,\n "attributionModel": "",\n "conversionType": [\n {\n "includeInReporting": false,\n "name": ""\n }\n ]\n },\n "propertyId": "",\n "propertyName": ""\n },\n "merchantCenterDestination": {\n "attributionSettings": {},\n "currencyCode": "",\n "destinationId": "",\n "displayName": ""\n },\n "state": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"conversionSourceId": "",
"expireTime": "",
"googleAnalyticsLink": [
"attributionSettings": [
"attributionLookbackWindowInDays": 0,
"attributionModel": "",
"conversionType": [
[
"includeInReporting": false,
"name": ""
]
]
],
"propertyId": "",
"propertyName": ""
],
"merchantCenterDestination": [
"attributionSettings": [],
"currencyCode": "",
"destinationId": "",
"displayName": ""
],
"state": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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
content.conversionsources.undelete
{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete
QUERY PARAMS
merchantId
conversionSourceId
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/:merchantId/conversionsources/:conversionSourceId:undelete"),
Content = new StringContent("{}")
{
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}}/:merchantId/conversionsources/:conversionSourceId:undelete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete"
payload := strings.NewReader("{}")
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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/conversionsources/:conversionSourceId:undelete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/:merchantId/conversionsources/:conversionSourceId:undelete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/conversionsources/:conversionSourceId:undelete',
headers: {
'content-type': 'application/json'
}
};
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete',
headers: {'content-type': 'application/json'},
body: {},
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}}/:merchantId/conversionsources/:conversionSourceId:undelete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/:merchantId/conversionsources/:conversionSourceId:undelete',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete"]
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}}/:merchantId/conversionsources/:conversionSourceId:undelete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete",
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([
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/conversionsources/:conversionSourceId:undelete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete"
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete")
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 = "{}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/:merchantId/conversionsources/:conversionSourceId:undelete') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/conversionsources/:conversionSourceId:undelete")! 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()
GET
content.csses.get
{{baseUrl}}/:cssGroupId/csses/:cssDomainId
QUERY PARAMS
cssGroupId
cssDomainId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:cssGroupId/csses/:cssDomainId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:cssGroupId/csses/:cssDomainId")
require "http/client"
url = "{{baseUrl}}/:cssGroupId/csses/:cssDomainId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:cssGroupId/csses/:cssDomainId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:cssGroupId/csses/:cssDomainId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:cssGroupId/csses/:cssDomainId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:cssGroupId/csses/:cssDomainId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:cssGroupId/csses/:cssDomainId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:cssGroupId/csses/:cssDomainId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:cssGroupId/csses/:cssDomainId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:cssGroupId/csses/:cssDomainId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:cssGroupId/csses/:cssDomainId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:cssGroupId/csses/:cssDomainId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:cssGroupId/csses/:cssDomainId';
const options = {method: 'GET'};
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}}/:cssGroupId/csses/:cssDomainId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:cssGroupId/csses/:cssDomainId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:cssGroupId/csses/:cssDomainId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:cssGroupId/csses/:cssDomainId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:cssGroupId/csses/:cssDomainId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:cssGroupId/csses/:cssDomainId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:cssGroupId/csses/:cssDomainId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:cssGroupId/csses/:cssDomainId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:cssGroupId/csses/:cssDomainId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:cssGroupId/csses/:cssDomainId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:cssGroupId/csses/:cssDomainId');
echo $response->getBody();
setUrl('{{baseUrl}}/:cssGroupId/csses/:cssDomainId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:cssGroupId/csses/:cssDomainId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:cssGroupId/csses/:cssDomainId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:cssGroupId/csses/:cssDomainId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:cssGroupId/csses/:cssDomainId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:cssGroupId/csses/:cssDomainId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:cssGroupId/csses/:cssDomainId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:cssGroupId/csses/:cssDomainId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:cssGroupId/csses/:cssDomainId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:cssGroupId/csses/:cssDomainId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:cssGroupId/csses/:cssDomainId
http GET {{baseUrl}}/:cssGroupId/csses/:cssDomainId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:cssGroupId/csses/:cssDomainId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:cssGroupId/csses/:cssDomainId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.csses.list
{{baseUrl}}/:cssGroupId/csses
QUERY PARAMS
cssGroupId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:cssGroupId/csses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:cssGroupId/csses")
require "http/client"
url = "{{baseUrl}}/:cssGroupId/csses"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:cssGroupId/csses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:cssGroupId/csses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:cssGroupId/csses"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:cssGroupId/csses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:cssGroupId/csses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:cssGroupId/csses"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:cssGroupId/csses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:cssGroupId/csses")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:cssGroupId/csses');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:cssGroupId/csses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:cssGroupId/csses';
const options = {method: 'GET'};
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}}/:cssGroupId/csses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:cssGroupId/csses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:cssGroupId/csses',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:cssGroupId/csses'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:cssGroupId/csses');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:cssGroupId/csses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:cssGroupId/csses';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:cssGroupId/csses"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:cssGroupId/csses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:cssGroupId/csses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:cssGroupId/csses');
echo $response->getBody();
setUrl('{{baseUrl}}/:cssGroupId/csses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:cssGroupId/csses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:cssGroupId/csses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:cssGroupId/csses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:cssGroupId/csses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:cssGroupId/csses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:cssGroupId/csses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:cssGroupId/csses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:cssGroupId/csses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:cssGroupId/csses";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:cssGroupId/csses
http GET {{baseUrl}}/:cssGroupId/csses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:cssGroupId/csses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:cssGroupId/csses")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.csses.updatelabels
{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels
QUERY PARAMS
cssGroupId
cssDomainId
BODY json
{
"labelIds": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"labelIds\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels" {:content-type :json
:form-params {:labelIds []}})
require "http/client"
url = "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"labelIds\": []\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}}/:cssGroupId/csses/:cssDomainId/updatelabels"),
Content = new StringContent("{\n \"labelIds\": []\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}}/:cssGroupId/csses/:cssDomainId/updatelabels");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"labelIds\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels"
payload := strings.NewReader("{\n \"labelIds\": []\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:cssGroupId/csses/:cssDomainId/updatelabels HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"labelIds": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels")
.setHeader("content-type", "application/json")
.setBody("{\n \"labelIds\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"labelIds\": []\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 \"labelIds\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels")
.header("content-type", "application/json")
.body("{\n \"labelIds\": []\n}")
.asString();
const data = JSON.stringify({
labelIds: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels',
headers: {'content-type': 'application/json'},
data: {labelIds: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"labelIds":[]}'
};
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}}/:cssGroupId/csses/:cssDomainId/updatelabels',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "labelIds": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"labelIds\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:cssGroupId/csses/:cssDomainId/updatelabels',
headers: {
'content-type': 'application/json'
}
};
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({labelIds: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels',
headers: {'content-type': 'application/json'},
body: {labelIds: []},
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}}/:cssGroupId/csses/:cssDomainId/updatelabels');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
labelIds: []
});
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}}/:cssGroupId/csses/:cssDomainId/updatelabels',
headers: {'content-type': 'application/json'},
data: {labelIds: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"labelIds":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"labelIds": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels"]
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}}/:cssGroupId/csses/:cssDomainId/updatelabels" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"labelIds\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels",
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([
'labelIds' => [
]
]),
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;
}
request('POST', '{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels', [
'body' => '{
"labelIds": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'labelIds' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'labelIds' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"labelIds": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"labelIds": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"labelIds\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:cssGroupId/csses/:cssDomainId/updatelabels", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels"
payload = { "labelIds": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels"
payload <- "{\n \"labelIds\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels")
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 \"labelIds\": []\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.post('/baseUrl/:cssGroupId/csses/:cssDomainId/updatelabels') do |req|
req.body = "{\n \"labelIds\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels";
let payload = json!({"labelIds": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels \
--header 'content-type: application/json' \
--data '{
"labelIds": []
}'
echo '{
"labelIds": []
}' | \
http POST {{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "labelIds": []\n}' \
--output-document \
- {{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["labelIds": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:cssGroupId/csses/:cssDomainId/updatelabels")! 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()
POST
content.datafeeds.custombatch
{{baseUrl}}/datafeeds/batch
BODY json
{
"entries": [
{
"batchId": 0,
"datafeed": {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
},
"datafeedId": "",
"merchantId": "",
"method": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/datafeeds/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/datafeeds/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:datafeed {:attributeLanguage ""
:contentType ""
:fetchSchedule {:dayOfMonth 0
:fetchUrl ""
:hour 0
:minuteOfHour 0
:password ""
:paused false
:timeZone ""
:username ""
:weekday ""}
:fileName ""
:format {:columnDelimiter ""
:fileEncoding ""
:quotingMode ""}
:id ""
:kind ""
:name ""
:targets [{:country ""
:excludedDestinations []
:feedLabel ""
:includedDestinations []
:language ""
:targetCountries []}]}
:datafeedId ""
:merchantId ""
:method ""}]}})
require "http/client"
url = "{{baseUrl}}/datafeeds/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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}}/datafeeds/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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}}/datafeeds/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/datafeeds/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/datafeeds/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 937
{
"entries": [
{
"batchId": 0,
"datafeed": {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
},
"datafeedId": "",
"merchantId": "",
"method": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/datafeeds/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/datafeeds/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/datafeeds/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/datafeeds/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
datafeed: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {
columnDelimiter: '',
fileEncoding: '',
quotingMode: ''
},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
},
datafeedId: '',
merchantId: '',
method: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/datafeeds/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/datafeeds/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
datafeed: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
},
datafeedId: '',
merchantId: '',
method: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/datafeeds/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"datafeed":{"attributeLanguage":"","contentType":"","fetchSchedule":{"dayOfMonth":0,"fetchUrl":"","hour":0,"minuteOfHour":0,"password":"","paused":false,"timeZone":"","username":"","weekday":""},"fileName":"","format":{"columnDelimiter":"","fileEncoding":"","quotingMode":""},"id":"","kind":"","name":"","targets":[{"country":"","excludedDestinations":[],"feedLabel":"","includedDestinations":[],"language":"","targetCountries":[]}]},"datafeedId":"","merchantId":"","method":""}]}'
};
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}}/datafeeds/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "datafeed": {\n "attributeLanguage": "",\n "contentType": "",\n "fetchSchedule": {\n "dayOfMonth": 0,\n "fetchUrl": "",\n "hour": 0,\n "minuteOfHour": 0,\n "password": "",\n "paused": false,\n "timeZone": "",\n "username": "",\n "weekday": ""\n },\n "fileName": "",\n "format": {\n "columnDelimiter": "",\n "fileEncoding": "",\n "quotingMode": ""\n },\n "id": "",\n "kind": "",\n "name": "",\n "targets": [\n {\n "country": "",\n "excludedDestinations": [],\n "feedLabel": "",\n "includedDestinations": [],\n "language": "",\n "targetCountries": []\n }\n ]\n },\n "datafeedId": "",\n "merchantId": "",\n "method": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/datafeeds/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/datafeeds/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
datafeed: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
},
datafeedId: '',
merchantId: '',
method: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/datafeeds/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
datafeed: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
},
datafeedId: '',
merchantId: '',
method: ''
}
]
},
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}}/datafeeds/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
datafeed: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {
columnDelimiter: '',
fileEncoding: '',
quotingMode: ''
},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
},
datafeedId: '',
merchantId: '',
method: ''
}
]
});
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}}/datafeeds/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
datafeed: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
},
datafeedId: '',
merchantId: '',
method: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/datafeeds/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"datafeed":{"attributeLanguage":"","contentType":"","fetchSchedule":{"dayOfMonth":0,"fetchUrl":"","hour":0,"minuteOfHour":0,"password":"","paused":false,"timeZone":"","username":"","weekday":""},"fileName":"","format":{"columnDelimiter":"","fileEncoding":"","quotingMode":""},"id":"","kind":"","name":"","targets":[{"country":"","excludedDestinations":[],"feedLabel":"","includedDestinations":[],"language":"","targetCountries":[]}]},"datafeedId":"","merchantId":"","method":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"datafeed": @{ @"attributeLanguage": @"", @"contentType": @"", @"fetchSchedule": @{ @"dayOfMonth": @0, @"fetchUrl": @"", @"hour": @0, @"minuteOfHour": @0, @"password": @"", @"paused": @NO, @"timeZone": @"", @"username": @"", @"weekday": @"" }, @"fileName": @"", @"format": @{ @"columnDelimiter": @"", @"fileEncoding": @"", @"quotingMode": @"" }, @"id": @"", @"kind": @"", @"name": @"", @"targets": @[ @{ @"country": @"", @"excludedDestinations": @[ ], @"feedLabel": @"", @"includedDestinations": @[ ], @"language": @"", @"targetCountries": @[ ] } ] }, @"datafeedId": @"", @"merchantId": @"", @"method": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/datafeeds/batch"]
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}}/datafeeds/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/datafeeds/batch",
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([
'entries' => [
[
'batchId' => 0,
'datafeed' => [
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
],
'datafeedId' => '',
'merchantId' => '',
'method' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/datafeeds/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"datafeed": {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
},
"datafeedId": "",
"merchantId": "",
"method": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/datafeeds/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'datafeed' => [
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
],
'datafeedId' => '',
'merchantId' => '',
'method' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'datafeed' => [
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
],
'datafeedId' => '',
'merchantId' => '',
'method' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/datafeeds/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/datafeeds/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"datafeed": {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
},
"datafeedId": "",
"merchantId": "",
"method": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/datafeeds/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"datafeed": {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
},
"datafeedId": "",
"merchantId": "",
"method": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/datafeeds/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/datafeeds/batch"
payload = { "entries": [
{
"batchId": 0,
"datafeed": {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": False,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
},
"datafeedId": "",
"merchantId": "",
"method": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/datafeeds/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/datafeeds/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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.post('/baseUrl/datafeeds/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"datafeed\": {\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n },\n \"datafeedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/datafeeds/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"datafeed": json!({
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": json!({
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
}),
"fileName": "",
"format": json!({
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
}),
"id": "",
"kind": "",
"name": "",
"targets": (
json!({
"country": "",
"excludedDestinations": (),
"feedLabel": "",
"includedDestinations": (),
"language": "",
"targetCountries": ()
})
)
}),
"datafeedId": "",
"merchantId": "",
"method": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/datafeeds/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"datafeed": {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
},
"datafeedId": "",
"merchantId": "",
"method": ""
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"datafeed": {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
},
"datafeedId": "",
"merchantId": "",
"method": ""
}
]
}' | \
http POST {{baseUrl}}/datafeeds/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "datafeed": {\n "attributeLanguage": "",\n "contentType": "",\n "fetchSchedule": {\n "dayOfMonth": 0,\n "fetchUrl": "",\n "hour": 0,\n "minuteOfHour": 0,\n "password": "",\n "paused": false,\n "timeZone": "",\n "username": "",\n "weekday": ""\n },\n "fileName": "",\n "format": {\n "columnDelimiter": "",\n "fileEncoding": "",\n "quotingMode": ""\n },\n "id": "",\n "kind": "",\n "name": "",\n "targets": [\n {\n "country": "",\n "excludedDestinations": [],\n "feedLabel": "",\n "includedDestinations": [],\n "language": "",\n "targetCountries": []\n }\n ]\n },\n "datafeedId": "",\n "merchantId": "",\n "method": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/datafeeds/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"datafeed": [
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": [
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
],
"fileName": "",
"format": [
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
],
"id": "",
"kind": "",
"name": "",
"targets": [
[
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
]
]
],
"datafeedId": "",
"merchantId": "",
"method": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/datafeeds/batch")! 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()
DELETE
content.datafeeds.delete
{{baseUrl}}/:merchantId/datafeeds/:datafeedId
QUERY PARAMS
merchantId
datafeedId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/datafeeds/:datafeedId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
require "http/client"
url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/datafeeds/:datafeedId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/datafeeds/:datafeedId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/datafeeds/:datafeedId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/datafeeds/:datafeedId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/datafeeds/:datafeedId';
const options = {method: 'DELETE'};
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}}/:merchantId/datafeeds/:datafeedId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/datafeeds/:datafeedId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/datafeeds/:datafeedId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/datafeeds/:datafeedId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/datafeeds/:datafeedId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/datafeeds/:datafeedId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/datafeeds/:datafeedId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/datafeeds/:datafeedId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/datafeeds/:datafeedId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/datafeeds/:datafeedId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/datafeeds/:datafeedId
http DELETE {{baseUrl}}/:merchantId/datafeeds/:datafeedId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/datafeeds/:datafeedId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/datafeeds/:datafeedId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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
content.datafeeds.fetchnow
{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow
QUERY PARAMS
merchantId
datafeedId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow")
require "http/client"
url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/datafeeds/:datafeedId/fetchNow HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow';
const options = {method: 'POST'};
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}}/:merchantId/datafeeds/:datafeedId/fetchNow',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/datafeeds/:datafeedId/fetchNow',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow');
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}}/:merchantId/datafeeds/:datafeedId/fetchNow'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/:merchantId/datafeeds/:datafeedId/fetchNow" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/:merchantId/datafeeds/:datafeedId/fetchNow")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/:merchantId/datafeeds/:datafeedId/fetchNow') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow
http POST {{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/datafeeds/:datafeedId/fetchNow")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
GET
content.datafeeds.get
{{baseUrl}}/:merchantId/datafeeds/:datafeedId
QUERY PARAMS
merchantId
datafeedId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/datafeeds/:datafeedId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
require "http/client"
url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/datafeeds/:datafeedId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/datafeeds/:datafeedId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/datafeeds/:datafeedId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/datafeeds/:datafeedId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/datafeeds/:datafeedId';
const options = {method: 'GET'};
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}}/:merchantId/datafeeds/:datafeedId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/datafeeds/:datafeedId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/datafeeds/:datafeedId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/datafeeds/:datafeedId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/datafeeds/:datafeedId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/datafeeds/:datafeedId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/datafeeds/:datafeedId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/datafeeds/:datafeedId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/datafeeds/:datafeedId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/datafeeds/:datafeedId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/datafeeds/:datafeedId
http GET {{baseUrl}}/:merchantId/datafeeds/:datafeedId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/datafeeds/:datafeedId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/datafeeds/:datafeedId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.datafeeds.insert
{{baseUrl}}/:merchantId/datafeeds
QUERY PARAMS
merchantId
BODY json
{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/datafeeds");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/datafeeds" {:content-type :json
:form-params {:attributeLanguage ""
:contentType ""
:fetchSchedule {:dayOfMonth 0
:fetchUrl ""
:hour 0
:minuteOfHour 0
:password ""
:paused false
:timeZone ""
:username ""
:weekday ""}
:fileName ""
:format {:columnDelimiter ""
:fileEncoding ""
:quotingMode ""}
:id ""
:kind ""
:name ""
:targets [{:country ""
:excludedDestinations []
:feedLabel ""
:includedDestinations []
:language ""
:targetCountries []}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/datafeeds"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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}}/:merchantId/datafeeds"),
Content = new StringContent("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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}}/:merchantId/datafeeds");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/datafeeds"
payload := strings.NewReader("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/datafeeds HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 598
{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/datafeeds")
.setHeader("content-type", "application/json")
.setBody("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/datafeeds"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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 \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/datafeeds")
.header("content-type", "application/json")
.body("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}")
.asString();
const data = JSON.stringify({
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {
columnDelimiter: '',
fileEncoding: '',
quotingMode: ''
},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/datafeeds');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/datafeeds',
headers: {'content-type': 'application/json'},
data: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/datafeeds';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attributeLanguage":"","contentType":"","fetchSchedule":{"dayOfMonth":0,"fetchUrl":"","hour":0,"minuteOfHour":0,"password":"","paused":false,"timeZone":"","username":"","weekday":""},"fileName":"","format":{"columnDelimiter":"","fileEncoding":"","quotingMode":""},"id":"","kind":"","name":"","targets":[{"country":"","excludedDestinations":[],"feedLabel":"","includedDestinations":[],"language":"","targetCountries":[]}]}'
};
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}}/:merchantId/datafeeds',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "attributeLanguage": "",\n "contentType": "",\n "fetchSchedule": {\n "dayOfMonth": 0,\n "fetchUrl": "",\n "hour": 0,\n "minuteOfHour": 0,\n "password": "",\n "paused": false,\n "timeZone": "",\n "username": "",\n "weekday": ""\n },\n "fileName": "",\n "format": {\n "columnDelimiter": "",\n "fileEncoding": "",\n "quotingMode": ""\n },\n "id": "",\n "kind": "",\n "name": "",\n "targets": [\n {\n "country": "",\n "excludedDestinations": [],\n "feedLabel": "",\n "includedDestinations": [],\n "language": "",\n "targetCountries": []\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/datafeeds',
headers: {
'content-type': 'application/json'
}
};
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({
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/datafeeds',
headers: {'content-type': 'application/json'},
body: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
},
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}}/:merchantId/datafeeds');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {
columnDelimiter: '',
fileEncoding: '',
quotingMode: ''
},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
});
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}}/:merchantId/datafeeds',
headers: {'content-type': 'application/json'},
data: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/datafeeds';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attributeLanguage":"","contentType":"","fetchSchedule":{"dayOfMonth":0,"fetchUrl":"","hour":0,"minuteOfHour":0,"password":"","paused":false,"timeZone":"","username":"","weekday":""},"fileName":"","format":{"columnDelimiter":"","fileEncoding":"","quotingMode":""},"id":"","kind":"","name":"","targets":[{"country":"","excludedDestinations":[],"feedLabel":"","includedDestinations":[],"language":"","targetCountries":[]}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"attributeLanguage": @"",
@"contentType": @"",
@"fetchSchedule": @{ @"dayOfMonth": @0, @"fetchUrl": @"", @"hour": @0, @"minuteOfHour": @0, @"password": @"", @"paused": @NO, @"timeZone": @"", @"username": @"", @"weekday": @"" },
@"fileName": @"",
@"format": @{ @"columnDelimiter": @"", @"fileEncoding": @"", @"quotingMode": @"" },
@"id": @"",
@"kind": @"",
@"name": @"",
@"targets": @[ @{ @"country": @"", @"excludedDestinations": @[ ], @"feedLabel": @"", @"includedDestinations": @[ ], @"language": @"", @"targetCountries": @[ ] } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/datafeeds"]
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}}/:merchantId/datafeeds" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/datafeeds",
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([
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/datafeeds', [
'body' => '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/datafeeds');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/datafeeds');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/datafeeds' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/datafeeds' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/datafeeds", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/datafeeds"
payload = {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": False,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/datafeeds"
payload <- "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/datafeeds")
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 \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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.post('/baseUrl/:merchantId/datafeeds') do |req|
req.body = "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/datafeeds";
let payload = json!({
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": json!({
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
}),
"fileName": "",
"format": json!({
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
}),
"id": "",
"kind": "",
"name": "",
"targets": (
json!({
"country": "",
"excludedDestinations": (),
"feedLabel": "",
"includedDestinations": (),
"language": "",
"targetCountries": ()
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/datafeeds \
--header 'content-type: application/json' \
--data '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}'
echo '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}' | \
http POST {{baseUrl}}/:merchantId/datafeeds \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "attributeLanguage": "",\n "contentType": "",\n "fetchSchedule": {\n "dayOfMonth": 0,\n "fetchUrl": "",\n "hour": 0,\n "minuteOfHour": 0,\n "password": "",\n "paused": false,\n "timeZone": "",\n "username": "",\n "weekday": ""\n },\n "fileName": "",\n "format": {\n "columnDelimiter": "",\n "fileEncoding": "",\n "quotingMode": ""\n },\n "id": "",\n "kind": "",\n "name": "",\n "targets": [\n {\n "country": "",\n "excludedDestinations": [],\n "feedLabel": "",\n "includedDestinations": [],\n "language": "",\n "targetCountries": []\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/datafeeds
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": [
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
],
"fileName": "",
"format": [
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
],
"id": "",
"kind": "",
"name": "",
"targets": [
[
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/datafeeds")! 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()
GET
content.datafeeds.list
{{baseUrl}}/:merchantId/datafeeds
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/datafeeds");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/datafeeds")
require "http/client"
url = "{{baseUrl}}/:merchantId/datafeeds"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/datafeeds"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/datafeeds");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/datafeeds"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/datafeeds HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/datafeeds")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/datafeeds"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/datafeeds")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/datafeeds');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/datafeeds'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/datafeeds';
const options = {method: 'GET'};
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}}/:merchantId/datafeeds',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/datafeeds',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/datafeeds'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/datafeeds');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/datafeeds'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/datafeeds';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/datafeeds"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/datafeeds" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/datafeeds",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/datafeeds');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/datafeeds');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/datafeeds');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/datafeeds' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/datafeeds' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/datafeeds")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/datafeeds"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/datafeeds"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/datafeeds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/datafeeds') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/datafeeds";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/datafeeds
http GET {{baseUrl}}/:merchantId/datafeeds
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/datafeeds
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/datafeeds")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PUT
content.datafeeds.update
{{baseUrl}}/:merchantId/datafeeds/:datafeedId
QUERY PARAMS
merchantId
datafeedId
BODY json
{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/datafeeds/:datafeedId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/:merchantId/datafeeds/:datafeedId" {:content-type :json
:form-params {:attributeLanguage ""
:contentType ""
:fetchSchedule {:dayOfMonth 0
:fetchUrl ""
:hour 0
:minuteOfHour 0
:password ""
:paused false
:timeZone ""
:username ""
:weekday ""}
:fileName ""
:format {:columnDelimiter ""
:fileEncoding ""
:quotingMode ""}
:id ""
:kind ""
:name ""
:targets [{:country ""
:excludedDestinations []
:feedLabel ""
:includedDestinations []
:language ""
:targetCountries []}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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}}/:merchantId/datafeeds/:datafeedId"),
Content = new StringContent("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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}}/:merchantId/datafeeds/:datafeedId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
payload := strings.NewReader("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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(res)
fmt.Println(string(body))
}
PUT /baseUrl/:merchantId/datafeeds/:datafeedId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 598
{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.setHeader("content-type", "application/json")
.setBody("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/datafeeds/:datafeedId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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 \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.header("content-type", "application/json")
.body("{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}")
.asString();
const data = JSON.stringify({
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {
columnDelimiter: '',
fileEncoding: '',
quotingMode: ''
},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId',
headers: {'content-type': 'application/json'},
data: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/datafeeds/:datafeedId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"attributeLanguage":"","contentType":"","fetchSchedule":{"dayOfMonth":0,"fetchUrl":"","hour":0,"minuteOfHour":0,"password":"","paused":false,"timeZone":"","username":"","weekday":""},"fileName":"","format":{"columnDelimiter":"","fileEncoding":"","quotingMode":""},"id":"","kind":"","name":"","targets":[{"country":"","excludedDestinations":[],"feedLabel":"","includedDestinations":[],"language":"","targetCountries":[]}]}'
};
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}}/:merchantId/datafeeds/:datafeedId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "attributeLanguage": "",\n "contentType": "",\n "fetchSchedule": {\n "dayOfMonth": 0,\n "fetchUrl": "",\n "hour": 0,\n "minuteOfHour": 0,\n "password": "",\n "paused": false,\n "timeZone": "",\n "username": "",\n "weekday": ""\n },\n "fileName": "",\n "format": {\n "columnDelimiter": "",\n "fileEncoding": "",\n "quotingMode": ""\n },\n "id": "",\n "kind": "",\n "name": "",\n "targets": [\n {\n "country": "",\n "excludedDestinations": [],\n "feedLabel": "",\n "includedDestinations": [],\n "language": "",\n "targetCountries": []\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/datafeeds/:datafeedId',
headers: {
'content-type': 'application/json'
}
};
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({
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/datafeeds/:datafeedId',
headers: {'content-type': 'application/json'},
body: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
},
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}}/:merchantId/datafeeds/:datafeedId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {
columnDelimiter: '',
fileEncoding: '',
quotingMode: ''
},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
});
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}}/:merchantId/datafeeds/:datafeedId',
headers: {'content-type': 'application/json'},
data: {
attributeLanguage: '',
contentType: '',
fetchSchedule: {
dayOfMonth: 0,
fetchUrl: '',
hour: 0,
minuteOfHour: 0,
password: '',
paused: false,
timeZone: '',
username: '',
weekday: ''
},
fileName: '',
format: {columnDelimiter: '', fileEncoding: '', quotingMode: ''},
id: '',
kind: '',
name: '',
targets: [
{
country: '',
excludedDestinations: [],
feedLabel: '',
includedDestinations: [],
language: '',
targetCountries: []
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/datafeeds/:datafeedId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"attributeLanguage":"","contentType":"","fetchSchedule":{"dayOfMonth":0,"fetchUrl":"","hour":0,"minuteOfHour":0,"password":"","paused":false,"timeZone":"","username":"","weekday":""},"fileName":"","format":{"columnDelimiter":"","fileEncoding":"","quotingMode":""},"id":"","kind":"","name":"","targets":[{"country":"","excludedDestinations":[],"feedLabel":"","includedDestinations":[],"language":"","targetCountries":[]}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"attributeLanguage": @"",
@"contentType": @"",
@"fetchSchedule": @{ @"dayOfMonth": @0, @"fetchUrl": @"", @"hour": @0, @"minuteOfHour": @0, @"password": @"", @"paused": @NO, @"timeZone": @"", @"username": @"", @"weekday": @"" },
@"fileName": @"",
@"format": @{ @"columnDelimiter": @"", @"fileEncoding": @"", @"quotingMode": @"" },
@"id": @"",
@"kind": @"",
@"name": @"",
@"targets": @[ @{ @"country": @"", @"excludedDestinations": @[ ], @"feedLabel": @"", @"includedDestinations": @[ ], @"language": @"", @"targetCountries": @[ ] } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/datafeeds/:datafeedId"]
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}}/:merchantId/datafeeds/:datafeedId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/datafeeds/:datafeedId",
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([
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
]),
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;
}
request('PUT', '{{baseUrl}}/:merchantId/datafeeds/:datafeedId', [
'body' => '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attributeLanguage' => '',
'contentType' => '',
'fetchSchedule' => [
'dayOfMonth' => 0,
'fetchUrl' => '',
'hour' => 0,
'minuteOfHour' => 0,
'password' => '',
'paused' => null,
'timeZone' => '',
'username' => '',
'weekday' => ''
],
'fileName' => '',
'format' => [
'columnDelimiter' => '',
'fileEncoding' => '',
'quotingMode' => ''
],
'id' => '',
'kind' => '',
'name' => '',
'targets' => [
[
'country' => '',
'excludedDestinations' => [
],
'feedLabel' => '',
'includedDestinations' => [
],
'language' => '',
'targetCountries' => [
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/datafeeds/:datafeedId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/datafeeds/:datafeedId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/datafeeds/:datafeedId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/:merchantId/datafeeds/:datafeedId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
payload = {
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": False,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/datafeeds/:datafeedId"
payload <- "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/datafeeds/:datafeedId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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/:merchantId/datafeeds/:datafeedId') do |req|
req.body = "{\n \"attributeLanguage\": \"\",\n \"contentType\": \"\",\n \"fetchSchedule\": {\n \"dayOfMonth\": 0,\n \"fetchUrl\": \"\",\n \"hour\": 0,\n \"minuteOfHour\": 0,\n \"password\": \"\",\n \"paused\": false,\n \"timeZone\": \"\",\n \"username\": \"\",\n \"weekday\": \"\"\n },\n \"fileName\": \"\",\n \"format\": {\n \"columnDelimiter\": \"\",\n \"fileEncoding\": \"\",\n \"quotingMode\": \"\"\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"targets\": [\n {\n \"country\": \"\",\n \"excludedDestinations\": [],\n \"feedLabel\": \"\",\n \"includedDestinations\": [],\n \"language\": \"\",\n \"targetCountries\": []\n }\n ]\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}}/:merchantId/datafeeds/:datafeedId";
let payload = json!({
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": json!({
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
}),
"fileName": "",
"format": json!({
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
}),
"id": "",
"kind": "",
"name": "",
"targets": (
json!({
"country": "",
"excludedDestinations": (),
"feedLabel": "",
"includedDestinations": (),
"language": "",
"targetCountries": ()
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".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}}/:merchantId/datafeeds/:datafeedId \
--header 'content-type: application/json' \
--data '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}'
echo '{
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": {
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
},
"fileName": "",
"format": {
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
},
"id": "",
"kind": "",
"name": "",
"targets": [
{
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
}
]
}' | \
http PUT {{baseUrl}}/:merchantId/datafeeds/:datafeedId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "attributeLanguage": "",\n "contentType": "",\n "fetchSchedule": {\n "dayOfMonth": 0,\n "fetchUrl": "",\n "hour": 0,\n "minuteOfHour": 0,\n "password": "",\n "paused": false,\n "timeZone": "",\n "username": "",\n "weekday": ""\n },\n "fileName": "",\n "format": {\n "columnDelimiter": "",\n "fileEncoding": "",\n "quotingMode": ""\n },\n "id": "",\n "kind": "",\n "name": "",\n "targets": [\n {\n "country": "",\n "excludedDestinations": [],\n "feedLabel": "",\n "includedDestinations": [],\n "language": "",\n "targetCountries": []\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/datafeeds/:datafeedId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"attributeLanguage": "",
"contentType": "",
"fetchSchedule": [
"dayOfMonth": 0,
"fetchUrl": "",
"hour": 0,
"minuteOfHour": 0,
"password": "",
"paused": false,
"timeZone": "",
"username": "",
"weekday": ""
],
"fileName": "",
"format": [
"columnDelimiter": "",
"fileEncoding": "",
"quotingMode": ""
],
"id": "",
"kind": "",
"name": "",
"targets": [
[
"country": "",
"excludedDestinations": [],
"feedLabel": "",
"includedDestinations": [],
"language": "",
"targetCountries": []
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/datafeeds/:datafeedId")! 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
content.datafeedstatuses.custombatch
{{baseUrl}}/datafeedstatuses/batch
BODY json
{
"entries": [
{
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/datafeedstatuses/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/datafeedstatuses/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:country ""
:datafeedId ""
:feedLabel ""
:language ""
:merchantId ""
:method ""}]}})
require "http/client"
url = "{{baseUrl}}/datafeedstatuses/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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}}/datafeedstatuses/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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}}/datafeedstatuses/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/datafeedstatuses/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/datafeedstatuses/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 187
{
"entries": [
{
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/datafeedstatuses/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/datafeedstatuses/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/datafeedstatuses/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/datafeedstatuses/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
country: '',
datafeedId: '',
feedLabel: '',
language: '',
merchantId: '',
method: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/datafeedstatuses/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/datafeedstatuses/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
country: '',
datafeedId: '',
feedLabel: '',
language: '',
merchantId: '',
method: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/datafeedstatuses/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"country":"","datafeedId":"","feedLabel":"","language":"","merchantId":"","method":""}]}'
};
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}}/datafeedstatuses/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "country": "",\n "datafeedId": "",\n "feedLabel": "",\n "language": "",\n "merchantId": "",\n "method": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/datafeedstatuses/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/datafeedstatuses/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
country: '',
datafeedId: '',
feedLabel: '',
language: '',
merchantId: '',
method: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/datafeedstatuses/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
country: '',
datafeedId: '',
feedLabel: '',
language: '',
merchantId: '',
method: ''
}
]
},
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}}/datafeedstatuses/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
country: '',
datafeedId: '',
feedLabel: '',
language: '',
merchantId: '',
method: ''
}
]
});
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}}/datafeedstatuses/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
country: '',
datafeedId: '',
feedLabel: '',
language: '',
merchantId: '',
method: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/datafeedstatuses/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"country":"","datafeedId":"","feedLabel":"","language":"","merchantId":"","method":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"country": @"", @"datafeedId": @"", @"feedLabel": @"", @"language": @"", @"merchantId": @"", @"method": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/datafeedstatuses/batch"]
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}}/datafeedstatuses/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/datafeedstatuses/batch",
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([
'entries' => [
[
'batchId' => 0,
'country' => '',
'datafeedId' => '',
'feedLabel' => '',
'language' => '',
'merchantId' => '',
'method' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/datafeedstatuses/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/datafeedstatuses/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'country' => '',
'datafeedId' => '',
'feedLabel' => '',
'language' => '',
'merchantId' => '',
'method' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'country' => '',
'datafeedId' => '',
'feedLabel' => '',
'language' => '',
'merchantId' => '',
'method' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/datafeedstatuses/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/datafeedstatuses/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/datafeedstatuses/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/datafeedstatuses/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/datafeedstatuses/batch"
payload = { "entries": [
{
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/datafeedstatuses/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/datafeedstatuses/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\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.post('/baseUrl/datafeedstatuses/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"country\": \"\",\n \"datafeedId\": \"\",\n \"feedLabel\": \"\",\n \"language\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/datafeedstatuses/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/datafeedstatuses/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
}
]
}' | \
http POST {{baseUrl}}/datafeedstatuses/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "country": "",\n "datafeedId": "",\n "feedLabel": "",\n "language": "",\n "merchantId": "",\n "method": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/datafeedstatuses/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"country": "",
"datafeedId": "",
"feedLabel": "",
"language": "",
"merchantId": "",
"method": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/datafeedstatuses/batch")! 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()
GET
content.datafeedstatuses.get
{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId
QUERY PARAMS
merchantId
datafeedId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId")
require "http/client"
url = "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/datafeedstatuses/:datafeedId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId';
const options = {method: 'GET'};
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}}/:merchantId/datafeedstatuses/:datafeedId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/datafeedstatuses/:datafeedId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/datafeedstatuses/:datafeedId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/datafeedstatuses/:datafeedId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/datafeedstatuses/:datafeedId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId
http GET {{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/datafeedstatuses/:datafeedId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.datafeedstatuses.list
{{baseUrl}}/:merchantId/datafeedstatuses
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/datafeedstatuses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/datafeedstatuses")
require "http/client"
url = "{{baseUrl}}/:merchantId/datafeedstatuses"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/datafeedstatuses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/datafeedstatuses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/datafeedstatuses"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/datafeedstatuses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/datafeedstatuses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/datafeedstatuses"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeedstatuses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/datafeedstatuses")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/datafeedstatuses');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/datafeedstatuses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/datafeedstatuses';
const options = {method: 'GET'};
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}}/:merchantId/datafeedstatuses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/datafeedstatuses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/datafeedstatuses',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/datafeedstatuses'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/datafeedstatuses');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/datafeedstatuses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/datafeedstatuses';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/datafeedstatuses"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/datafeedstatuses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/datafeedstatuses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/datafeedstatuses');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/datafeedstatuses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/datafeedstatuses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/datafeedstatuses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/datafeedstatuses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/datafeedstatuses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/datafeedstatuses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/datafeedstatuses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/datafeedstatuses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/datafeedstatuses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/datafeedstatuses";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/datafeedstatuses
http GET {{baseUrl}}/:merchantId/datafeedstatuses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/datafeedstatuses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/datafeedstatuses")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.freelistingsprogram.get
{{baseUrl}}/:merchantId/freelistingsprogram
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/freelistingsprogram");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/freelistingsprogram")
require "http/client"
url = "{{baseUrl}}/:merchantId/freelistingsprogram"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/freelistingsprogram"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/freelistingsprogram");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/freelistingsprogram"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/freelistingsprogram HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/freelistingsprogram")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/freelistingsprogram"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/freelistingsprogram")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/freelistingsprogram")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/freelistingsprogram');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/freelistingsprogram'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/freelistingsprogram';
const options = {method: 'GET'};
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}}/:merchantId/freelistingsprogram',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/freelistingsprogram")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/freelistingsprogram',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/freelistingsprogram'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/freelistingsprogram');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/freelistingsprogram'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/freelistingsprogram';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/freelistingsprogram"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/freelistingsprogram" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/freelistingsprogram",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/freelistingsprogram');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/freelistingsprogram');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/freelistingsprogram');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/freelistingsprogram' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/freelistingsprogram' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/freelistingsprogram")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/freelistingsprogram"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/freelistingsprogram"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/freelistingsprogram")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/freelistingsprogram') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/freelistingsprogram";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/freelistingsprogram
http GET {{baseUrl}}/:merchantId/freelistingsprogram
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/freelistingsprogram
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/freelistingsprogram")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.freelistingsprogram.requestreview
{{baseUrl}}/:merchantId/freelistingsprogram/requestreview
QUERY PARAMS
merchantId
BODY json
{
"regionCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"regionCode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview" {:content-type :json
:form-params {:regionCode ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"regionCode\": \"\"\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}}/:merchantId/freelistingsprogram/requestreview"),
Content = new StringContent("{\n \"regionCode\": \"\"\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}}/:merchantId/freelistingsprogram/requestreview");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"regionCode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview"
payload := strings.NewReader("{\n \"regionCode\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/freelistingsprogram/requestreview HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"regionCode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview")
.setHeader("content-type", "application/json")
.setBody("{\n \"regionCode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/freelistingsprogram/requestreview"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"regionCode\": \"\"\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 \"regionCode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/freelistingsprogram/requestreview")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/freelistingsprogram/requestreview")
.header("content-type", "application/json")
.body("{\n \"regionCode\": \"\"\n}")
.asString();
const data = JSON.stringify({
regionCode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/freelistingsprogram/requestreview');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/freelistingsprogram/requestreview',
headers: {'content-type': 'application/json'},
data: {regionCode: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/freelistingsprogram/requestreview';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"regionCode":""}'
};
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}}/:merchantId/freelistingsprogram/requestreview',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "regionCode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"regionCode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/freelistingsprogram/requestreview")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/freelistingsprogram/requestreview',
headers: {
'content-type': 'application/json'
}
};
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({regionCode: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/freelistingsprogram/requestreview',
headers: {'content-type': 'application/json'},
body: {regionCode: ''},
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}}/:merchantId/freelistingsprogram/requestreview');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
regionCode: ''
});
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}}/:merchantId/freelistingsprogram/requestreview',
headers: {'content-type': 'application/json'},
data: {regionCode: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/freelistingsprogram/requestreview';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"regionCode":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"regionCode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/freelistingsprogram/requestreview"]
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}}/:merchantId/freelistingsprogram/requestreview" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"regionCode\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/freelistingsprogram/requestreview",
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([
'regionCode' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/freelistingsprogram/requestreview', [
'body' => '{
"regionCode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/freelistingsprogram/requestreview');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'regionCode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'regionCode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/freelistingsprogram/requestreview');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/freelistingsprogram/requestreview' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"regionCode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/freelistingsprogram/requestreview' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"regionCode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"regionCode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/freelistingsprogram/requestreview", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview"
payload = { "regionCode": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview"
payload <- "{\n \"regionCode\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/freelistingsprogram/requestreview")
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 \"regionCode\": \"\"\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.post('/baseUrl/:merchantId/freelistingsprogram/requestreview') do |req|
req.body = "{\n \"regionCode\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview";
let payload = json!({"regionCode": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/freelistingsprogram/requestreview \
--header 'content-type: application/json' \
--data '{
"regionCode": ""
}'
echo '{
"regionCode": ""
}' | \
http POST {{baseUrl}}/:merchantId/freelistingsprogram/requestreview \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "regionCode": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/freelistingsprogram/requestreview
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["regionCode": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/freelistingsprogram/requestreview")! 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()
POST
content.liasettings.custombatch
{{baseUrl}}/liasettings/batch
BODY json
{
"entries": [
{
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
},
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/liasettings/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/liasettings/batch" {:content-type :json
:form-params {:entries [{:accountId ""
:batchId 0
:contactEmail ""
:contactName ""
:country ""
:gmbEmail ""
:liaSettings {:accountId ""
:countrySettings [{:about {:status ""
:url ""}
:country ""
:hostedLocalStorefrontActive false
:inventory {:inventoryVerificationContactEmail ""
:inventoryVerificationContactName ""
:inventoryVerificationContactStatus ""
:status ""}
:onDisplayToOrder {:shippingCostPolicyUrl ""
:status ""}
:posDataProvider {:posDataProviderId ""
:posExternalAccountId ""}
:storePickupActive false}]
:kind ""}
:merchantId ""
:method ""
:posDataProviderId ""
:posExternalAccountId ""}]}})
require "http/client"
url = "{{baseUrl}}/liasettings/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\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}}/liasettings/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\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}}/liasettings/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/liasettings/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/liasettings/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1106
{
"entries": [
{
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
},
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/liasettings/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/liasettings/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/liasettings/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/liasettings/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
accountId: '',
batchId: 0,
contactEmail: '',
contactName: '',
country: '',
gmbEmail: '',
liaSettings: {
accountId: '',
countrySettings: [
{
about: {
status: '',
url: ''
},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {
shippingCostPolicyUrl: '',
status: ''
},
posDataProvider: {
posDataProviderId: '',
posExternalAccountId: ''
},
storePickupActive: false
}
],
kind: ''
},
merchantId: '',
method: '',
posDataProviderId: '',
posExternalAccountId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/liasettings/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/liasettings/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
accountId: '',
batchId: 0,
contactEmail: '',
contactName: '',
country: '',
gmbEmail: '',
liaSettings: {
accountId: '',
countrySettings: [
{
about: {status: '', url: ''},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {shippingCostPolicyUrl: '', status: ''},
posDataProvider: {posDataProviderId: '', posExternalAccountId: ''},
storePickupActive: false
}
],
kind: ''
},
merchantId: '',
method: '',
posDataProviderId: '',
posExternalAccountId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/liasettings/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"accountId":"","batchId":0,"contactEmail":"","contactName":"","country":"","gmbEmail":"","liaSettings":{"accountId":"","countrySettings":[{"about":{"status":"","url":""},"country":"","hostedLocalStorefrontActive":false,"inventory":{"inventoryVerificationContactEmail":"","inventoryVerificationContactName":"","inventoryVerificationContactStatus":"","status":""},"onDisplayToOrder":{"shippingCostPolicyUrl":"","status":""},"posDataProvider":{"posDataProviderId":"","posExternalAccountId":""},"storePickupActive":false}],"kind":""},"merchantId":"","method":"","posDataProviderId":"","posExternalAccountId":""}]}'
};
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}}/liasettings/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "accountId": "",\n "batchId": 0,\n "contactEmail": "",\n "contactName": "",\n "country": "",\n "gmbEmail": "",\n "liaSettings": {\n "accountId": "",\n "countrySettings": [\n {\n "about": {\n "status": "",\n "url": ""\n },\n "country": "",\n "hostedLocalStorefrontActive": false,\n "inventory": {\n "inventoryVerificationContactEmail": "",\n "inventoryVerificationContactName": "",\n "inventoryVerificationContactStatus": "",\n "status": ""\n },\n "onDisplayToOrder": {\n "shippingCostPolicyUrl": "",\n "status": ""\n },\n "posDataProvider": {\n "posDataProviderId": "",\n "posExternalAccountId": ""\n },\n "storePickupActive": false\n }\n ],\n "kind": ""\n },\n "merchantId": "",\n "method": "",\n "posDataProviderId": "",\n "posExternalAccountId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/liasettings/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/liasettings/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
accountId: '',
batchId: 0,
contactEmail: '',
contactName: '',
country: '',
gmbEmail: '',
liaSettings: {
accountId: '',
countrySettings: [
{
about: {status: '', url: ''},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {shippingCostPolicyUrl: '', status: ''},
posDataProvider: {posDataProviderId: '', posExternalAccountId: ''},
storePickupActive: false
}
],
kind: ''
},
merchantId: '',
method: '',
posDataProviderId: '',
posExternalAccountId: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/liasettings/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
accountId: '',
batchId: 0,
contactEmail: '',
contactName: '',
country: '',
gmbEmail: '',
liaSettings: {
accountId: '',
countrySettings: [
{
about: {status: '', url: ''},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {shippingCostPolicyUrl: '', status: ''},
posDataProvider: {posDataProviderId: '', posExternalAccountId: ''},
storePickupActive: false
}
],
kind: ''
},
merchantId: '',
method: '',
posDataProviderId: '',
posExternalAccountId: ''
}
]
},
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}}/liasettings/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
accountId: '',
batchId: 0,
contactEmail: '',
contactName: '',
country: '',
gmbEmail: '',
liaSettings: {
accountId: '',
countrySettings: [
{
about: {
status: '',
url: ''
},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {
shippingCostPolicyUrl: '',
status: ''
},
posDataProvider: {
posDataProviderId: '',
posExternalAccountId: ''
},
storePickupActive: false
}
],
kind: ''
},
merchantId: '',
method: '',
posDataProviderId: '',
posExternalAccountId: ''
}
]
});
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}}/liasettings/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
accountId: '',
batchId: 0,
contactEmail: '',
contactName: '',
country: '',
gmbEmail: '',
liaSettings: {
accountId: '',
countrySettings: [
{
about: {status: '', url: ''},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {shippingCostPolicyUrl: '', status: ''},
posDataProvider: {posDataProviderId: '', posExternalAccountId: ''},
storePickupActive: false
}
],
kind: ''
},
merchantId: '',
method: '',
posDataProviderId: '',
posExternalAccountId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/liasettings/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"accountId":"","batchId":0,"contactEmail":"","contactName":"","country":"","gmbEmail":"","liaSettings":{"accountId":"","countrySettings":[{"about":{"status":"","url":""},"country":"","hostedLocalStorefrontActive":false,"inventory":{"inventoryVerificationContactEmail":"","inventoryVerificationContactName":"","inventoryVerificationContactStatus":"","status":""},"onDisplayToOrder":{"shippingCostPolicyUrl":"","status":""},"posDataProvider":{"posDataProviderId":"","posExternalAccountId":""},"storePickupActive":false}],"kind":""},"merchantId":"","method":"","posDataProviderId":"","posExternalAccountId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"accountId": @"", @"batchId": @0, @"contactEmail": @"", @"contactName": @"", @"country": @"", @"gmbEmail": @"", @"liaSettings": @{ @"accountId": @"", @"countrySettings": @[ @{ @"about": @{ @"status": @"", @"url": @"" }, @"country": @"", @"hostedLocalStorefrontActive": @NO, @"inventory": @{ @"inventoryVerificationContactEmail": @"", @"inventoryVerificationContactName": @"", @"inventoryVerificationContactStatus": @"", @"status": @"" }, @"onDisplayToOrder": @{ @"shippingCostPolicyUrl": @"", @"status": @"" }, @"posDataProvider": @{ @"posDataProviderId": @"", @"posExternalAccountId": @"" }, @"storePickupActive": @NO } ], @"kind": @"" }, @"merchantId": @"", @"method": @"", @"posDataProviderId": @"", @"posExternalAccountId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/liasettings/batch"]
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}}/liasettings/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/liasettings/batch",
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([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'contactEmail' => '',
'contactName' => '',
'country' => '',
'gmbEmail' => '',
'liaSettings' => [
'accountId' => '',
'countrySettings' => [
[
'about' => [
'status' => '',
'url' => ''
],
'country' => '',
'hostedLocalStorefrontActive' => null,
'inventory' => [
'inventoryVerificationContactEmail' => '',
'inventoryVerificationContactName' => '',
'inventoryVerificationContactStatus' => '',
'status' => ''
],
'onDisplayToOrder' => [
'shippingCostPolicyUrl' => '',
'status' => ''
],
'posDataProvider' => [
'posDataProviderId' => '',
'posExternalAccountId' => ''
],
'storePickupActive' => null
]
],
'kind' => ''
],
'merchantId' => '',
'method' => '',
'posDataProviderId' => '',
'posExternalAccountId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/liasettings/batch', [
'body' => '{
"entries": [
{
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
},
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/liasettings/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'contactEmail' => '',
'contactName' => '',
'country' => '',
'gmbEmail' => '',
'liaSettings' => [
'accountId' => '',
'countrySettings' => [
[
'about' => [
'status' => '',
'url' => ''
],
'country' => '',
'hostedLocalStorefrontActive' => null,
'inventory' => [
'inventoryVerificationContactEmail' => '',
'inventoryVerificationContactName' => '',
'inventoryVerificationContactStatus' => '',
'status' => ''
],
'onDisplayToOrder' => [
'shippingCostPolicyUrl' => '',
'status' => ''
],
'posDataProvider' => [
'posDataProviderId' => '',
'posExternalAccountId' => ''
],
'storePickupActive' => null
]
],
'kind' => ''
],
'merchantId' => '',
'method' => '',
'posDataProviderId' => '',
'posExternalAccountId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'contactEmail' => '',
'contactName' => '',
'country' => '',
'gmbEmail' => '',
'liaSettings' => [
'accountId' => '',
'countrySettings' => [
[
'about' => [
'status' => '',
'url' => ''
],
'country' => '',
'hostedLocalStorefrontActive' => null,
'inventory' => [
'inventoryVerificationContactEmail' => '',
'inventoryVerificationContactName' => '',
'inventoryVerificationContactStatus' => '',
'status' => ''
],
'onDisplayToOrder' => [
'shippingCostPolicyUrl' => '',
'status' => ''
],
'posDataProvider' => [
'posDataProviderId' => '',
'posExternalAccountId' => ''
],
'storePickupActive' => null
]
],
'kind' => ''
],
'merchantId' => '',
'method' => '',
'posDataProviderId' => '',
'posExternalAccountId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/liasettings/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/liasettings/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
},
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/liasettings/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
},
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/liasettings/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/liasettings/batch"
payload = { "entries": [
{
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": False,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": False
}
],
"kind": ""
},
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/liasettings/batch"
payload <- "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/liasettings/batch")
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 \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\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.post('/baseUrl/liasettings/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"contactEmail\": \"\",\n \"contactName\": \"\",\n \"country\": \"\",\n \"gmbEmail\": \"\",\n \"liaSettings\": {\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/liasettings/batch";
let payload = json!({"entries": (
json!({
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": json!({
"accountId": "",
"countrySettings": (
json!({
"about": json!({
"status": "",
"url": ""
}),
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": json!({
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
}),
"onDisplayToOrder": json!({
"shippingCostPolicyUrl": "",
"status": ""
}),
"posDataProvider": json!({
"posDataProviderId": "",
"posExternalAccountId": ""
}),
"storePickupActive": false
})
),
"kind": ""
}),
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/liasettings/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
},
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
}
]
}'
echo '{
"entries": [
{
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
},
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
}
]
}' | \
http POST {{baseUrl}}/liasettings/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "accountId": "",\n "batchId": 0,\n "contactEmail": "",\n "contactName": "",\n "country": "",\n "gmbEmail": "",\n "liaSettings": {\n "accountId": "",\n "countrySettings": [\n {\n "about": {\n "status": "",\n "url": ""\n },\n "country": "",\n "hostedLocalStorefrontActive": false,\n "inventory": {\n "inventoryVerificationContactEmail": "",\n "inventoryVerificationContactName": "",\n "inventoryVerificationContactStatus": "",\n "status": ""\n },\n "onDisplayToOrder": {\n "shippingCostPolicyUrl": "",\n "status": ""\n },\n "posDataProvider": {\n "posDataProviderId": "",\n "posExternalAccountId": ""\n },\n "storePickupActive": false\n }\n ],\n "kind": ""\n },\n "merchantId": "",\n "method": "",\n "posDataProviderId": "",\n "posExternalAccountId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/liasettings/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"accountId": "",
"batchId": 0,
"contactEmail": "",
"contactName": "",
"country": "",
"gmbEmail": "",
"liaSettings": [
"accountId": "",
"countrySettings": [
[
"about": [
"status": "",
"url": ""
],
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": [
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
],
"onDisplayToOrder": [
"shippingCostPolicyUrl": "",
"status": ""
],
"posDataProvider": [
"posDataProviderId": "",
"posExternalAccountId": ""
],
"storePickupActive": false
]
],
"kind": ""
],
"merchantId": "",
"method": "",
"posDataProviderId": "",
"posExternalAccountId": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/liasettings/batch")! 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()
GET
content.liasettings.get
{{baseUrl}}/:merchantId/liasettings/:accountId
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/liasettings/:accountId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/liasettings/:accountId")
require "http/client"
url = "{{baseUrl}}/:merchantId/liasettings/:accountId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/liasettings/:accountId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/liasettings/:accountId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/liasettings/:accountId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/liasettings/:accountId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/liasettings/:accountId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/liasettings/:accountId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/liasettings/:accountId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/liasettings/:accountId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId';
const options = {method: 'GET'};
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}}/:merchantId/liasettings/:accountId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/liasettings/:accountId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/liasettings/:accountId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/liasettings/:accountId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/liasettings/:accountId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/liasettings/:accountId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/liasettings/:accountId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/liasettings/:accountId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/liasettings/:accountId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/liasettings/:accountId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/liasettings/:accountId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/liasettings/:accountId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/liasettings/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/liasettings/:accountId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/liasettings/:accountId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/liasettings/:accountId
http GET {{baseUrl}}/:merchantId/liasettings/:accountId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/liasettings/:accountId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/liasettings/:accountId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.liasettings.getaccessiblegmbaccounts
{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts")
require "http/client"
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/liasettings/:accountId/accessiblegmbaccounts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts';
const options = {method: 'GET'};
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}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/liasettings/:accountId/accessiblegmbaccounts',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/liasettings/:accountId/accessiblegmbaccounts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/liasettings/:accountId/accessiblegmbaccounts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts
http GET {{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/liasettings/:accountId/accessiblegmbaccounts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.liasettings.list
{{baseUrl}}/:merchantId/liasettings
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/liasettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/liasettings")
require "http/client"
url = "{{baseUrl}}/:merchantId/liasettings"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/liasettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/liasettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/liasettings"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/liasettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/liasettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/liasettings"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/liasettings")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/liasettings');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/liasettings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/liasettings';
const options = {method: 'GET'};
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}}/:merchantId/liasettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/liasettings',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/liasettings'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/liasettings');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/liasettings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/liasettings';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/liasettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/liasettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/liasettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/liasettings');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/liasettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/liasettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/liasettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/liasettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/liasettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/liasettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/liasettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/liasettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/liasettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/liasettings";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/liasettings
http GET {{baseUrl}}/:merchantId/liasettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/liasettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/liasettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.liasettings.listposdataproviders
{{baseUrl}}/liasettings/posdataproviders
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/liasettings/posdataproviders");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/liasettings/posdataproviders")
require "http/client"
url = "{{baseUrl}}/liasettings/posdataproviders"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/liasettings/posdataproviders"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/liasettings/posdataproviders");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/liasettings/posdataproviders"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/liasettings/posdataproviders HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/liasettings/posdataproviders")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/liasettings/posdataproviders"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/liasettings/posdataproviders")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/liasettings/posdataproviders")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/liasettings/posdataproviders');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/liasettings/posdataproviders'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/liasettings/posdataproviders';
const options = {method: 'GET'};
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}}/liasettings/posdataproviders',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/liasettings/posdataproviders")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/liasettings/posdataproviders',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/liasettings/posdataproviders'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/liasettings/posdataproviders');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/liasettings/posdataproviders'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/liasettings/posdataproviders';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/liasettings/posdataproviders"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/liasettings/posdataproviders" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/liasettings/posdataproviders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/liasettings/posdataproviders');
echo $response->getBody();
setUrl('{{baseUrl}}/liasettings/posdataproviders');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/liasettings/posdataproviders');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/liasettings/posdataproviders' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/liasettings/posdataproviders' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/liasettings/posdataproviders")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/liasettings/posdataproviders"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/liasettings/posdataproviders"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/liasettings/posdataproviders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/liasettings/posdataproviders') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/liasettings/posdataproviders";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/liasettings/posdataproviders
http GET {{baseUrl}}/liasettings/posdataproviders
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/liasettings/posdataproviders
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/liasettings/posdataproviders")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.liasettings.requestgmbaccess
{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess
QUERY PARAMS
gmbEmail
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess" {:query-params {:gmbEmail ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess',
params: {gmbEmail: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=';
const options = {method: 'POST'};
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}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess',
qs: {gmbEmail: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess');
req.query({
gmbEmail: ''
});
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}}/:merchantId/liasettings/:accountId/requestgmbaccess',
params: {gmbEmail: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'gmbEmail' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'gmbEmail' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess"
querystring = {"gmbEmail":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess"
queryString <- list(gmbEmail = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/:merchantId/liasettings/:accountId/requestgmbaccess') do |req|
req.params['gmbEmail'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess";
let querystring = [
("gmbEmail", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail='
http POST '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/liasettings/:accountId/requestgmbaccess?gmbEmail=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
content.liasettings.requestinventoryverification
{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country
QUERY PARAMS
merchantId
accountId
country
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country")
require "http/client"
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/liasettings/:accountId/requestinventoryverification/:country HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country';
const options = {method: 'POST'};
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}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/liasettings/:accountId/requestinventoryverification/:country',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country');
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}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/:merchantId/liasettings/:accountId/requestinventoryverification/:country")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/:merchantId/liasettings/:accountId/requestinventoryverification/:country') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country
http POST {{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/liasettings/:accountId/requestinventoryverification/:country")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
content.liasettings.setinventoryverificationcontact
{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact
QUERY PARAMS
country
language
contactName
contactEmail
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact" {:query-params {:country ""
:language ""
:contactName ""
:contactEmail ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact',
params: {country: '', language: '', contactName: '', contactEmail: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=';
const options = {method: 'POST'};
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}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact',
qs: {country: '', language: '', contactName: '', contactEmail: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact');
req.query({
country: '',
language: '',
contactName: '',
contactEmail: ''
});
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}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact',
params: {country: '', language: '', contactName: '', contactEmail: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'country' => '',
'language' => '',
'contactName' => '',
'contactEmail' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'country' => '',
'language' => '',
'contactName' => '',
'contactEmail' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact"
querystring = {"country":"","language":"","contactName":"","contactEmail":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact"
queryString <- list(
country = "",
language = "",
contactName = "",
contactEmail = ""
)
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/:merchantId/liasettings/:accountId/setinventoryverificationcontact') do |req|
req.params['country'] = ''
req.params['language'] = ''
req.params['contactName'] = ''
req.params['contactEmail'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact";
let querystring = [
("country", ""),
("language", ""),
("contactName", ""),
("contactEmail", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail='
http POST '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/liasettings/:accountId/setinventoryverificationcontact?country=&language=&contactName=&contactEmail=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
content.liasettings.setposdataprovider
{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider
QUERY PARAMS
country
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider" {:query-params {:country ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country="
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country="
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/liasettings/:accountId/setposdataprovider?country= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country="))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider',
params: {country: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=';
const options = {method: 'POST'};
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}}/:merchantId/liasettings/:accountId/setposdataprovider?country=',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/liasettings/:accountId/setposdataprovider?country=',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider',
qs: {country: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider');
req.query({
country: ''
});
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}}/:merchantId/liasettings/:accountId/setposdataprovider',
params: {country: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/:merchantId/liasettings/:accountId/setposdataprovider?country=" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'country' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'country' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/:merchantId/liasettings/:accountId/setposdataprovider?country=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider"
querystring = {"country":""}
response = requests.post(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider"
queryString <- list(country = "")
response <- VERB("POST", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/:merchantId/liasettings/:accountId/setposdataprovider') do |req|
req.params['country'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider";
let querystring = [
("country", ""),
];
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country='
http POST '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country='
wget --quiet \
--method POST \
--output-document \
- '{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/liasettings/:accountId/setposdataprovider?country=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
PUT
content.liasettings.update
{{baseUrl}}/:merchantId/liasettings/:accountId
QUERY PARAMS
merchantId
accountId
BODY json
{
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/liasettings/:accountId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/:merchantId/liasettings/:accountId" {:content-type :json
:form-params {:accountId ""
:countrySettings [{:about {:status ""
:url ""}
:country ""
:hostedLocalStorefrontActive false
:inventory {:inventoryVerificationContactEmail ""
:inventoryVerificationContactName ""
:inventoryVerificationContactStatus ""
:status ""}
:onDisplayToOrder {:shippingCostPolicyUrl ""
:status ""}
:posDataProvider {:posDataProviderId ""
:posExternalAccountId ""}
:storePickupActive false}]
:kind ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/liasettings/:accountId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\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}}/:merchantId/liasettings/:accountId"),
Content = new StringContent("{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\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}}/:merchantId/liasettings/:accountId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/liasettings/:accountId"
payload := strings.NewReader("{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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(res)
fmt.Println(string(body))
}
PUT /baseUrl/:merchantId/liasettings/:accountId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 636
{
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/:merchantId/liasettings/:accountId")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/liasettings/:accountId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\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 \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/:merchantId/liasettings/:accountId")
.header("content-type", "application/json")
.body("{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}")
.asString();
const data = JSON.stringify({
accountId: '',
countrySettings: [
{
about: {
status: '',
url: ''
},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {
shippingCostPolicyUrl: '',
status: ''
},
posDataProvider: {
posDataProviderId: '',
posExternalAccountId: ''
},
storePickupActive: false
}
],
kind: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/:merchantId/liasettings/:accountId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId',
headers: {'content-type': 'application/json'},
data: {
accountId: '',
countrySettings: [
{
about: {status: '', url: ''},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {shippingCostPolicyUrl: '', status: ''},
posDataProvider: {posDataProviderId: '', posExternalAccountId: ''},
storePickupActive: false
}
],
kind: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","countrySettings":[{"about":{"status":"","url":""},"country":"","hostedLocalStorefrontActive":false,"inventory":{"inventoryVerificationContactEmail":"","inventoryVerificationContactName":"","inventoryVerificationContactStatus":"","status":""},"onDisplayToOrder":{"shippingCostPolicyUrl":"","status":""},"posDataProvider":{"posDataProviderId":"","posExternalAccountId":""},"storePickupActive":false}],"kind":""}'
};
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}}/:merchantId/liasettings/:accountId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountId": "",\n "countrySettings": [\n {\n "about": {\n "status": "",\n "url": ""\n },\n "country": "",\n "hostedLocalStorefrontActive": false,\n "inventory": {\n "inventoryVerificationContactEmail": "",\n "inventoryVerificationContactName": "",\n "inventoryVerificationContactStatus": "",\n "status": ""\n },\n "onDisplayToOrder": {\n "shippingCostPolicyUrl": "",\n "status": ""\n },\n "posDataProvider": {\n "posDataProviderId": "",\n "posExternalAccountId": ""\n },\n "storePickupActive": false\n }\n ],\n "kind": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/liasettings/:accountId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/liasettings/:accountId',
headers: {
'content-type': 'application/json'
}
};
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({
accountId: '',
countrySettings: [
{
about: {status: '', url: ''},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {shippingCostPolicyUrl: '', status: ''},
posDataProvider: {posDataProviderId: '', posExternalAccountId: ''},
storePickupActive: false
}
],
kind: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/liasettings/:accountId',
headers: {'content-type': 'application/json'},
body: {
accountId: '',
countrySettings: [
{
about: {status: '', url: ''},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {shippingCostPolicyUrl: '', status: ''},
posDataProvider: {posDataProviderId: '', posExternalAccountId: ''},
storePickupActive: false
}
],
kind: ''
},
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}}/:merchantId/liasettings/:accountId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountId: '',
countrySettings: [
{
about: {
status: '',
url: ''
},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {
shippingCostPolicyUrl: '',
status: ''
},
posDataProvider: {
posDataProviderId: '',
posExternalAccountId: ''
},
storePickupActive: false
}
],
kind: ''
});
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}}/:merchantId/liasettings/:accountId',
headers: {'content-type': 'application/json'},
data: {
accountId: '',
countrySettings: [
{
about: {status: '', url: ''},
country: '',
hostedLocalStorefrontActive: false,
inventory: {
inventoryVerificationContactEmail: '',
inventoryVerificationContactName: '',
inventoryVerificationContactStatus: '',
status: ''
},
onDisplayToOrder: {shippingCostPolicyUrl: '', status: ''},
posDataProvider: {posDataProviderId: '', posExternalAccountId: ''},
storePickupActive: false
}
],
kind: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/liasettings/:accountId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","countrySettings":[{"about":{"status":"","url":""},"country":"","hostedLocalStorefrontActive":false,"inventory":{"inventoryVerificationContactEmail":"","inventoryVerificationContactName":"","inventoryVerificationContactStatus":"","status":""},"onDisplayToOrder":{"shippingCostPolicyUrl":"","status":""},"posDataProvider":{"posDataProviderId":"","posExternalAccountId":""},"storePickupActive":false}],"kind":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accountId": @"",
@"countrySettings": @[ @{ @"about": @{ @"status": @"", @"url": @"" }, @"country": @"", @"hostedLocalStorefrontActive": @NO, @"inventory": @{ @"inventoryVerificationContactEmail": @"", @"inventoryVerificationContactName": @"", @"inventoryVerificationContactStatus": @"", @"status": @"" }, @"onDisplayToOrder": @{ @"shippingCostPolicyUrl": @"", @"status": @"" }, @"posDataProvider": @{ @"posDataProviderId": @"", @"posExternalAccountId": @"" }, @"storePickupActive": @NO } ],
@"kind": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/liasettings/:accountId"]
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}}/:merchantId/liasettings/:accountId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/liasettings/:accountId",
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([
'accountId' => '',
'countrySettings' => [
[
'about' => [
'status' => '',
'url' => ''
],
'country' => '',
'hostedLocalStorefrontActive' => null,
'inventory' => [
'inventoryVerificationContactEmail' => '',
'inventoryVerificationContactName' => '',
'inventoryVerificationContactStatus' => '',
'status' => ''
],
'onDisplayToOrder' => [
'shippingCostPolicyUrl' => '',
'status' => ''
],
'posDataProvider' => [
'posDataProviderId' => '',
'posExternalAccountId' => ''
],
'storePickupActive' => null
]
],
'kind' => ''
]),
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;
}
request('PUT', '{{baseUrl}}/:merchantId/liasettings/:accountId', [
'body' => '{
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/liasettings/:accountId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountId' => '',
'countrySettings' => [
[
'about' => [
'status' => '',
'url' => ''
],
'country' => '',
'hostedLocalStorefrontActive' => null,
'inventory' => [
'inventoryVerificationContactEmail' => '',
'inventoryVerificationContactName' => '',
'inventoryVerificationContactStatus' => '',
'status' => ''
],
'onDisplayToOrder' => [
'shippingCostPolicyUrl' => '',
'status' => ''
],
'posDataProvider' => [
'posDataProviderId' => '',
'posExternalAccountId' => ''
],
'storePickupActive' => null
]
],
'kind' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountId' => '',
'countrySettings' => [
[
'about' => [
'status' => '',
'url' => ''
],
'country' => '',
'hostedLocalStorefrontActive' => null,
'inventory' => [
'inventoryVerificationContactEmail' => '',
'inventoryVerificationContactName' => '',
'inventoryVerificationContactStatus' => '',
'status' => ''
],
'onDisplayToOrder' => [
'shippingCostPolicyUrl' => '',
'status' => ''
],
'posDataProvider' => [
'posDataProviderId' => '',
'posExternalAccountId' => ''
],
'storePickupActive' => null
]
],
'kind' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/liasettings/:accountId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/liasettings/:accountId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/:merchantId/liasettings/:accountId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/liasettings/:accountId"
payload = {
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": False,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": False
}
],
"kind": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/liasettings/:accountId"
payload <- "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/liasettings/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\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/:merchantId/liasettings/:accountId') do |req|
req.body = "{\n \"accountId\": \"\",\n \"countrySettings\": [\n {\n \"about\": {\n \"status\": \"\",\n \"url\": \"\"\n },\n \"country\": \"\",\n \"hostedLocalStorefrontActive\": false,\n \"inventory\": {\n \"inventoryVerificationContactEmail\": \"\",\n \"inventoryVerificationContactName\": \"\",\n \"inventoryVerificationContactStatus\": \"\",\n \"status\": \"\"\n },\n \"onDisplayToOrder\": {\n \"shippingCostPolicyUrl\": \"\",\n \"status\": \"\"\n },\n \"posDataProvider\": {\n \"posDataProviderId\": \"\",\n \"posExternalAccountId\": \"\"\n },\n \"storePickupActive\": false\n }\n ],\n \"kind\": \"\"\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}}/:merchantId/liasettings/:accountId";
let payload = json!({
"accountId": "",
"countrySettings": (
json!({
"about": json!({
"status": "",
"url": ""
}),
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": json!({
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
}),
"onDisplayToOrder": json!({
"shippingCostPolicyUrl": "",
"status": ""
}),
"posDataProvider": json!({
"posDataProviderId": "",
"posExternalAccountId": ""
}),
"storePickupActive": false
})
),
"kind": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".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}}/:merchantId/liasettings/:accountId \
--header 'content-type: application/json' \
--data '{
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
}'
echo '{
"accountId": "",
"countrySettings": [
{
"about": {
"status": "",
"url": ""
},
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": {
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
},
"onDisplayToOrder": {
"shippingCostPolicyUrl": "",
"status": ""
},
"posDataProvider": {
"posDataProviderId": "",
"posExternalAccountId": ""
},
"storePickupActive": false
}
],
"kind": ""
}' | \
http PUT {{baseUrl}}/:merchantId/liasettings/:accountId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "accountId": "",\n "countrySettings": [\n {\n "about": {\n "status": "",\n "url": ""\n },\n "country": "",\n "hostedLocalStorefrontActive": false,\n "inventory": {\n "inventoryVerificationContactEmail": "",\n "inventoryVerificationContactName": "",\n "inventoryVerificationContactStatus": "",\n "status": ""\n },\n "onDisplayToOrder": {\n "shippingCostPolicyUrl": "",\n "status": ""\n },\n "posDataProvider": {\n "posDataProviderId": "",\n "posExternalAccountId": ""\n },\n "storePickupActive": false\n }\n ],\n "kind": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/liasettings/:accountId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountId": "",
"countrySettings": [
[
"about": [
"status": "",
"url": ""
],
"country": "",
"hostedLocalStorefrontActive": false,
"inventory": [
"inventoryVerificationContactEmail": "",
"inventoryVerificationContactName": "",
"inventoryVerificationContactStatus": "",
"status": ""
],
"onDisplayToOrder": [
"shippingCostPolicyUrl": "",
"status": ""
],
"posDataProvider": [
"posDataProviderId": "",
"posExternalAccountId": ""
],
"storePickupActive": false
]
],
"kind": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/liasettings/:accountId")! 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
content.localinventory.custombatch
{{baseUrl}}/localinventory/batch
BODY json
{
"entries": [
{
"batchId": 0,
"localInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
},
"merchantId": "",
"method": "",
"productId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/localinventory/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/localinventory/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:localInventory {:availability ""
:customAttributes [{:groupValues []
:name ""
:value ""}]
:instoreProductLocation ""
:kind ""
:pickupMethod ""
:pickupSla ""
:price {:currency ""
:value ""}
:quantity 0
:salePrice {}
:salePriceEffectiveDate ""
:storeCode ""}
:merchantId ""
:method ""
:productId ""}]}})
require "http/client"
url = "{{baseUrl}}/localinventory/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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}}/localinventory/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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}}/localinventory/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/localinventory/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/localinventory/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 626
{
"entries": [
{
"batchId": 0,
"localInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
},
"merchantId": "",
"method": "",
"productId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/localinventory/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/localinventory/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/localinventory/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/localinventory/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
localInventory: {
availability: '',
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {
currency: '',
value: ''
},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
},
merchantId: '',
method: '',
productId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/localinventory/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/localinventory/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
localInventory: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {currency: '', value: ''},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
},
merchantId: '',
method: '',
productId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/localinventory/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"localInventory":{"availability":"","customAttributes":[{"groupValues":[],"name":"","value":""}],"instoreProductLocation":"","kind":"","pickupMethod":"","pickupSla":"","price":{"currency":"","value":""},"quantity":0,"salePrice":{},"salePriceEffectiveDate":"","storeCode":""},"merchantId":"","method":"","productId":""}]}'
};
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}}/localinventory/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "localInventory": {\n "availability": "",\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "instoreProductLocation": "",\n "kind": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": 0,\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "storeCode": ""\n },\n "merchantId": "",\n "method": "",\n "productId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/localinventory/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/localinventory/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
localInventory: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {currency: '', value: ''},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
},
merchantId: '',
method: '',
productId: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/localinventory/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
localInventory: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {currency: '', value: ''},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
},
merchantId: '',
method: '',
productId: ''
}
]
},
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}}/localinventory/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
localInventory: {
availability: '',
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {
currency: '',
value: ''
},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
},
merchantId: '',
method: '',
productId: ''
}
]
});
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}}/localinventory/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
localInventory: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {currency: '', value: ''},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
},
merchantId: '',
method: '',
productId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/localinventory/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"localInventory":{"availability":"","customAttributes":[{"groupValues":[],"name":"","value":""}],"instoreProductLocation":"","kind":"","pickupMethod":"","pickupSla":"","price":{"currency":"","value":""},"quantity":0,"salePrice":{},"salePriceEffectiveDate":"","storeCode":""},"merchantId":"","method":"","productId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"localInventory": @{ @"availability": @"", @"customAttributes": @[ @{ @"groupValues": @[ ], @"name": @"", @"value": @"" } ], @"instoreProductLocation": @"", @"kind": @"", @"pickupMethod": @"", @"pickupSla": @"", @"price": @{ @"currency": @"", @"value": @"" }, @"quantity": @0, @"salePrice": @{ }, @"salePriceEffectiveDate": @"", @"storeCode": @"" }, @"merchantId": @"", @"method": @"", @"productId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/localinventory/batch"]
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}}/localinventory/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/localinventory/batch",
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([
'entries' => [
[
'batchId' => 0,
'localInventory' => [
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'instoreProductLocation' => '',
'kind' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => 0,
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'storeCode' => ''
],
'merchantId' => '',
'method' => '',
'productId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/localinventory/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"localInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
},
"merchantId": "",
"method": "",
"productId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/localinventory/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'localInventory' => [
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'instoreProductLocation' => '',
'kind' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => 0,
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'storeCode' => ''
],
'merchantId' => '',
'method' => '',
'productId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'localInventory' => [
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'instoreProductLocation' => '',
'kind' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => 0,
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'storeCode' => ''
],
'merchantId' => '',
'method' => '',
'productId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/localinventory/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/localinventory/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"localInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
},
"merchantId": "",
"method": "",
"productId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/localinventory/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"localInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
},
"merchantId": "",
"method": "",
"productId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/localinventory/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/localinventory/batch"
payload = { "entries": [
{
"batchId": 0,
"localInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
},
"merchantId": "",
"method": "",
"productId": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/localinventory/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/localinventory/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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.post('/baseUrl/localinventory/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"localInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/localinventory/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"localInventory": json!({
"availability": "",
"customAttributes": (
json!({
"groupValues": (),
"name": "",
"value": ""
})
),
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": json!({
"currency": "",
"value": ""
}),
"quantity": 0,
"salePrice": json!({}),
"salePriceEffectiveDate": "",
"storeCode": ""
}),
"merchantId": "",
"method": "",
"productId": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/localinventory/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"localInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
},
"merchantId": "",
"method": "",
"productId": ""
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"localInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
},
"merchantId": "",
"method": "",
"productId": ""
}
]
}' | \
http POST {{baseUrl}}/localinventory/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "localInventory": {\n "availability": "",\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "instoreProductLocation": "",\n "kind": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": 0,\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "storeCode": ""\n },\n "merchantId": "",\n "method": "",\n "productId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/localinventory/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"localInventory": [
"availability": "",
"customAttributes": [
[
"groupValues": [],
"name": "",
"value": ""
]
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": [
"currency": "",
"value": ""
],
"quantity": 0,
"salePrice": [],
"salePriceEffectiveDate": "",
"storeCode": ""
],
"merchantId": "",
"method": "",
"productId": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/localinventory/batch")! 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()
POST
content.localinventory.insert
{{baseUrl}}/:merchantId/products/:productId/localinventory
QUERY PARAMS
merchantId
productId
BODY json
{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/products/:productId/localinventory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/products/:productId/localinventory" {:content-type :json
:form-params {:availability ""
:customAttributes [{:groupValues []
:name ""
:value ""}]
:instoreProductLocation ""
:kind ""
:pickupMethod ""
:pickupSla ""
:price {:currency ""
:value ""}
:quantity 0
:salePrice {}
:salePriceEffectiveDate ""
:storeCode ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/products/:productId/localinventory"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\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}}/:merchantId/products/:productId/localinventory"),
Content = new StringContent("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\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}}/:merchantId/products/:productId/localinventory");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/products/:productId/localinventory"
payload := strings.NewReader("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/products/:productId/localinventory HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 354
{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/products/:productId/localinventory")
.setHeader("content-type", "application/json")
.setBody("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/products/:productId/localinventory"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\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 \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId/localinventory")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/products/:productId/localinventory")
.header("content-type", "application/json")
.body("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}")
.asString();
const data = JSON.stringify({
availability: '',
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {
currency: '',
value: ''
},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/products/:productId/localinventory');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/products/:productId/localinventory',
headers: {'content-type': 'application/json'},
data: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {currency: '', value: ''},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/products/:productId/localinventory';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"availability":"","customAttributes":[{"groupValues":[],"name":"","value":""}],"instoreProductLocation":"","kind":"","pickupMethod":"","pickupSla":"","price":{"currency":"","value":""},"quantity":0,"salePrice":{},"salePriceEffectiveDate":"","storeCode":""}'
};
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}}/:merchantId/products/:productId/localinventory',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "availability": "",\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "instoreProductLocation": "",\n "kind": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": 0,\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "storeCode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId/localinventory")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/products/:productId/localinventory',
headers: {
'content-type': 'application/json'
}
};
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({
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {currency: '', value: ''},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/products/:productId/localinventory',
headers: {'content-type': 'application/json'},
body: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {currency: '', value: ''},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
},
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}}/:merchantId/products/:productId/localinventory');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
availability: '',
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {
currency: '',
value: ''
},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
});
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}}/:merchantId/products/:productId/localinventory',
headers: {'content-type': 'application/json'},
data: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
instoreProductLocation: '',
kind: '',
pickupMethod: '',
pickupSla: '',
price: {currency: '', value: ''},
quantity: 0,
salePrice: {},
salePriceEffectiveDate: '',
storeCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/products/:productId/localinventory';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"availability":"","customAttributes":[{"groupValues":[],"name":"","value":""}],"instoreProductLocation":"","kind":"","pickupMethod":"","pickupSla":"","price":{"currency":"","value":""},"quantity":0,"salePrice":{},"salePriceEffectiveDate":"","storeCode":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"availability": @"",
@"customAttributes": @[ @{ @"groupValues": @[ ], @"name": @"", @"value": @"" } ],
@"instoreProductLocation": @"",
@"kind": @"",
@"pickupMethod": @"",
@"pickupSla": @"",
@"price": @{ @"currency": @"", @"value": @"" },
@"quantity": @0,
@"salePrice": @{ },
@"salePriceEffectiveDate": @"",
@"storeCode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/products/:productId/localinventory"]
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}}/:merchantId/products/:productId/localinventory" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/products/:productId/localinventory",
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([
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'instoreProductLocation' => '',
'kind' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => 0,
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'storeCode' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/products/:productId/localinventory', [
'body' => '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/products/:productId/localinventory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'instoreProductLocation' => '',
'kind' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => 0,
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'storeCode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'instoreProductLocation' => '',
'kind' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => 0,
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'storeCode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/products/:productId/localinventory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/products/:productId/localinventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/products/:productId/localinventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/products/:productId/localinventory", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/products/:productId/localinventory"
payload = {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/products/:productId/localinventory"
payload <- "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/products/:productId/localinventory")
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 \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\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.post('/baseUrl/:merchantId/products/:productId/localinventory') do |req|
req.body = "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"instoreProductLocation\": \"\",\n \"kind\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": 0,\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"storeCode\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/products/:productId/localinventory";
let payload = json!({
"availability": "",
"customAttributes": (
json!({
"groupValues": (),
"name": "",
"value": ""
})
),
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": json!({
"currency": "",
"value": ""
}),
"quantity": 0,
"salePrice": json!({}),
"salePriceEffectiveDate": "",
"storeCode": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/products/:productId/localinventory \
--header 'content-type: application/json' \
--data '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
}'
echo '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": {
"currency": "",
"value": ""
},
"quantity": 0,
"salePrice": {},
"salePriceEffectiveDate": "",
"storeCode": ""
}' | \
http POST {{baseUrl}}/:merchantId/products/:productId/localinventory \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "availability": "",\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "instoreProductLocation": "",\n "kind": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": 0,\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "storeCode": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/products/:productId/localinventory
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"availability": "",
"customAttributes": [
[
"groupValues": [],
"name": "",
"value": ""
]
],
"instoreProductLocation": "",
"kind": "",
"pickupMethod": "",
"pickupSla": "",
"price": [
"currency": "",
"value": ""
],
"quantity": 0,
"salePrice": [],
"salePriceEffectiveDate": "",
"storeCode": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/products/:productId/localinventory")! 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()
POST
content.orderinvoices.createchargeinvoice
{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice
QUERY PARAMS
merchantId
orderId
BODY json
{
"invoiceId": "",
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"operationId": "",
"shipmentGroupId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice" {:content-type :json
:form-params {:invoiceId ""
:invoiceSummary {:additionalChargeSummaries [{:totalAmount {:priceAmount {:currency ""
:value ""}
:taxAmount {}}
:type ""}]
:productTotal {}}
:lineItemInvoices [{:lineItemId ""
:productId ""
:shipmentUnitIds []
:unitInvoice {:additionalCharges [{:additionalChargeAmount {}
:type ""}]
:unitPrice {}
:unitPriceTaxes [{:taxAmount {}
:taxName ""
:taxType ""}]}}]
:operationId ""
:shipmentGroupId ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\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}}/:merchantId/orderinvoices/:orderId/createChargeInvoice"),
Content = new StringContent("{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\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}}/:merchantId/orderinvoices/:orderId/createChargeInvoice");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice"
payload := strings.NewReader("{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orderinvoices/:orderId/createChargeInvoice HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 796
{
"invoiceId": "",
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"operationId": "",
"shipmentGroupId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice")
.setHeader("content-type", "application/json")
.setBody("{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\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 \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice")
.header("content-type", "application/json")
.body("{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}")
.asString();
const data = JSON.stringify({
invoiceId: '',
invoiceSummary: {
additionalChargeSummaries: [
{
totalAmount: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
type: ''
}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [
{
additionalChargeAmount: {},
type: ''
}
],
unitPrice: {},
unitPriceTaxes: [
{
taxAmount: {},
taxName: '',
taxType: ''
}
]
}
}
],
operationId: '',
shipmentGroupId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice',
headers: {'content-type': 'application/json'},
data: {
invoiceId: '',
invoiceSummary: {
additionalChargeSummaries: [
{totalAmount: {priceAmount: {currency: '', value: ''}, taxAmount: {}}, type: ''}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [{additionalChargeAmount: {}, type: ''}],
unitPrice: {},
unitPriceTaxes: [{taxAmount: {}, taxName: '', taxType: ''}]
}
}
],
operationId: '',
shipmentGroupId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"invoiceId":"","invoiceSummary":{"additionalChargeSummaries":[{"totalAmount":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"type":""}],"productTotal":{}},"lineItemInvoices":[{"lineItemId":"","productId":"","shipmentUnitIds":[],"unitInvoice":{"additionalCharges":[{"additionalChargeAmount":{},"type":""}],"unitPrice":{},"unitPriceTaxes":[{"taxAmount":{},"taxName":"","taxType":""}]}}],"operationId":"","shipmentGroupId":""}'
};
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}}/:merchantId/orderinvoices/:orderId/createChargeInvoice',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "invoiceId": "",\n "invoiceSummary": {\n "additionalChargeSummaries": [\n {\n "totalAmount": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "type": ""\n }\n ],\n "productTotal": {}\n },\n "lineItemInvoices": [\n {\n "lineItemId": "",\n "productId": "",\n "shipmentUnitIds": [],\n "unitInvoice": {\n "additionalCharges": [\n {\n "additionalChargeAmount": {},\n "type": ""\n }\n ],\n "unitPrice": {},\n "unitPriceTaxes": [\n {\n "taxAmount": {},\n "taxName": "",\n "taxType": ""\n }\n ]\n }\n }\n ],\n "operationId": "",\n "shipmentGroupId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderinvoices/:orderId/createChargeInvoice',
headers: {
'content-type': 'application/json'
}
};
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({
invoiceId: '',
invoiceSummary: {
additionalChargeSummaries: [
{totalAmount: {priceAmount: {currency: '', value: ''}, taxAmount: {}}, type: ''}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [{additionalChargeAmount: {}, type: ''}],
unitPrice: {},
unitPriceTaxes: [{taxAmount: {}, taxName: '', taxType: ''}]
}
}
],
operationId: '',
shipmentGroupId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice',
headers: {'content-type': 'application/json'},
body: {
invoiceId: '',
invoiceSummary: {
additionalChargeSummaries: [
{totalAmount: {priceAmount: {currency: '', value: ''}, taxAmount: {}}, type: ''}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [{additionalChargeAmount: {}, type: ''}],
unitPrice: {},
unitPriceTaxes: [{taxAmount: {}, taxName: '', taxType: ''}]
}
}
],
operationId: '',
shipmentGroupId: ''
},
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}}/:merchantId/orderinvoices/:orderId/createChargeInvoice');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
invoiceId: '',
invoiceSummary: {
additionalChargeSummaries: [
{
totalAmount: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
type: ''
}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [
{
additionalChargeAmount: {},
type: ''
}
],
unitPrice: {},
unitPriceTaxes: [
{
taxAmount: {},
taxName: '',
taxType: ''
}
]
}
}
],
operationId: '',
shipmentGroupId: ''
});
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}}/:merchantId/orderinvoices/:orderId/createChargeInvoice',
headers: {'content-type': 'application/json'},
data: {
invoiceId: '',
invoiceSummary: {
additionalChargeSummaries: [
{totalAmount: {priceAmount: {currency: '', value: ''}, taxAmount: {}}, type: ''}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [{additionalChargeAmount: {}, type: ''}],
unitPrice: {},
unitPriceTaxes: [{taxAmount: {}, taxName: '', taxType: ''}]
}
}
],
operationId: '',
shipmentGroupId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"invoiceId":"","invoiceSummary":{"additionalChargeSummaries":[{"totalAmount":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"type":""}],"productTotal":{}},"lineItemInvoices":[{"lineItemId":"","productId":"","shipmentUnitIds":[],"unitInvoice":{"additionalCharges":[{"additionalChargeAmount":{},"type":""}],"unitPrice":{},"unitPriceTaxes":[{"taxAmount":{},"taxName":"","taxType":""}]}}],"operationId":"","shipmentGroupId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"invoiceId": @"",
@"invoiceSummary": @{ @"additionalChargeSummaries": @[ @{ @"totalAmount": @{ @"priceAmount": @{ @"currency": @"", @"value": @"" }, @"taxAmount": @{ } }, @"type": @"" } ], @"productTotal": @{ } },
@"lineItemInvoices": @[ @{ @"lineItemId": @"", @"productId": @"", @"shipmentUnitIds": @[ ], @"unitInvoice": @{ @"additionalCharges": @[ @{ @"additionalChargeAmount": @{ }, @"type": @"" } ], @"unitPrice": @{ }, @"unitPriceTaxes": @[ @{ @"taxAmount": @{ }, @"taxName": @"", @"taxType": @"" } ] } } ],
@"operationId": @"",
@"shipmentGroupId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice"]
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}}/:merchantId/orderinvoices/:orderId/createChargeInvoice" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice",
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([
'invoiceId' => '',
'invoiceSummary' => [
'additionalChargeSummaries' => [
[
'totalAmount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'type' => ''
]
],
'productTotal' => [
]
],
'lineItemInvoices' => [
[
'lineItemId' => '',
'productId' => '',
'shipmentUnitIds' => [
],
'unitInvoice' => [
'additionalCharges' => [
[
'additionalChargeAmount' => [
],
'type' => ''
]
],
'unitPrice' => [
],
'unitPriceTaxes' => [
[
'taxAmount' => [
],
'taxName' => '',
'taxType' => ''
]
]
]
]
],
'operationId' => '',
'shipmentGroupId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice', [
'body' => '{
"invoiceId": "",
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"operationId": "",
"shipmentGroupId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'invoiceId' => '',
'invoiceSummary' => [
'additionalChargeSummaries' => [
[
'totalAmount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'type' => ''
]
],
'productTotal' => [
]
],
'lineItemInvoices' => [
[
'lineItemId' => '',
'productId' => '',
'shipmentUnitIds' => [
],
'unitInvoice' => [
'additionalCharges' => [
[
'additionalChargeAmount' => [
],
'type' => ''
]
],
'unitPrice' => [
],
'unitPriceTaxes' => [
[
'taxAmount' => [
],
'taxName' => '',
'taxType' => ''
]
]
]
]
],
'operationId' => '',
'shipmentGroupId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'invoiceId' => '',
'invoiceSummary' => [
'additionalChargeSummaries' => [
[
'totalAmount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'type' => ''
]
],
'productTotal' => [
]
],
'lineItemInvoices' => [
[
'lineItemId' => '',
'productId' => '',
'shipmentUnitIds' => [
],
'unitInvoice' => [
'additionalCharges' => [
[
'additionalChargeAmount' => [
],
'type' => ''
]
],
'unitPrice' => [
],
'unitPriceTaxes' => [
[
'taxAmount' => [
],
'taxName' => '',
'taxType' => ''
]
]
]
]
],
'operationId' => '',
'shipmentGroupId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"invoiceId": "",
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"operationId": "",
"shipmentGroupId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"invoiceId": "",
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"operationId": "",
"shipmentGroupId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orderinvoices/:orderId/createChargeInvoice", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice"
payload = {
"invoiceId": "",
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"operationId": "",
"shipmentGroupId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice"
payload <- "{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice")
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 \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\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.post('/baseUrl/:merchantId/orderinvoices/:orderId/createChargeInvoice') do |req|
req.body = "{\n \"invoiceId\": \"\",\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice";
let payload = json!({
"invoiceId": "",
"invoiceSummary": json!({
"additionalChargeSummaries": (
json!({
"totalAmount": json!({
"priceAmount": json!({
"currency": "",
"value": ""
}),
"taxAmount": json!({})
}),
"type": ""
})
),
"productTotal": json!({})
}),
"lineItemInvoices": (
json!({
"lineItemId": "",
"productId": "",
"shipmentUnitIds": (),
"unitInvoice": json!({
"additionalCharges": (
json!({
"additionalChargeAmount": json!({}),
"type": ""
})
),
"unitPrice": json!({}),
"unitPriceTaxes": (
json!({
"taxAmount": json!({}),
"taxName": "",
"taxType": ""
})
)
})
})
),
"operationId": "",
"shipmentGroupId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice \
--header 'content-type: application/json' \
--data '{
"invoiceId": "",
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"operationId": "",
"shipmentGroupId": ""
}'
echo '{
"invoiceId": "",
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"operationId": "",
"shipmentGroupId": ""
}' | \
http POST {{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "invoiceId": "",\n "invoiceSummary": {\n "additionalChargeSummaries": [\n {\n "totalAmount": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "type": ""\n }\n ],\n "productTotal": {}\n },\n "lineItemInvoices": [\n {\n "lineItemId": "",\n "productId": "",\n "shipmentUnitIds": [],\n "unitInvoice": {\n "additionalCharges": [\n {\n "additionalChargeAmount": {},\n "type": ""\n }\n ],\n "unitPrice": {},\n "unitPriceTaxes": [\n {\n "taxAmount": {},\n "taxName": "",\n "taxType": ""\n }\n ]\n }\n }\n ],\n "operationId": "",\n "shipmentGroupId": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"invoiceId": "",
"invoiceSummary": [
"additionalChargeSummaries": [
[
"totalAmount": [
"priceAmount": [
"currency": "",
"value": ""
],
"taxAmount": []
],
"type": ""
]
],
"productTotal": []
],
"lineItemInvoices": [
[
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": [
"additionalCharges": [
[
"additionalChargeAmount": [],
"type": ""
]
],
"unitPrice": [],
"unitPriceTaxes": [
[
"taxAmount": [],
"taxName": "",
"taxType": ""
]
]
]
]
],
"operationId": "",
"shipmentGroupId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createChargeInvoice")! 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()
POST
content.orderinvoices.createrefundinvoice
{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice
QUERY PARAMS
merchantId
orderId
BODY json
{
"invoiceId": "",
"operationId": "",
"refundOnlyOption": {
"description": "",
"reason": ""
},
"returnOption": {
"description": "",
"reason": ""
},
"shipmentInvoices": [
{
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"shipmentGroupId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice" {:content-type :json
:form-params {:invoiceId ""
:operationId ""
:refundOnlyOption {:description ""
:reason ""}
:returnOption {:description ""
:reason ""}
:shipmentInvoices [{:invoiceSummary {:additionalChargeSummaries [{:totalAmount {:priceAmount {:currency ""
:value ""}
:taxAmount {}}
:type ""}]
:productTotal {}}
:lineItemInvoices [{:lineItemId ""
:productId ""
:shipmentUnitIds []
:unitInvoice {:additionalCharges [{:additionalChargeAmount {}
:type ""}]
:unitPrice {}
:unitPriceTaxes [{:taxAmount {}
:taxName ""
:taxType ""}]}}]
:shipmentGroupId ""}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\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}}/:merchantId/orderinvoices/:orderId/createRefundInvoice"),
Content = new StringContent("{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\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}}/:merchantId/orderinvoices/:orderId/createRefundInvoice");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice"
payload := strings.NewReader("{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orderinvoices/:orderId/createRefundInvoice HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1126
{
"invoiceId": "",
"operationId": "",
"refundOnlyOption": {
"description": "",
"reason": ""
},
"returnOption": {
"description": "",
"reason": ""
},
"shipmentInvoices": [
{
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"shipmentGroupId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice")
.setHeader("content-type", "application/json")
.setBody("{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\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 \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice")
.header("content-type", "application/json")
.body("{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
invoiceId: '',
operationId: '',
refundOnlyOption: {
description: '',
reason: ''
},
returnOption: {
description: '',
reason: ''
},
shipmentInvoices: [
{
invoiceSummary: {
additionalChargeSummaries: [
{
totalAmount: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
type: ''
}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [
{
additionalChargeAmount: {},
type: ''
}
],
unitPrice: {},
unitPriceTaxes: [
{
taxAmount: {},
taxName: '',
taxType: ''
}
]
}
}
],
shipmentGroupId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice',
headers: {'content-type': 'application/json'},
data: {
invoiceId: '',
operationId: '',
refundOnlyOption: {description: '', reason: ''},
returnOption: {description: '', reason: ''},
shipmentInvoices: [
{
invoiceSummary: {
additionalChargeSummaries: [
{totalAmount: {priceAmount: {currency: '', value: ''}, taxAmount: {}}, type: ''}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [{additionalChargeAmount: {}, type: ''}],
unitPrice: {},
unitPriceTaxes: [{taxAmount: {}, taxName: '', taxType: ''}]
}
}
],
shipmentGroupId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"invoiceId":"","operationId":"","refundOnlyOption":{"description":"","reason":""},"returnOption":{"description":"","reason":""},"shipmentInvoices":[{"invoiceSummary":{"additionalChargeSummaries":[{"totalAmount":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"type":""}],"productTotal":{}},"lineItemInvoices":[{"lineItemId":"","productId":"","shipmentUnitIds":[],"unitInvoice":{"additionalCharges":[{"additionalChargeAmount":{},"type":""}],"unitPrice":{},"unitPriceTaxes":[{"taxAmount":{},"taxName":"","taxType":""}]}}],"shipmentGroupId":""}]}'
};
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}}/:merchantId/orderinvoices/:orderId/createRefundInvoice',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "invoiceId": "",\n "operationId": "",\n "refundOnlyOption": {\n "description": "",\n "reason": ""\n },\n "returnOption": {\n "description": "",\n "reason": ""\n },\n "shipmentInvoices": [\n {\n "invoiceSummary": {\n "additionalChargeSummaries": [\n {\n "totalAmount": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "type": ""\n }\n ],\n "productTotal": {}\n },\n "lineItemInvoices": [\n {\n "lineItemId": "",\n "productId": "",\n "shipmentUnitIds": [],\n "unitInvoice": {\n "additionalCharges": [\n {\n "additionalChargeAmount": {},\n "type": ""\n }\n ],\n "unitPrice": {},\n "unitPriceTaxes": [\n {\n "taxAmount": {},\n "taxName": "",\n "taxType": ""\n }\n ]\n }\n }\n ],\n "shipmentGroupId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderinvoices/:orderId/createRefundInvoice',
headers: {
'content-type': 'application/json'
}
};
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({
invoiceId: '',
operationId: '',
refundOnlyOption: {description: '', reason: ''},
returnOption: {description: '', reason: ''},
shipmentInvoices: [
{
invoiceSummary: {
additionalChargeSummaries: [
{totalAmount: {priceAmount: {currency: '', value: ''}, taxAmount: {}}, type: ''}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [{additionalChargeAmount: {}, type: ''}],
unitPrice: {},
unitPriceTaxes: [{taxAmount: {}, taxName: '', taxType: ''}]
}
}
],
shipmentGroupId: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice',
headers: {'content-type': 'application/json'},
body: {
invoiceId: '',
operationId: '',
refundOnlyOption: {description: '', reason: ''},
returnOption: {description: '', reason: ''},
shipmentInvoices: [
{
invoiceSummary: {
additionalChargeSummaries: [
{totalAmount: {priceAmount: {currency: '', value: ''}, taxAmount: {}}, type: ''}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [{additionalChargeAmount: {}, type: ''}],
unitPrice: {},
unitPriceTaxes: [{taxAmount: {}, taxName: '', taxType: ''}]
}
}
],
shipmentGroupId: ''
}
]
},
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}}/:merchantId/orderinvoices/:orderId/createRefundInvoice');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
invoiceId: '',
operationId: '',
refundOnlyOption: {
description: '',
reason: ''
},
returnOption: {
description: '',
reason: ''
},
shipmentInvoices: [
{
invoiceSummary: {
additionalChargeSummaries: [
{
totalAmount: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
type: ''
}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [
{
additionalChargeAmount: {},
type: ''
}
],
unitPrice: {},
unitPriceTaxes: [
{
taxAmount: {},
taxName: '',
taxType: ''
}
]
}
}
],
shipmentGroupId: ''
}
]
});
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}}/:merchantId/orderinvoices/:orderId/createRefundInvoice',
headers: {'content-type': 'application/json'},
data: {
invoiceId: '',
operationId: '',
refundOnlyOption: {description: '', reason: ''},
returnOption: {description: '', reason: ''},
shipmentInvoices: [
{
invoiceSummary: {
additionalChargeSummaries: [
{totalAmount: {priceAmount: {currency: '', value: ''}, taxAmount: {}}, type: ''}
],
productTotal: {}
},
lineItemInvoices: [
{
lineItemId: '',
productId: '',
shipmentUnitIds: [],
unitInvoice: {
additionalCharges: [{additionalChargeAmount: {}, type: ''}],
unitPrice: {},
unitPriceTaxes: [{taxAmount: {}, taxName: '', taxType: ''}]
}
}
],
shipmentGroupId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"invoiceId":"","operationId":"","refundOnlyOption":{"description":"","reason":""},"returnOption":{"description":"","reason":""},"shipmentInvoices":[{"invoiceSummary":{"additionalChargeSummaries":[{"totalAmount":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"type":""}],"productTotal":{}},"lineItemInvoices":[{"lineItemId":"","productId":"","shipmentUnitIds":[],"unitInvoice":{"additionalCharges":[{"additionalChargeAmount":{},"type":""}],"unitPrice":{},"unitPriceTaxes":[{"taxAmount":{},"taxName":"","taxType":""}]}}],"shipmentGroupId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"invoiceId": @"",
@"operationId": @"",
@"refundOnlyOption": @{ @"description": @"", @"reason": @"" },
@"returnOption": @{ @"description": @"", @"reason": @"" },
@"shipmentInvoices": @[ @{ @"invoiceSummary": @{ @"additionalChargeSummaries": @[ @{ @"totalAmount": @{ @"priceAmount": @{ @"currency": @"", @"value": @"" }, @"taxAmount": @{ } }, @"type": @"" } ], @"productTotal": @{ } }, @"lineItemInvoices": @[ @{ @"lineItemId": @"", @"productId": @"", @"shipmentUnitIds": @[ ], @"unitInvoice": @{ @"additionalCharges": @[ @{ @"additionalChargeAmount": @{ }, @"type": @"" } ], @"unitPrice": @{ }, @"unitPriceTaxes": @[ @{ @"taxAmount": @{ }, @"taxName": @"", @"taxType": @"" } ] } } ], @"shipmentGroupId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice"]
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}}/:merchantId/orderinvoices/:orderId/createRefundInvoice" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice",
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([
'invoiceId' => '',
'operationId' => '',
'refundOnlyOption' => [
'description' => '',
'reason' => ''
],
'returnOption' => [
'description' => '',
'reason' => ''
],
'shipmentInvoices' => [
[
'invoiceSummary' => [
'additionalChargeSummaries' => [
[
'totalAmount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'type' => ''
]
],
'productTotal' => [
]
],
'lineItemInvoices' => [
[
'lineItemId' => '',
'productId' => '',
'shipmentUnitIds' => [
],
'unitInvoice' => [
'additionalCharges' => [
[
'additionalChargeAmount' => [
],
'type' => ''
]
],
'unitPrice' => [
],
'unitPriceTaxes' => [
[
'taxAmount' => [
],
'taxName' => '',
'taxType' => ''
]
]
]
]
],
'shipmentGroupId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice', [
'body' => '{
"invoiceId": "",
"operationId": "",
"refundOnlyOption": {
"description": "",
"reason": ""
},
"returnOption": {
"description": "",
"reason": ""
},
"shipmentInvoices": [
{
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"shipmentGroupId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'invoiceId' => '',
'operationId' => '',
'refundOnlyOption' => [
'description' => '',
'reason' => ''
],
'returnOption' => [
'description' => '',
'reason' => ''
],
'shipmentInvoices' => [
[
'invoiceSummary' => [
'additionalChargeSummaries' => [
[
'totalAmount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'type' => ''
]
],
'productTotal' => [
]
],
'lineItemInvoices' => [
[
'lineItemId' => '',
'productId' => '',
'shipmentUnitIds' => [
],
'unitInvoice' => [
'additionalCharges' => [
[
'additionalChargeAmount' => [
],
'type' => ''
]
],
'unitPrice' => [
],
'unitPriceTaxes' => [
[
'taxAmount' => [
],
'taxName' => '',
'taxType' => ''
]
]
]
]
],
'shipmentGroupId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'invoiceId' => '',
'operationId' => '',
'refundOnlyOption' => [
'description' => '',
'reason' => ''
],
'returnOption' => [
'description' => '',
'reason' => ''
],
'shipmentInvoices' => [
[
'invoiceSummary' => [
'additionalChargeSummaries' => [
[
'totalAmount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'type' => ''
]
],
'productTotal' => [
]
],
'lineItemInvoices' => [
[
'lineItemId' => '',
'productId' => '',
'shipmentUnitIds' => [
],
'unitInvoice' => [
'additionalCharges' => [
[
'additionalChargeAmount' => [
],
'type' => ''
]
],
'unitPrice' => [
],
'unitPriceTaxes' => [
[
'taxAmount' => [
],
'taxName' => '',
'taxType' => ''
]
]
]
]
],
'shipmentGroupId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"invoiceId": "",
"operationId": "",
"refundOnlyOption": {
"description": "",
"reason": ""
},
"returnOption": {
"description": "",
"reason": ""
},
"shipmentInvoices": [
{
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"shipmentGroupId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"invoiceId": "",
"operationId": "",
"refundOnlyOption": {
"description": "",
"reason": ""
},
"returnOption": {
"description": "",
"reason": ""
},
"shipmentInvoices": [
{
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"shipmentGroupId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orderinvoices/:orderId/createRefundInvoice", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice"
payload = {
"invoiceId": "",
"operationId": "",
"refundOnlyOption": {
"description": "",
"reason": ""
},
"returnOption": {
"description": "",
"reason": ""
},
"shipmentInvoices": [
{
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"shipmentGroupId": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice"
payload <- "{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice")
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 \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\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.post('/baseUrl/:merchantId/orderinvoices/:orderId/createRefundInvoice') do |req|
req.body = "{\n \"invoiceId\": \"\",\n \"operationId\": \"\",\n \"refundOnlyOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"returnOption\": {\n \"description\": \"\",\n \"reason\": \"\"\n },\n \"shipmentInvoices\": [\n {\n \"invoiceSummary\": {\n \"additionalChargeSummaries\": [\n {\n \"totalAmount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"type\": \"\"\n }\n ],\n \"productTotal\": {}\n },\n \"lineItemInvoices\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"shipmentUnitIds\": [],\n \"unitInvoice\": {\n \"additionalCharges\": [\n {\n \"additionalChargeAmount\": {},\n \"type\": \"\"\n }\n ],\n \"unitPrice\": {},\n \"unitPriceTaxes\": [\n {\n \"taxAmount\": {},\n \"taxName\": \"\",\n \"taxType\": \"\"\n }\n ]\n }\n }\n ],\n \"shipmentGroupId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice";
let payload = json!({
"invoiceId": "",
"operationId": "",
"refundOnlyOption": json!({
"description": "",
"reason": ""
}),
"returnOption": json!({
"description": "",
"reason": ""
}),
"shipmentInvoices": (
json!({
"invoiceSummary": json!({
"additionalChargeSummaries": (
json!({
"totalAmount": json!({
"priceAmount": json!({
"currency": "",
"value": ""
}),
"taxAmount": json!({})
}),
"type": ""
})
),
"productTotal": json!({})
}),
"lineItemInvoices": (
json!({
"lineItemId": "",
"productId": "",
"shipmentUnitIds": (),
"unitInvoice": json!({
"additionalCharges": (
json!({
"additionalChargeAmount": json!({}),
"type": ""
})
),
"unitPrice": json!({}),
"unitPriceTaxes": (
json!({
"taxAmount": json!({}),
"taxName": "",
"taxType": ""
})
)
})
})
),
"shipmentGroupId": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice \
--header 'content-type: application/json' \
--data '{
"invoiceId": "",
"operationId": "",
"refundOnlyOption": {
"description": "",
"reason": ""
},
"returnOption": {
"description": "",
"reason": ""
},
"shipmentInvoices": [
{
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"shipmentGroupId": ""
}
]
}'
echo '{
"invoiceId": "",
"operationId": "",
"refundOnlyOption": {
"description": "",
"reason": ""
},
"returnOption": {
"description": "",
"reason": ""
},
"shipmentInvoices": [
{
"invoiceSummary": {
"additionalChargeSummaries": [
{
"totalAmount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"type": ""
}
],
"productTotal": {}
},
"lineItemInvoices": [
{
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": {
"additionalCharges": [
{
"additionalChargeAmount": {},
"type": ""
}
],
"unitPrice": {},
"unitPriceTaxes": [
{
"taxAmount": {},
"taxName": "",
"taxType": ""
}
]
}
}
],
"shipmentGroupId": ""
}
]
}' | \
http POST {{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "invoiceId": "",\n "operationId": "",\n "refundOnlyOption": {\n "description": "",\n "reason": ""\n },\n "returnOption": {\n "description": "",\n "reason": ""\n },\n "shipmentInvoices": [\n {\n "invoiceSummary": {\n "additionalChargeSummaries": [\n {\n "totalAmount": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "type": ""\n }\n ],\n "productTotal": {}\n },\n "lineItemInvoices": [\n {\n "lineItemId": "",\n "productId": "",\n "shipmentUnitIds": [],\n "unitInvoice": {\n "additionalCharges": [\n {\n "additionalChargeAmount": {},\n "type": ""\n }\n ],\n "unitPrice": {},\n "unitPriceTaxes": [\n {\n "taxAmount": {},\n "taxName": "",\n "taxType": ""\n }\n ]\n }\n }\n ],\n "shipmentGroupId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"invoiceId": "",
"operationId": "",
"refundOnlyOption": [
"description": "",
"reason": ""
],
"returnOption": [
"description": "",
"reason": ""
],
"shipmentInvoices": [
[
"invoiceSummary": [
"additionalChargeSummaries": [
[
"totalAmount": [
"priceAmount": [
"currency": "",
"value": ""
],
"taxAmount": []
],
"type": ""
]
],
"productTotal": []
],
"lineItemInvoices": [
[
"lineItemId": "",
"productId": "",
"shipmentUnitIds": [],
"unitInvoice": [
"additionalCharges": [
[
"additionalChargeAmount": [],
"type": ""
]
],
"unitPrice": [],
"unitPriceTaxes": [
[
"taxAmount": [],
"taxName": "",
"taxType": ""
]
]
]
]
],
"shipmentGroupId": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderinvoices/:orderId/createRefundInvoice")! 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()
GET
content.orderreports.listdisbursements
{{baseUrl}}/:merchantId/orderreports/disbursements
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderreports/disbursements");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/orderreports/disbursements")
require "http/client"
url = "{{baseUrl}}/:merchantId/orderreports/disbursements"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/orderreports/disbursements"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/orderreports/disbursements");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderreports/disbursements"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/orderreports/disbursements HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/orderreports/disbursements")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderreports/disbursements"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreports/disbursements")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/orderreports/disbursements")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/orderreports/disbursements');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreports/disbursements'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderreports/disbursements';
const options = {method: 'GET'};
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}}/:merchantId/orderreports/disbursements',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreports/disbursements")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderreports/disbursements',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreports/disbursements'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/orderreports/disbursements');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreports/disbursements'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderreports/disbursements';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderreports/disbursements"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/orderreports/disbursements" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderreports/disbursements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/orderreports/disbursements');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderreports/disbursements');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/orderreports/disbursements');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderreports/disbursements' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderreports/disbursements' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/orderreports/disbursements")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderreports/disbursements"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderreports/disbursements"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderreports/disbursements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/orderreports/disbursements') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderreports/disbursements";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/orderreports/disbursements
http GET {{baseUrl}}/:merchantId/orderreports/disbursements
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/orderreports/disbursements
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderreports/disbursements")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.orderreports.listtransactions
{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions
QUERY PARAMS
merchantId
disbursementId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions")
require "http/client"
url = "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/orderreports/disbursements/:disbursementId/transactions HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions';
const options = {method: 'GET'};
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}}/:merchantId/orderreports/disbursements/:disbursementId/transactions',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderreports/disbursements/:disbursementId/transactions',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/orderreports/disbursements/:disbursementId/transactions" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/orderreports/disbursements/:disbursementId/transactions")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/orderreports/disbursements/:disbursementId/transactions') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions
http GET {{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderreports/disbursements/:disbursementId/transactions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.orderreturns.acknowledge
{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge
QUERY PARAMS
merchantId
returnId
BODY json
{
"operationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"operationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge" {:content-type :json
:form-params {:operationId ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"operationId\": \"\"\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}}/:merchantId/orderreturns/:returnId/acknowledge"),
Content = new StringContent("{\n \"operationId\": \"\"\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}}/:merchantId/orderreturns/:returnId/acknowledge");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"operationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge"
payload := strings.NewReader("{\n \"operationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orderreturns/:returnId/acknowledge HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"operationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge")
.setHeader("content-type", "application/json")
.setBody("{\n \"operationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"operationId\": \"\"\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 \"operationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge")
.header("content-type", "application/json")
.body("{\n \"operationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
operationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge',
headers: {'content-type': 'application/json'},
data: {operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":""}'
};
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}}/:merchantId/orderreturns/:returnId/acknowledge',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "operationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"operationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderreturns/:returnId/acknowledge',
headers: {
'content-type': 'application/json'
}
};
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({operationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge',
headers: {'content-type': 'application/json'},
body: {operationId: ''},
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}}/:merchantId/orderreturns/:returnId/acknowledge');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
operationId: ''
});
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}}/:merchantId/orderreturns/:returnId/acknowledge',
headers: {'content-type': 'application/json'},
data: {operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"operationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge"]
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}}/:merchantId/orderreturns/:returnId/acknowledge" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"operationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge",
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([
'operationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge', [
'body' => '{
"operationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'operationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'operationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"operationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orderreturns/:returnId/acknowledge", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge"
payload = { "operationId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge"
payload <- "{\n \"operationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge")
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 \"operationId\": \"\"\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.post('/baseUrl/:merchantId/orderreturns/:returnId/acknowledge') do |req|
req.body = "{\n \"operationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge";
let payload = json!({"operationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge \
--header 'content-type: application/json' \
--data '{
"operationId": ""
}'
echo '{
"operationId": ""
}' | \
http POST {{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "operationId": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["operationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderreturns/:returnId/acknowledge")! 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()
POST
content.orderreturns.createorderreturn
{{baseUrl}}/:merchantId/orderreturns/createOrderReturn
QUERY PARAMS
merchantId
BODY json
{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn" {:content-type :json
:form-params {:lineItems [{:lineItemId ""
:productId ""
:quantity 0}]
:operationId ""
:orderId ""
:returnMethodType ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\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}}/:merchantId/orderreturns/createOrderReturn"),
Content = new StringContent("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\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}}/:merchantId/orderreturns/createOrderReturn");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn"
payload := strings.NewReader("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orderreturns/createOrderReturn HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 167
{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn")
.setHeader("content-type", "application/json")
.setBody("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderreturns/createOrderReturn"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\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 \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/createOrderReturn")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orderreturns/createOrderReturn")
.header("content-type", "application/json")
.body("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}")
.asString();
const data = JSON.stringify({
lineItems: [
{
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
orderId: '',
returnMethodType: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orderreturns/createOrderReturn');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderreturns/createOrderReturn',
headers: {'content-type': 'application/json'},
data: {
lineItems: [{lineItemId: '', productId: '', quantity: 0}],
operationId: '',
orderId: '',
returnMethodType: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderreturns/createOrderReturn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItems":[{"lineItemId":"","productId":"","quantity":0}],"operationId":"","orderId":"","returnMethodType":""}'
};
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}}/:merchantId/orderreturns/createOrderReturn',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "lineItems": [\n {\n "lineItemId": "",\n "productId": "",\n "quantity": 0\n }\n ],\n "operationId": "",\n "orderId": "",\n "returnMethodType": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/createOrderReturn")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderreturns/createOrderReturn',
headers: {
'content-type': 'application/json'
}
};
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({
lineItems: [{lineItemId: '', productId: '', quantity: 0}],
operationId: '',
orderId: '',
returnMethodType: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderreturns/createOrderReturn',
headers: {'content-type': 'application/json'},
body: {
lineItems: [{lineItemId: '', productId: '', quantity: 0}],
operationId: '',
orderId: '',
returnMethodType: ''
},
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}}/:merchantId/orderreturns/createOrderReturn');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
lineItems: [
{
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
orderId: '',
returnMethodType: ''
});
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}}/:merchantId/orderreturns/createOrderReturn',
headers: {'content-type': 'application/json'},
data: {
lineItems: [{lineItemId: '', productId: '', quantity: 0}],
operationId: '',
orderId: '',
returnMethodType: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderreturns/createOrderReturn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItems":[{"lineItemId":"","productId":"","quantity":0}],"operationId":"","orderId":"","returnMethodType":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"lineItems": @[ @{ @"lineItemId": @"", @"productId": @"", @"quantity": @0 } ],
@"operationId": @"",
@"orderId": @"",
@"returnMethodType": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderreturns/createOrderReturn"]
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}}/:merchantId/orderreturns/createOrderReturn" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderreturns/createOrderReturn",
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([
'lineItems' => [
[
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'orderId' => '',
'returnMethodType' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orderreturns/createOrderReturn', [
'body' => '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderreturns/createOrderReturn');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'lineItems' => [
[
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'orderId' => '',
'returnMethodType' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'lineItems' => [
[
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'orderId' => '',
'returnMethodType' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orderreturns/createOrderReturn');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderreturns/createOrderReturn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderreturns/createOrderReturn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orderreturns/createOrderReturn", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn"
payload = {
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn"
payload <- "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderreturns/createOrderReturn")
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 \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\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.post('/baseUrl/:merchantId/orderreturns/createOrderReturn') do |req|
req.body = "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"orderId\": \"\",\n \"returnMethodType\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn";
let payload = json!({
"lineItems": (
json!({
"lineItemId": "",
"productId": "",
"quantity": 0
})
),
"operationId": "",
"orderId": "",
"returnMethodType": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orderreturns/createOrderReturn \
--header 'content-type: application/json' \
--data '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
}'
echo '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
}' | \
http POST {{baseUrl}}/:merchantId/orderreturns/createOrderReturn \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "lineItems": [\n {\n "lineItemId": "",\n "productId": "",\n "quantity": 0\n }\n ],\n "operationId": "",\n "orderId": "",\n "returnMethodType": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orderreturns/createOrderReturn
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"lineItems": [
[
"lineItemId": "",
"productId": "",
"quantity": 0
]
],
"operationId": "",
"orderId": "",
"returnMethodType": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderreturns/createOrderReturn")! 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()
GET
content.orderreturns.get
{{baseUrl}}/:merchantId/orderreturns/:returnId
QUERY PARAMS
merchantId
returnId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderreturns/:returnId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/orderreturns/:returnId")
require "http/client"
url = "{{baseUrl}}/:merchantId/orderreturns/:returnId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/orderreturns/:returnId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/orderreturns/:returnId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderreturns/:returnId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/orderreturns/:returnId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/orderreturns/:returnId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderreturns/:returnId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/:returnId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/orderreturns/:returnId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/orderreturns/:returnId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderreturns/:returnId';
const options = {method: 'GET'};
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}}/:merchantId/orderreturns/:returnId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/:returnId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderreturns/:returnId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/orderreturns/:returnId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderreturns/:returnId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderreturns/:returnId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/orderreturns/:returnId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderreturns/:returnId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/orderreturns/:returnId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderreturns/:returnId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/orderreturns/:returnId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderreturns/:returnId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderreturns/:returnId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/orderreturns/:returnId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderreturns/:returnId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderreturns/:returnId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderreturns/:returnId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/orderreturns/:returnId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderreturns/:returnId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/orderreturns/:returnId
http GET {{baseUrl}}/:merchantId/orderreturns/:returnId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/orderreturns/:returnId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderreturns/:returnId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.orderreturns.labels.create
{{baseUrl}}/:merchantId/orderreturns/:returnId/labels
QUERY PARAMS
merchantId
returnId
BODY json
{
"carrier": "",
"labelUri": "",
"trackingId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels" {:content-type :json
:form-params {:carrier ""
:labelUri ""
:trackingId ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\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}}/:merchantId/orderreturns/:returnId/labels"),
Content = new StringContent("{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\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}}/:merchantId/orderreturns/:returnId/labels");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels"
payload := strings.NewReader("{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orderreturns/:returnId/labels HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"carrier": "",
"labelUri": "",
"trackingId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels")
.setHeader("content-type", "application/json")
.setBody("{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderreturns/:returnId/labels"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\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 \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/:returnId/labels")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orderreturns/:returnId/labels")
.header("content-type", "application/json")
.body("{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}")
.asString();
const data = JSON.stringify({
carrier: '',
labelUri: '',
trackingId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orderreturns/:returnId/labels');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId/labels',
headers: {'content-type': 'application/json'},
data: {carrier: '', labelUri: '', trackingId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderreturns/:returnId/labels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"carrier":"","labelUri":"","trackingId":""}'
};
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}}/:merchantId/orderreturns/:returnId/labels',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "carrier": "",\n "labelUri": "",\n "trackingId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/:returnId/labels")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderreturns/:returnId/labels',
headers: {
'content-type': 'application/json'
}
};
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({carrier: '', labelUri: '', trackingId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId/labels',
headers: {'content-type': 'application/json'},
body: {carrier: '', labelUri: '', trackingId: ''},
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}}/:merchantId/orderreturns/:returnId/labels');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
carrier: '',
labelUri: '',
trackingId: ''
});
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}}/:merchantId/orderreturns/:returnId/labels',
headers: {'content-type': 'application/json'},
data: {carrier: '', labelUri: '', trackingId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderreturns/:returnId/labels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"carrier":"","labelUri":"","trackingId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"carrier": @"",
@"labelUri": @"",
@"trackingId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderreturns/:returnId/labels"]
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}}/:merchantId/orderreturns/:returnId/labels" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderreturns/:returnId/labels",
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([
'carrier' => '',
'labelUri' => '',
'trackingId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orderreturns/:returnId/labels', [
'body' => '{
"carrier": "",
"labelUri": "",
"trackingId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderreturns/:returnId/labels');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'carrier' => '',
'labelUri' => '',
'trackingId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'carrier' => '',
'labelUri' => '',
'trackingId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orderreturns/:returnId/labels');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderreturns/:returnId/labels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"carrier": "",
"labelUri": "",
"trackingId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderreturns/:returnId/labels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"carrier": "",
"labelUri": "",
"trackingId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orderreturns/:returnId/labels", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels"
payload = {
"carrier": "",
"labelUri": "",
"trackingId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels"
payload <- "{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderreturns/:returnId/labels")
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 \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\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.post('/baseUrl/:merchantId/orderreturns/:returnId/labels') do |req|
req.body = "{\n \"carrier\": \"\",\n \"labelUri\": \"\",\n \"trackingId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels";
let payload = json!({
"carrier": "",
"labelUri": "",
"trackingId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orderreturns/:returnId/labels \
--header 'content-type: application/json' \
--data '{
"carrier": "",
"labelUri": "",
"trackingId": ""
}'
echo '{
"carrier": "",
"labelUri": "",
"trackingId": ""
}' | \
http POST {{baseUrl}}/:merchantId/orderreturns/:returnId/labels \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "carrier": "",\n "labelUri": "",\n "trackingId": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orderreturns/:returnId/labels
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"carrier": "",
"labelUri": "",
"trackingId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderreturns/:returnId/labels")! 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()
GET
content.orderreturns.list
{{baseUrl}}/:merchantId/orderreturns
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderreturns");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/orderreturns")
require "http/client"
url = "{{baseUrl}}/:merchantId/orderreturns"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/orderreturns"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/orderreturns");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderreturns"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/orderreturns HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/orderreturns")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderreturns"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/orderreturns")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/orderreturns');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orderreturns'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderreturns';
const options = {method: 'GET'};
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}}/:merchantId/orderreturns',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderreturns',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orderreturns'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/orderreturns');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orderreturns'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderreturns';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderreturns"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/orderreturns" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderreturns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/orderreturns');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderreturns');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/orderreturns');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderreturns' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderreturns' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/orderreturns")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderreturns"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderreturns"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderreturns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/orderreturns') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderreturns";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/orderreturns
http GET {{baseUrl}}/:merchantId/orderreturns
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/orderreturns
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderreturns")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.orderreturns.process
{{baseUrl}}/:merchantId/orderreturns/:returnId/process
QUERY PARAMS
merchantId
returnId
BODY json
{
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": {
"fullRefund": false,
"partialRefund": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
},
"returnItems": [
{
"refund": {},
"reject": {
"reason": "",
"reasonText": ""
},
"returnItemId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orderreturns/:returnId/process");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orderreturns/:returnId/process" {:content-type :json
:form-params {:fullChargeReturnShippingCost false
:operationId ""
:refundShippingFee {:fullRefund false
:partialRefund {:priceAmount {:currency ""
:value ""}
:taxAmount {}}
:paymentType ""
:reasonText ""
:returnRefundReason ""}
:returnItems [{:refund {}
:reject {:reason ""
:reasonText ""}
:returnItemId ""}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/process"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\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}}/:merchantId/orderreturns/:returnId/process"),
Content = new StringContent("{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\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}}/:merchantId/orderreturns/:returnId/process");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orderreturns/:returnId/process"
payload := strings.NewReader("{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orderreturns/:returnId/process HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 476
{
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": {
"fullRefund": false,
"partialRefund": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
},
"returnItems": [
{
"refund": {},
"reject": {
"reason": "",
"reasonText": ""
},
"returnItemId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orderreturns/:returnId/process")
.setHeader("content-type", "application/json")
.setBody("{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orderreturns/:returnId/process"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\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 \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/:returnId/process")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orderreturns/:returnId/process")
.header("content-type", "application/json")
.body("{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
fullChargeReturnShippingCost: false,
operationId: '',
refundShippingFee: {
fullRefund: false,
partialRefund: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
paymentType: '',
reasonText: '',
returnRefundReason: ''
},
returnItems: [
{
refund: {},
reject: {
reason: '',
reasonText: ''
},
returnItemId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orderreturns/:returnId/process');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId/process',
headers: {'content-type': 'application/json'},
data: {
fullChargeReturnShippingCost: false,
operationId: '',
refundShippingFee: {
fullRefund: false,
partialRefund: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
paymentType: '',
reasonText: '',
returnRefundReason: ''
},
returnItems: [{refund: {}, reject: {reason: '', reasonText: ''}, returnItemId: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orderreturns/:returnId/process';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"fullChargeReturnShippingCost":false,"operationId":"","refundShippingFee":{"fullRefund":false,"partialRefund":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"paymentType":"","reasonText":"","returnRefundReason":""},"returnItems":[{"refund":{},"reject":{"reason":"","reasonText":""},"returnItemId":""}]}'
};
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}}/:merchantId/orderreturns/:returnId/process',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "fullChargeReturnShippingCost": false,\n "operationId": "",\n "refundShippingFee": {\n "fullRefund": false,\n "partialRefund": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "paymentType": "",\n "reasonText": "",\n "returnRefundReason": ""\n },\n "returnItems": [\n {\n "refund": {},\n "reject": {\n "reason": "",\n "reasonText": ""\n },\n "returnItemId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orderreturns/:returnId/process")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orderreturns/:returnId/process',
headers: {
'content-type': 'application/json'
}
};
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({
fullChargeReturnShippingCost: false,
operationId: '',
refundShippingFee: {
fullRefund: false,
partialRefund: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
paymentType: '',
reasonText: '',
returnRefundReason: ''
},
returnItems: [{refund: {}, reject: {reason: '', reasonText: ''}, returnItemId: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orderreturns/:returnId/process',
headers: {'content-type': 'application/json'},
body: {
fullChargeReturnShippingCost: false,
operationId: '',
refundShippingFee: {
fullRefund: false,
partialRefund: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
paymentType: '',
reasonText: '',
returnRefundReason: ''
},
returnItems: [{refund: {}, reject: {reason: '', reasonText: ''}, returnItemId: ''}]
},
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}}/:merchantId/orderreturns/:returnId/process');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
fullChargeReturnShippingCost: false,
operationId: '',
refundShippingFee: {
fullRefund: false,
partialRefund: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
paymentType: '',
reasonText: '',
returnRefundReason: ''
},
returnItems: [
{
refund: {},
reject: {
reason: '',
reasonText: ''
},
returnItemId: ''
}
]
});
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}}/:merchantId/orderreturns/:returnId/process',
headers: {'content-type': 'application/json'},
data: {
fullChargeReturnShippingCost: false,
operationId: '',
refundShippingFee: {
fullRefund: false,
partialRefund: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
paymentType: '',
reasonText: '',
returnRefundReason: ''
},
returnItems: [{refund: {}, reject: {reason: '', reasonText: ''}, returnItemId: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orderreturns/:returnId/process';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"fullChargeReturnShippingCost":false,"operationId":"","refundShippingFee":{"fullRefund":false,"partialRefund":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"paymentType":"","reasonText":"","returnRefundReason":""},"returnItems":[{"refund":{},"reject":{"reason":"","reasonText":""},"returnItemId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"fullChargeReturnShippingCost": @NO,
@"operationId": @"",
@"refundShippingFee": @{ @"fullRefund": @NO, @"partialRefund": @{ @"priceAmount": @{ @"currency": @"", @"value": @"" }, @"taxAmount": @{ } }, @"paymentType": @"", @"reasonText": @"", @"returnRefundReason": @"" },
@"returnItems": @[ @{ @"refund": @{ }, @"reject": @{ @"reason": @"", @"reasonText": @"" }, @"returnItemId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orderreturns/:returnId/process"]
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}}/:merchantId/orderreturns/:returnId/process" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orderreturns/:returnId/process",
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([
'fullChargeReturnShippingCost' => null,
'operationId' => '',
'refundShippingFee' => [
'fullRefund' => null,
'partialRefund' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'paymentType' => '',
'reasonText' => '',
'returnRefundReason' => ''
],
'returnItems' => [
[
'refund' => [
],
'reject' => [
'reason' => '',
'reasonText' => ''
],
'returnItemId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orderreturns/:returnId/process', [
'body' => '{
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": {
"fullRefund": false,
"partialRefund": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
},
"returnItems": [
{
"refund": {},
"reject": {
"reason": "",
"reasonText": ""
},
"returnItemId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orderreturns/:returnId/process');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'fullChargeReturnShippingCost' => null,
'operationId' => '',
'refundShippingFee' => [
'fullRefund' => null,
'partialRefund' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'paymentType' => '',
'reasonText' => '',
'returnRefundReason' => ''
],
'returnItems' => [
[
'refund' => [
],
'reject' => [
'reason' => '',
'reasonText' => ''
],
'returnItemId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'fullChargeReturnShippingCost' => null,
'operationId' => '',
'refundShippingFee' => [
'fullRefund' => null,
'partialRefund' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'paymentType' => '',
'reasonText' => '',
'returnRefundReason' => ''
],
'returnItems' => [
[
'refund' => [
],
'reject' => [
'reason' => '',
'reasonText' => ''
],
'returnItemId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orderreturns/:returnId/process');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orderreturns/:returnId/process' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": {
"fullRefund": false,
"partialRefund": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
},
"returnItems": [
{
"refund": {},
"reject": {
"reason": "",
"reasonText": ""
},
"returnItemId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orderreturns/:returnId/process' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": {
"fullRefund": false,
"partialRefund": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
},
"returnItems": [
{
"refund": {},
"reject": {
"reason": "",
"reasonText": ""
},
"returnItemId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orderreturns/:returnId/process", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/process"
payload = {
"fullChargeReturnShippingCost": False,
"operationId": "",
"refundShippingFee": {
"fullRefund": False,
"partialRefund": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
},
"returnItems": [
{
"refund": {},
"reject": {
"reason": "",
"reasonText": ""
},
"returnItemId": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orderreturns/:returnId/process"
payload <- "{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orderreturns/:returnId/process")
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 \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\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.post('/baseUrl/:merchantId/orderreturns/:returnId/process') do |req|
req.body = "{\n \"fullChargeReturnShippingCost\": false,\n \"operationId\": \"\",\n \"refundShippingFee\": {\n \"fullRefund\": false,\n \"partialRefund\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"paymentType\": \"\",\n \"reasonText\": \"\",\n \"returnRefundReason\": \"\"\n },\n \"returnItems\": [\n {\n \"refund\": {},\n \"reject\": {\n \"reason\": \"\",\n \"reasonText\": \"\"\n },\n \"returnItemId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orderreturns/:returnId/process";
let payload = json!({
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": json!({
"fullRefund": false,
"partialRefund": json!({
"priceAmount": json!({
"currency": "",
"value": ""
}),
"taxAmount": json!({})
}),
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
}),
"returnItems": (
json!({
"refund": json!({}),
"reject": json!({
"reason": "",
"reasonText": ""
}),
"returnItemId": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orderreturns/:returnId/process \
--header 'content-type: application/json' \
--data '{
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": {
"fullRefund": false,
"partialRefund": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
},
"returnItems": [
{
"refund": {},
"reject": {
"reason": "",
"reasonText": ""
},
"returnItemId": ""
}
]
}'
echo '{
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": {
"fullRefund": false,
"partialRefund": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
},
"returnItems": [
{
"refund": {},
"reject": {
"reason": "",
"reasonText": ""
},
"returnItemId": ""
}
]
}' | \
http POST {{baseUrl}}/:merchantId/orderreturns/:returnId/process \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "fullChargeReturnShippingCost": false,\n "operationId": "",\n "refundShippingFee": {\n "fullRefund": false,\n "partialRefund": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "paymentType": "",\n "reasonText": "",\n "returnRefundReason": ""\n },\n "returnItems": [\n {\n "refund": {},\n "reject": {\n "reason": "",\n "reasonText": ""\n },\n "returnItemId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orderreturns/:returnId/process
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"fullChargeReturnShippingCost": false,
"operationId": "",
"refundShippingFee": [
"fullRefund": false,
"partialRefund": [
"priceAmount": [
"currency": "",
"value": ""
],
"taxAmount": []
],
"paymentType": "",
"reasonText": "",
"returnRefundReason": ""
],
"returnItems": [
[
"refund": [],
"reject": [
"reason": "",
"reasonText": ""
],
"returnItemId": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orderreturns/:returnId/process")! 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()
POST
content.orders.acknowledge
{{baseUrl}}/:merchantId/orders/:orderId/acknowledge
QUERY PARAMS
merchantId
orderId
BODY json
{
"operationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"operationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge" {:content-type :json
:form-params {:operationId ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"operationId\": \"\"\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}}/:merchantId/orders/:orderId/acknowledge"),
Content = new StringContent("{\n \"operationId\": \"\"\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}}/:merchantId/orders/:orderId/acknowledge");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"operationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge"
payload := strings.NewReader("{\n \"operationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/acknowledge HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"operationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge")
.setHeader("content-type", "application/json")
.setBody("{\n \"operationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/acknowledge"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"operationId\": \"\"\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 \"operationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/acknowledge")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/acknowledge")
.header("content-type", "application/json")
.body("{\n \"operationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
operationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/acknowledge');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/acknowledge',
headers: {'content-type': 'application/json'},
data: {operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/acknowledge';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":""}'
};
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}}/:merchantId/orders/:orderId/acknowledge',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "operationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"operationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/acknowledge")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/acknowledge',
headers: {
'content-type': 'application/json'
}
};
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({operationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/acknowledge',
headers: {'content-type': 'application/json'},
body: {operationId: ''},
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}}/:merchantId/orders/:orderId/acknowledge');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
operationId: ''
});
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}}/:merchantId/orders/:orderId/acknowledge',
headers: {'content-type': 'application/json'},
data: {operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/acknowledge';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"operationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/acknowledge"]
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}}/:merchantId/orders/:orderId/acknowledge" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"operationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/acknowledge",
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([
'operationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/acknowledge', [
'body' => '{
"operationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/acknowledge');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'operationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'operationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/acknowledge');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/acknowledge' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/acknowledge' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"operationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/acknowledge", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge"
payload = { "operationId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge"
payload <- "{\n \"operationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/acknowledge")
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 \"operationId\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/acknowledge') do |req|
req.body = "{\n \"operationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge";
let payload = json!({"operationId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/acknowledge \
--header 'content-type: application/json' \
--data '{
"operationId": ""
}'
echo '{
"operationId": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/acknowledge \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "operationId": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/acknowledge
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["operationId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/acknowledge")! 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()
POST
content.orders.advancetestorder
{{baseUrl}}/:merchantId/testorders/:orderId/advance
QUERY PARAMS
merchantId
orderId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/testorders/:orderId/advance");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/testorders/:orderId/advance")
require "http/client"
url = "{{baseUrl}}/:merchantId/testorders/:orderId/advance"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/:merchantId/testorders/:orderId/advance"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/testorders/:orderId/advance");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/testorders/:orderId/advance"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/testorders/:orderId/advance HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/testorders/:orderId/advance")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/testorders/:orderId/advance"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/testorders/:orderId/advance")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/testorders/:orderId/advance")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/testorders/:orderId/advance');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/testorders/:orderId/advance'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/testorders/:orderId/advance';
const options = {method: 'POST'};
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}}/:merchantId/testorders/:orderId/advance',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/testorders/:orderId/advance")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/testorders/:orderId/advance',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/testorders/:orderId/advance'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/:merchantId/testorders/:orderId/advance');
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}}/:merchantId/testorders/:orderId/advance'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/testorders/:orderId/advance';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/testorders/:orderId/advance"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
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}}/:merchantId/testorders/:orderId/advance" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/testorders/:orderId/advance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/:merchantId/testorders/:orderId/advance');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/testorders/:orderId/advance');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/testorders/:orderId/advance');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/testorders/:orderId/advance' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/testorders/:orderId/advance' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/:merchantId/testorders/:orderId/advance")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/testorders/:orderId/advance"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/testorders/:orderId/advance"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/testorders/:orderId/advance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/:merchantId/testorders/:orderId/advance') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/testorders/:orderId/advance";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/testorders/:orderId/advance
http POST {{baseUrl}}/:merchantId/testorders/:orderId/advance
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/:merchantId/testorders/:orderId/advance
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/testorders/:orderId/advance")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
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
content.orders.cancel
{{baseUrl}}/:merchantId/orders/:orderId/cancel
QUERY PARAMS
merchantId
orderId
BODY json
{
"operationId": "",
"reason": "",
"reasonText": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/cancel");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/cancel" {:content-type :json
:form-params {:operationId ""
:reason ""
:reasonText ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/cancel"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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}}/:merchantId/orders/:orderId/cancel"),
Content = new StringContent("{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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}}/:merchantId/orders/:orderId/cancel");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/cancel"
payload := strings.NewReader("{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/cancel HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 59
{
"operationId": "",
"reason": "",
"reasonText": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/cancel")
.setHeader("content-type", "application/json")
.setBody("{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/cancel"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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 \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/cancel")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/cancel")
.header("content-type", "application/json")
.body("{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
.asString();
const data = JSON.stringify({
operationId: '',
reason: '',
reasonText: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/cancel');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/cancel',
headers: {'content-type': 'application/json'},
data: {operationId: '', reason: '', reasonText: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/cancel';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":"","reason":"","reasonText":""}'
};
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}}/:merchantId/orders/:orderId/cancel',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "operationId": "",\n "reason": "",\n "reasonText": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/cancel")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/cancel',
headers: {
'content-type': 'application/json'
}
};
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({operationId: '', reason: '', reasonText: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/cancel',
headers: {'content-type': 'application/json'},
body: {operationId: '', reason: '', reasonText: ''},
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}}/:merchantId/orders/:orderId/cancel');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
operationId: '',
reason: '',
reasonText: ''
});
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}}/:merchantId/orders/:orderId/cancel',
headers: {'content-type': 'application/json'},
data: {operationId: '', reason: '', reasonText: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/cancel';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"operationId":"","reason":"","reasonText":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"operationId": @"",
@"reason": @"",
@"reasonText": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/cancel"]
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}}/:merchantId/orders/:orderId/cancel" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/cancel",
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([
'operationId' => '',
'reason' => '',
'reasonText' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/cancel', [
'body' => '{
"operationId": "",
"reason": "",
"reasonText": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/cancel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'operationId' => '',
'reason' => '',
'reasonText' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'operationId' => '',
'reason' => '',
'reasonText' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/cancel');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/cancel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": "",
"reason": "",
"reasonText": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/cancel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"operationId": "",
"reason": "",
"reasonText": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/cancel", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/cancel"
payload = {
"operationId": "",
"reason": "",
"reasonText": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/cancel"
payload <- "{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/cancel")
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 \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/cancel') do |req|
req.body = "{\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/cancel";
let payload = json!({
"operationId": "",
"reason": "",
"reasonText": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/cancel \
--header 'content-type: application/json' \
--data '{
"operationId": "",
"reason": "",
"reasonText": ""
}'
echo '{
"operationId": "",
"reason": "",
"reasonText": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/cancel \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "operationId": "",\n "reason": "",\n "reasonText": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/cancel
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"operationId": "",
"reason": "",
"reasonText": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/cancel")! 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()
POST
content.orders.cancellineitem
{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem
QUERY PARAMS
merchantId
orderId
BODY json
{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem" {:content-type :json
:form-params {:lineItemId ""
:operationId ""
:productId ""
:quantity 0
:reason ""
:reasonText ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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}}/:merchantId/orders/:orderId/cancelLineItem"),
Content = new StringContent("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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}}/:merchantId/orders/:orderId/cancelLineItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem"
payload := strings.NewReader("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/cancelLineItem HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 115
{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem")
.setHeader("content-type", "application/json")
.setBody("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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 \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem")
.header("content-type", "application/json")
.body("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
.asString();
const data = JSON.stringify({
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem',
headers: {'content-type': 'application/json'},
data: {
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItemId":"","operationId":"","productId":"","quantity":0,"reason":"","reasonText":""}'
};
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}}/:merchantId/orders/:orderId/cancelLineItem',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "lineItemId": "",\n "operationId": "",\n "productId": "",\n "quantity": 0,\n "reason": "",\n "reasonText": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/cancelLineItem',
headers: {
'content-type': 'application/json'
}
};
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({
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem',
headers: {'content-type': 'application/json'},
body: {
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
},
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}}/:merchantId/orders/:orderId/cancelLineItem');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
});
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}}/:merchantId/orders/:orderId/cancelLineItem',
headers: {'content-type': 'application/json'},
data: {
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItemId":"","operationId":"","productId":"","quantity":0,"reason":"","reasonText":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"lineItemId": @"",
@"operationId": @"",
@"productId": @"",
@"quantity": @0,
@"reason": @"",
@"reasonText": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem"]
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}}/:merchantId/orders/:orderId/cancelLineItem" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem",
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([
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem', [
'body' => '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/cancelLineItem", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem"
payload = {
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem"
payload <- "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem")
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 \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/cancelLineItem') do |req|
req.body = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem";
let payload = json!({
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem \
--header 'content-type: application/json' \
--data '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}'
echo '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "lineItemId": "",\n "operationId": "",\n "productId": "",\n "quantity": 0,\n "reason": "",\n "reasonText": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/cancelLineItem")! 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()
POST
content.orders.canceltestorderbycustomer
{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer
QUERY PARAMS
merchantId
orderId
BODY json
{
"reason": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"reason\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer" {:content-type :json
:form-params {:reason ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"reason\": \"\"\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}}/:merchantId/testorders/:orderId/cancelByCustomer"),
Content = new StringContent("{\n \"reason\": \"\"\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}}/:merchantId/testorders/:orderId/cancelByCustomer");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"reason\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer"
payload := strings.NewReader("{\n \"reason\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/testorders/:orderId/cancelByCustomer HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"reason": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer")
.setHeader("content-type", "application/json")
.setBody("{\n \"reason\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"reason\": \"\"\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 \"reason\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer")
.header("content-type", "application/json")
.body("{\n \"reason\": \"\"\n}")
.asString();
const data = JSON.stringify({
reason: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer',
headers: {'content-type': 'application/json'},
data: {reason: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"reason":""}'
};
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}}/:merchantId/testorders/:orderId/cancelByCustomer',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "reason": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"reason\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/testorders/:orderId/cancelByCustomer',
headers: {
'content-type': 'application/json'
}
};
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({reason: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer',
headers: {'content-type': 'application/json'},
body: {reason: ''},
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}}/:merchantId/testorders/:orderId/cancelByCustomer');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
reason: ''
});
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}}/:merchantId/testorders/:orderId/cancelByCustomer',
headers: {'content-type': 'application/json'},
data: {reason: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"reason":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"reason": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer"]
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}}/:merchantId/testorders/:orderId/cancelByCustomer" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"reason\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer",
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([
'reason' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer', [
'body' => '{
"reason": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'reason' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'reason' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"reason": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"reason": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"reason\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/testorders/:orderId/cancelByCustomer", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer"
payload = { "reason": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer"
payload <- "{\n \"reason\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer")
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 \"reason\": \"\"\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.post('/baseUrl/:merchantId/testorders/:orderId/cancelByCustomer') do |req|
req.body = "{\n \"reason\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer";
let payload = json!({"reason": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer \
--header 'content-type: application/json' \
--data '{
"reason": ""
}'
echo '{
"reason": ""
}' | \
http POST {{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "reason": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["reason": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/testorders/:orderId/cancelByCustomer")! 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()
POST
content.orders.captureOrder
{{baseUrl}}/:merchantId/orders/:orderId/captureOrder
QUERY PARAMS
merchantId
orderId
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/:merchantId/orders/:orderId/captureOrder"),
Content = new StringContent("{}")
{
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}}/:merchantId/orders/:orderId/captureOrder");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder"
payload := strings.NewReader("{}")
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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/captureOrder HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/captureOrder"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/captureOrder")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/captureOrder")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/captureOrder');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/captureOrder',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/captureOrder';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/:merchantId/orders/:orderId/captureOrder',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/captureOrder")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/captureOrder',
headers: {
'content-type': 'application/json'
}
};
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/captureOrder',
headers: {'content-type': 'application/json'},
body: {},
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}}/:merchantId/orders/:orderId/captureOrder');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/:merchantId/orders/:orderId/captureOrder',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/captureOrder';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/captureOrder"]
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}}/:merchantId/orders/:orderId/captureOrder" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/captureOrder",
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([
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/captureOrder', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/captureOrder');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/captureOrder');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/captureOrder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/captureOrder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/captureOrder", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder"
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/captureOrder")
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 = "{}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/:merchantId/orders/:orderId/captureOrder') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/captureOrder \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/captureOrder \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/captureOrder
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/captureOrder")! 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()
POST
content.orders.createtestorder
{{baseUrl}}/:merchantId/testorders
QUERY PARAMS
merchantId
BODY json
{
"country": "",
"templateName": "",
"testOrder": {
"deliveryDetails": {
"address": {
"country": "",
"fullAddress": [],
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"isScheduledDelivery": false,
"phoneNumber": ""
},
"enableOrderinvoices": false,
"kind": "",
"lineItems": [
{
"product": {
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
{
"amount": {
"currency": "",
"value": ""
},
"name": ""
}
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": {},
"targetCountry": "",
"title": "",
"variantAttributes": [
{
"dimension": "",
"value": ""
}
]
},
"quantityOrdered": 0,
"returnInfo": {
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
},
"shippingDetails": {
"deliverByDate": "",
"method": {
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
},
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
}
}
],
"notificationMode": "",
"pickupDetails": {
"locationCode": "",
"pickupLocationAddress": {},
"pickupLocationType": "",
"pickupPersons": [
{
"name": "",
"phoneNumber": ""
}
]
},
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
{
"applicableItems": [
{
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
}
],
"appliedItems": [
{}
],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": {},
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": {},
"title": "",
"type": ""
}
],
"shippingCost": {},
"shippingOption": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/testorders");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/testorders" {:content-type :json
:form-params {:country ""
:templateName ""
:testOrder {:deliveryDetails {:address {:country ""
:fullAddress []
:isPostOfficeBox false
:locality ""
:postalCode ""
:recipientName ""
:region ""
:streetAddress []}
:isScheduledDelivery false
:phoneNumber ""}
:enableOrderinvoices false
:kind ""
:lineItems [{:product {:brand ""
:condition ""
:contentLanguage ""
:fees [{:amount {:currency ""
:value ""}
:name ""}]
:gtin ""
:imageLink ""
:itemGroupId ""
:mpn ""
:offerId ""
:price {}
:targetCountry ""
:title ""
:variantAttributes [{:dimension ""
:value ""}]}
:quantityOrdered 0
:returnInfo {:daysToReturn 0
:isReturnable false
:policyUrl ""}
:shippingDetails {:deliverByDate ""
:method {:carrier ""
:maxDaysInTransit 0
:methodName ""
:minDaysInTransit 0}
:pickupPromiseInMinutes 0
:shipByDate ""
:type ""}}]
:notificationMode ""
:pickupDetails {:locationCode ""
:pickupLocationAddress {}
:pickupLocationType ""
:pickupPersons [{:name ""
:phoneNumber ""}]}
:predefinedBillingAddress ""
:predefinedDeliveryAddress ""
:predefinedEmail ""
:predefinedPickupDetails ""
:promotions [{:applicableItems [{:lineItemId ""
:offerId ""
:productId ""
:quantity 0}]
:appliedItems [{}]
:endTime ""
:funder ""
:merchantPromotionId ""
:priceValue {}
:shortTitle ""
:startTime ""
:subtype ""
:taxValue {}
:title ""
:type ""}]
:shippingCost {}
:shippingOption ""}}})
require "http/client"
url = "{{baseUrl}}/:merchantId/testorders"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\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}}/:merchantId/testorders"),
Content = new StringContent("{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\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}}/:merchantId/testorders");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/testorders"
payload := strings.NewReader("{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/testorders HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2546
{
"country": "",
"templateName": "",
"testOrder": {
"deliveryDetails": {
"address": {
"country": "",
"fullAddress": [],
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"isScheduledDelivery": false,
"phoneNumber": ""
},
"enableOrderinvoices": false,
"kind": "",
"lineItems": [
{
"product": {
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
{
"amount": {
"currency": "",
"value": ""
},
"name": ""
}
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": {},
"targetCountry": "",
"title": "",
"variantAttributes": [
{
"dimension": "",
"value": ""
}
]
},
"quantityOrdered": 0,
"returnInfo": {
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
},
"shippingDetails": {
"deliverByDate": "",
"method": {
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
},
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
}
}
],
"notificationMode": "",
"pickupDetails": {
"locationCode": "",
"pickupLocationAddress": {},
"pickupLocationType": "",
"pickupPersons": [
{
"name": "",
"phoneNumber": ""
}
]
},
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
{
"applicableItems": [
{
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
}
],
"appliedItems": [
{}
],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": {},
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": {},
"title": "",
"type": ""
}
],
"shippingCost": {},
"shippingOption": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/testorders")
.setHeader("content-type", "application/json")
.setBody("{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/testorders"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\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 \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/testorders")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/testorders")
.header("content-type", "application/json")
.body("{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
country: '',
templateName: '',
testOrder: {
deliveryDetails: {
address: {
country: '',
fullAddress: [],
isPostOfficeBox: false,
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
isScheduledDelivery: false,
phoneNumber: ''
},
enableOrderinvoices: false,
kind: '',
lineItems: [
{
product: {
brand: '',
condition: '',
contentLanguage: '',
fees: [
{
amount: {
currency: '',
value: ''
},
name: ''
}
],
gtin: '',
imageLink: '',
itemGroupId: '',
mpn: '',
offerId: '',
price: {},
targetCountry: '',
title: '',
variantAttributes: [
{
dimension: '',
value: ''
}
]
},
quantityOrdered: 0,
returnInfo: {
daysToReturn: 0,
isReturnable: false,
policyUrl: ''
},
shippingDetails: {
deliverByDate: '',
method: {
carrier: '',
maxDaysInTransit: 0,
methodName: '',
minDaysInTransit: 0
},
pickupPromiseInMinutes: 0,
shipByDate: '',
type: ''
}
}
],
notificationMode: '',
pickupDetails: {
locationCode: '',
pickupLocationAddress: {},
pickupLocationType: '',
pickupPersons: [
{
name: '',
phoneNumber: ''
}
]
},
predefinedBillingAddress: '',
predefinedDeliveryAddress: '',
predefinedEmail: '',
predefinedPickupDetails: '',
promotions: [
{
applicableItems: [
{
lineItemId: '',
offerId: '',
productId: '',
quantity: 0
}
],
appliedItems: [
{}
],
endTime: '',
funder: '',
merchantPromotionId: '',
priceValue: {},
shortTitle: '',
startTime: '',
subtype: '',
taxValue: {},
title: '',
type: ''
}
],
shippingCost: {},
shippingOption: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/testorders');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/testorders',
headers: {'content-type': 'application/json'},
data: {
country: '',
templateName: '',
testOrder: {
deliveryDetails: {
address: {
country: '',
fullAddress: [],
isPostOfficeBox: false,
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
isScheduledDelivery: false,
phoneNumber: ''
},
enableOrderinvoices: false,
kind: '',
lineItems: [
{
product: {
brand: '',
condition: '',
contentLanguage: '',
fees: [{amount: {currency: '', value: ''}, name: ''}],
gtin: '',
imageLink: '',
itemGroupId: '',
mpn: '',
offerId: '',
price: {},
targetCountry: '',
title: '',
variantAttributes: [{dimension: '', value: ''}]
},
quantityOrdered: 0,
returnInfo: {daysToReturn: 0, isReturnable: false, policyUrl: ''},
shippingDetails: {
deliverByDate: '',
method: {carrier: '', maxDaysInTransit: 0, methodName: '', minDaysInTransit: 0},
pickupPromiseInMinutes: 0,
shipByDate: '',
type: ''
}
}
],
notificationMode: '',
pickupDetails: {
locationCode: '',
pickupLocationAddress: {},
pickupLocationType: '',
pickupPersons: [{name: '', phoneNumber: ''}]
},
predefinedBillingAddress: '',
predefinedDeliveryAddress: '',
predefinedEmail: '',
predefinedPickupDetails: '',
promotions: [
{
applicableItems: [{lineItemId: '', offerId: '', productId: '', quantity: 0}],
appliedItems: [{}],
endTime: '',
funder: '',
merchantPromotionId: '',
priceValue: {},
shortTitle: '',
startTime: '',
subtype: '',
taxValue: {},
title: '',
type: ''
}
],
shippingCost: {},
shippingOption: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/testorders';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"country":"","templateName":"","testOrder":{"deliveryDetails":{"address":{"country":"","fullAddress":[],"isPostOfficeBox":false,"locality":"","postalCode":"","recipientName":"","region":"","streetAddress":[]},"isScheduledDelivery":false,"phoneNumber":""},"enableOrderinvoices":false,"kind":"","lineItems":[{"product":{"brand":"","condition":"","contentLanguage":"","fees":[{"amount":{"currency":"","value":""},"name":""}],"gtin":"","imageLink":"","itemGroupId":"","mpn":"","offerId":"","price":{},"targetCountry":"","title":"","variantAttributes":[{"dimension":"","value":""}]},"quantityOrdered":0,"returnInfo":{"daysToReturn":0,"isReturnable":false,"policyUrl":""},"shippingDetails":{"deliverByDate":"","method":{"carrier":"","maxDaysInTransit":0,"methodName":"","minDaysInTransit":0},"pickupPromiseInMinutes":0,"shipByDate":"","type":""}}],"notificationMode":"","pickupDetails":{"locationCode":"","pickupLocationAddress":{},"pickupLocationType":"","pickupPersons":[{"name":"","phoneNumber":""}]},"predefinedBillingAddress":"","predefinedDeliveryAddress":"","predefinedEmail":"","predefinedPickupDetails":"","promotions":[{"applicableItems":[{"lineItemId":"","offerId":"","productId":"","quantity":0}],"appliedItems":[{}],"endTime":"","funder":"","merchantPromotionId":"","priceValue":{},"shortTitle":"","startTime":"","subtype":"","taxValue":{},"title":"","type":""}],"shippingCost":{},"shippingOption":""}}'
};
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}}/:merchantId/testorders',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "country": "",\n "templateName": "",\n "testOrder": {\n "deliveryDetails": {\n "address": {\n "country": "",\n "fullAddress": [],\n "isPostOfficeBox": false,\n "locality": "",\n "postalCode": "",\n "recipientName": "",\n "region": "",\n "streetAddress": []\n },\n "isScheduledDelivery": false,\n "phoneNumber": ""\n },\n "enableOrderinvoices": false,\n "kind": "",\n "lineItems": [\n {\n "product": {\n "brand": "",\n "condition": "",\n "contentLanguage": "",\n "fees": [\n {\n "amount": {\n "currency": "",\n "value": ""\n },\n "name": ""\n }\n ],\n "gtin": "",\n "imageLink": "",\n "itemGroupId": "",\n "mpn": "",\n "offerId": "",\n "price": {},\n "targetCountry": "",\n "title": "",\n "variantAttributes": [\n {\n "dimension": "",\n "value": ""\n }\n ]\n },\n "quantityOrdered": 0,\n "returnInfo": {\n "daysToReturn": 0,\n "isReturnable": false,\n "policyUrl": ""\n },\n "shippingDetails": {\n "deliverByDate": "",\n "method": {\n "carrier": "",\n "maxDaysInTransit": 0,\n "methodName": "",\n "minDaysInTransit": 0\n },\n "pickupPromiseInMinutes": 0,\n "shipByDate": "",\n "type": ""\n }\n }\n ],\n "notificationMode": "",\n "pickupDetails": {\n "locationCode": "",\n "pickupLocationAddress": {},\n "pickupLocationType": "",\n "pickupPersons": [\n {\n "name": "",\n "phoneNumber": ""\n }\n ]\n },\n "predefinedBillingAddress": "",\n "predefinedDeliveryAddress": "",\n "predefinedEmail": "",\n "predefinedPickupDetails": "",\n "promotions": [\n {\n "applicableItems": [\n {\n "lineItemId": "",\n "offerId": "",\n "productId": "",\n "quantity": 0\n }\n ],\n "appliedItems": [\n {}\n ],\n "endTime": "",\n "funder": "",\n "merchantPromotionId": "",\n "priceValue": {},\n "shortTitle": "",\n "startTime": "",\n "subtype": "",\n "taxValue": {},\n "title": "",\n "type": ""\n }\n ],\n "shippingCost": {},\n "shippingOption": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/testorders")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/testorders',
headers: {
'content-type': 'application/json'
}
};
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({
country: '',
templateName: '',
testOrder: {
deliveryDetails: {
address: {
country: '',
fullAddress: [],
isPostOfficeBox: false,
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
isScheduledDelivery: false,
phoneNumber: ''
},
enableOrderinvoices: false,
kind: '',
lineItems: [
{
product: {
brand: '',
condition: '',
contentLanguage: '',
fees: [{amount: {currency: '', value: ''}, name: ''}],
gtin: '',
imageLink: '',
itemGroupId: '',
mpn: '',
offerId: '',
price: {},
targetCountry: '',
title: '',
variantAttributes: [{dimension: '', value: ''}]
},
quantityOrdered: 0,
returnInfo: {daysToReturn: 0, isReturnable: false, policyUrl: ''},
shippingDetails: {
deliverByDate: '',
method: {carrier: '', maxDaysInTransit: 0, methodName: '', minDaysInTransit: 0},
pickupPromiseInMinutes: 0,
shipByDate: '',
type: ''
}
}
],
notificationMode: '',
pickupDetails: {
locationCode: '',
pickupLocationAddress: {},
pickupLocationType: '',
pickupPersons: [{name: '', phoneNumber: ''}]
},
predefinedBillingAddress: '',
predefinedDeliveryAddress: '',
predefinedEmail: '',
predefinedPickupDetails: '',
promotions: [
{
applicableItems: [{lineItemId: '', offerId: '', productId: '', quantity: 0}],
appliedItems: [{}],
endTime: '',
funder: '',
merchantPromotionId: '',
priceValue: {},
shortTitle: '',
startTime: '',
subtype: '',
taxValue: {},
title: '',
type: ''
}
],
shippingCost: {},
shippingOption: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/testorders',
headers: {'content-type': 'application/json'},
body: {
country: '',
templateName: '',
testOrder: {
deliveryDetails: {
address: {
country: '',
fullAddress: [],
isPostOfficeBox: false,
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
isScheduledDelivery: false,
phoneNumber: ''
},
enableOrderinvoices: false,
kind: '',
lineItems: [
{
product: {
brand: '',
condition: '',
contentLanguage: '',
fees: [{amount: {currency: '', value: ''}, name: ''}],
gtin: '',
imageLink: '',
itemGroupId: '',
mpn: '',
offerId: '',
price: {},
targetCountry: '',
title: '',
variantAttributes: [{dimension: '', value: ''}]
},
quantityOrdered: 0,
returnInfo: {daysToReturn: 0, isReturnable: false, policyUrl: ''},
shippingDetails: {
deliverByDate: '',
method: {carrier: '', maxDaysInTransit: 0, methodName: '', minDaysInTransit: 0},
pickupPromiseInMinutes: 0,
shipByDate: '',
type: ''
}
}
],
notificationMode: '',
pickupDetails: {
locationCode: '',
pickupLocationAddress: {},
pickupLocationType: '',
pickupPersons: [{name: '', phoneNumber: ''}]
},
predefinedBillingAddress: '',
predefinedDeliveryAddress: '',
predefinedEmail: '',
predefinedPickupDetails: '',
promotions: [
{
applicableItems: [{lineItemId: '', offerId: '', productId: '', quantity: 0}],
appliedItems: [{}],
endTime: '',
funder: '',
merchantPromotionId: '',
priceValue: {},
shortTitle: '',
startTime: '',
subtype: '',
taxValue: {},
title: '',
type: ''
}
],
shippingCost: {},
shippingOption: ''
}
},
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}}/:merchantId/testorders');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
country: '',
templateName: '',
testOrder: {
deliveryDetails: {
address: {
country: '',
fullAddress: [],
isPostOfficeBox: false,
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
isScheduledDelivery: false,
phoneNumber: ''
},
enableOrderinvoices: false,
kind: '',
lineItems: [
{
product: {
brand: '',
condition: '',
contentLanguage: '',
fees: [
{
amount: {
currency: '',
value: ''
},
name: ''
}
],
gtin: '',
imageLink: '',
itemGroupId: '',
mpn: '',
offerId: '',
price: {},
targetCountry: '',
title: '',
variantAttributes: [
{
dimension: '',
value: ''
}
]
},
quantityOrdered: 0,
returnInfo: {
daysToReturn: 0,
isReturnable: false,
policyUrl: ''
},
shippingDetails: {
deliverByDate: '',
method: {
carrier: '',
maxDaysInTransit: 0,
methodName: '',
minDaysInTransit: 0
},
pickupPromiseInMinutes: 0,
shipByDate: '',
type: ''
}
}
],
notificationMode: '',
pickupDetails: {
locationCode: '',
pickupLocationAddress: {},
pickupLocationType: '',
pickupPersons: [
{
name: '',
phoneNumber: ''
}
]
},
predefinedBillingAddress: '',
predefinedDeliveryAddress: '',
predefinedEmail: '',
predefinedPickupDetails: '',
promotions: [
{
applicableItems: [
{
lineItemId: '',
offerId: '',
productId: '',
quantity: 0
}
],
appliedItems: [
{}
],
endTime: '',
funder: '',
merchantPromotionId: '',
priceValue: {},
shortTitle: '',
startTime: '',
subtype: '',
taxValue: {},
title: '',
type: ''
}
],
shippingCost: {},
shippingOption: ''
}
});
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}}/:merchantId/testorders',
headers: {'content-type': 'application/json'},
data: {
country: '',
templateName: '',
testOrder: {
deliveryDetails: {
address: {
country: '',
fullAddress: [],
isPostOfficeBox: false,
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
isScheduledDelivery: false,
phoneNumber: ''
},
enableOrderinvoices: false,
kind: '',
lineItems: [
{
product: {
brand: '',
condition: '',
contentLanguage: '',
fees: [{amount: {currency: '', value: ''}, name: ''}],
gtin: '',
imageLink: '',
itemGroupId: '',
mpn: '',
offerId: '',
price: {},
targetCountry: '',
title: '',
variantAttributes: [{dimension: '', value: ''}]
},
quantityOrdered: 0,
returnInfo: {daysToReturn: 0, isReturnable: false, policyUrl: ''},
shippingDetails: {
deliverByDate: '',
method: {carrier: '', maxDaysInTransit: 0, methodName: '', minDaysInTransit: 0},
pickupPromiseInMinutes: 0,
shipByDate: '',
type: ''
}
}
],
notificationMode: '',
pickupDetails: {
locationCode: '',
pickupLocationAddress: {},
pickupLocationType: '',
pickupPersons: [{name: '', phoneNumber: ''}]
},
predefinedBillingAddress: '',
predefinedDeliveryAddress: '',
predefinedEmail: '',
predefinedPickupDetails: '',
promotions: [
{
applicableItems: [{lineItemId: '', offerId: '', productId: '', quantity: 0}],
appliedItems: [{}],
endTime: '',
funder: '',
merchantPromotionId: '',
priceValue: {},
shortTitle: '',
startTime: '',
subtype: '',
taxValue: {},
title: '',
type: ''
}
],
shippingCost: {},
shippingOption: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/testorders';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"country":"","templateName":"","testOrder":{"deliveryDetails":{"address":{"country":"","fullAddress":[],"isPostOfficeBox":false,"locality":"","postalCode":"","recipientName":"","region":"","streetAddress":[]},"isScheduledDelivery":false,"phoneNumber":""},"enableOrderinvoices":false,"kind":"","lineItems":[{"product":{"brand":"","condition":"","contentLanguage":"","fees":[{"amount":{"currency":"","value":""},"name":""}],"gtin":"","imageLink":"","itemGroupId":"","mpn":"","offerId":"","price":{},"targetCountry":"","title":"","variantAttributes":[{"dimension":"","value":""}]},"quantityOrdered":0,"returnInfo":{"daysToReturn":0,"isReturnable":false,"policyUrl":""},"shippingDetails":{"deliverByDate":"","method":{"carrier":"","maxDaysInTransit":0,"methodName":"","minDaysInTransit":0},"pickupPromiseInMinutes":0,"shipByDate":"","type":""}}],"notificationMode":"","pickupDetails":{"locationCode":"","pickupLocationAddress":{},"pickupLocationType":"","pickupPersons":[{"name":"","phoneNumber":""}]},"predefinedBillingAddress":"","predefinedDeliveryAddress":"","predefinedEmail":"","predefinedPickupDetails":"","promotions":[{"applicableItems":[{"lineItemId":"","offerId":"","productId":"","quantity":0}],"appliedItems":[{}],"endTime":"","funder":"","merchantPromotionId":"","priceValue":{},"shortTitle":"","startTime":"","subtype":"","taxValue":{},"title":"","type":""}],"shippingCost":{},"shippingOption":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"country": @"",
@"templateName": @"",
@"testOrder": @{ @"deliveryDetails": @{ @"address": @{ @"country": @"", @"fullAddress": @[ ], @"isPostOfficeBox": @NO, @"locality": @"", @"postalCode": @"", @"recipientName": @"", @"region": @"", @"streetAddress": @[ ] }, @"isScheduledDelivery": @NO, @"phoneNumber": @"" }, @"enableOrderinvoices": @NO, @"kind": @"", @"lineItems": @[ @{ @"product": @{ @"brand": @"", @"condition": @"", @"contentLanguage": @"", @"fees": @[ @{ @"amount": @{ @"currency": @"", @"value": @"" }, @"name": @"" } ], @"gtin": @"", @"imageLink": @"", @"itemGroupId": @"", @"mpn": @"", @"offerId": @"", @"price": @{ }, @"targetCountry": @"", @"title": @"", @"variantAttributes": @[ @{ @"dimension": @"", @"value": @"" } ] }, @"quantityOrdered": @0, @"returnInfo": @{ @"daysToReturn": @0, @"isReturnable": @NO, @"policyUrl": @"" }, @"shippingDetails": @{ @"deliverByDate": @"", @"method": @{ @"carrier": @"", @"maxDaysInTransit": @0, @"methodName": @"", @"minDaysInTransit": @0 }, @"pickupPromiseInMinutes": @0, @"shipByDate": @"", @"type": @"" } } ], @"notificationMode": @"", @"pickupDetails": @{ @"locationCode": @"", @"pickupLocationAddress": @{ }, @"pickupLocationType": @"", @"pickupPersons": @[ @{ @"name": @"", @"phoneNumber": @"" } ] }, @"predefinedBillingAddress": @"", @"predefinedDeliveryAddress": @"", @"predefinedEmail": @"", @"predefinedPickupDetails": @"", @"promotions": @[ @{ @"applicableItems": @[ @{ @"lineItemId": @"", @"offerId": @"", @"productId": @"", @"quantity": @0 } ], @"appliedItems": @[ @{ } ], @"endTime": @"", @"funder": @"", @"merchantPromotionId": @"", @"priceValue": @{ }, @"shortTitle": @"", @"startTime": @"", @"subtype": @"", @"taxValue": @{ }, @"title": @"", @"type": @"" } ], @"shippingCost": @{ }, @"shippingOption": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/testorders"]
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}}/:merchantId/testorders" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/testorders",
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([
'country' => '',
'templateName' => '',
'testOrder' => [
'deliveryDetails' => [
'address' => [
'country' => '',
'fullAddress' => [
],
'isPostOfficeBox' => null,
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'isScheduledDelivery' => null,
'phoneNumber' => ''
],
'enableOrderinvoices' => null,
'kind' => '',
'lineItems' => [
[
'product' => [
'brand' => '',
'condition' => '',
'contentLanguage' => '',
'fees' => [
[
'amount' => [
'currency' => '',
'value' => ''
],
'name' => ''
]
],
'gtin' => '',
'imageLink' => '',
'itemGroupId' => '',
'mpn' => '',
'offerId' => '',
'price' => [
],
'targetCountry' => '',
'title' => '',
'variantAttributes' => [
[
'dimension' => '',
'value' => ''
]
]
],
'quantityOrdered' => 0,
'returnInfo' => [
'daysToReturn' => 0,
'isReturnable' => null,
'policyUrl' => ''
],
'shippingDetails' => [
'deliverByDate' => '',
'method' => [
'carrier' => '',
'maxDaysInTransit' => 0,
'methodName' => '',
'minDaysInTransit' => 0
],
'pickupPromiseInMinutes' => 0,
'shipByDate' => '',
'type' => ''
]
]
],
'notificationMode' => '',
'pickupDetails' => [
'locationCode' => '',
'pickupLocationAddress' => [
],
'pickupLocationType' => '',
'pickupPersons' => [
[
'name' => '',
'phoneNumber' => ''
]
]
],
'predefinedBillingAddress' => '',
'predefinedDeliveryAddress' => '',
'predefinedEmail' => '',
'predefinedPickupDetails' => '',
'promotions' => [
[
'applicableItems' => [
[
'lineItemId' => '',
'offerId' => '',
'productId' => '',
'quantity' => 0
]
],
'appliedItems' => [
[
]
],
'endTime' => '',
'funder' => '',
'merchantPromotionId' => '',
'priceValue' => [
],
'shortTitle' => '',
'startTime' => '',
'subtype' => '',
'taxValue' => [
],
'title' => '',
'type' => ''
]
],
'shippingCost' => [
],
'shippingOption' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/testorders', [
'body' => '{
"country": "",
"templateName": "",
"testOrder": {
"deliveryDetails": {
"address": {
"country": "",
"fullAddress": [],
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"isScheduledDelivery": false,
"phoneNumber": ""
},
"enableOrderinvoices": false,
"kind": "",
"lineItems": [
{
"product": {
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
{
"amount": {
"currency": "",
"value": ""
},
"name": ""
}
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": {},
"targetCountry": "",
"title": "",
"variantAttributes": [
{
"dimension": "",
"value": ""
}
]
},
"quantityOrdered": 0,
"returnInfo": {
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
},
"shippingDetails": {
"deliverByDate": "",
"method": {
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
},
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
}
}
],
"notificationMode": "",
"pickupDetails": {
"locationCode": "",
"pickupLocationAddress": {},
"pickupLocationType": "",
"pickupPersons": [
{
"name": "",
"phoneNumber": ""
}
]
},
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
{
"applicableItems": [
{
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
}
],
"appliedItems": [
{}
],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": {},
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": {},
"title": "",
"type": ""
}
],
"shippingCost": {},
"shippingOption": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/testorders');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'country' => '',
'templateName' => '',
'testOrder' => [
'deliveryDetails' => [
'address' => [
'country' => '',
'fullAddress' => [
],
'isPostOfficeBox' => null,
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'isScheduledDelivery' => null,
'phoneNumber' => ''
],
'enableOrderinvoices' => null,
'kind' => '',
'lineItems' => [
[
'product' => [
'brand' => '',
'condition' => '',
'contentLanguage' => '',
'fees' => [
[
'amount' => [
'currency' => '',
'value' => ''
],
'name' => ''
]
],
'gtin' => '',
'imageLink' => '',
'itemGroupId' => '',
'mpn' => '',
'offerId' => '',
'price' => [
],
'targetCountry' => '',
'title' => '',
'variantAttributes' => [
[
'dimension' => '',
'value' => ''
]
]
],
'quantityOrdered' => 0,
'returnInfo' => [
'daysToReturn' => 0,
'isReturnable' => null,
'policyUrl' => ''
],
'shippingDetails' => [
'deliverByDate' => '',
'method' => [
'carrier' => '',
'maxDaysInTransit' => 0,
'methodName' => '',
'minDaysInTransit' => 0
],
'pickupPromiseInMinutes' => 0,
'shipByDate' => '',
'type' => ''
]
]
],
'notificationMode' => '',
'pickupDetails' => [
'locationCode' => '',
'pickupLocationAddress' => [
],
'pickupLocationType' => '',
'pickupPersons' => [
[
'name' => '',
'phoneNumber' => ''
]
]
],
'predefinedBillingAddress' => '',
'predefinedDeliveryAddress' => '',
'predefinedEmail' => '',
'predefinedPickupDetails' => '',
'promotions' => [
[
'applicableItems' => [
[
'lineItemId' => '',
'offerId' => '',
'productId' => '',
'quantity' => 0
]
],
'appliedItems' => [
[
]
],
'endTime' => '',
'funder' => '',
'merchantPromotionId' => '',
'priceValue' => [
],
'shortTitle' => '',
'startTime' => '',
'subtype' => '',
'taxValue' => [
],
'title' => '',
'type' => ''
]
],
'shippingCost' => [
],
'shippingOption' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'country' => '',
'templateName' => '',
'testOrder' => [
'deliveryDetails' => [
'address' => [
'country' => '',
'fullAddress' => [
],
'isPostOfficeBox' => null,
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'isScheduledDelivery' => null,
'phoneNumber' => ''
],
'enableOrderinvoices' => null,
'kind' => '',
'lineItems' => [
[
'product' => [
'brand' => '',
'condition' => '',
'contentLanguage' => '',
'fees' => [
[
'amount' => [
'currency' => '',
'value' => ''
],
'name' => ''
]
],
'gtin' => '',
'imageLink' => '',
'itemGroupId' => '',
'mpn' => '',
'offerId' => '',
'price' => [
],
'targetCountry' => '',
'title' => '',
'variantAttributes' => [
[
'dimension' => '',
'value' => ''
]
]
],
'quantityOrdered' => 0,
'returnInfo' => [
'daysToReturn' => 0,
'isReturnable' => null,
'policyUrl' => ''
],
'shippingDetails' => [
'deliverByDate' => '',
'method' => [
'carrier' => '',
'maxDaysInTransit' => 0,
'methodName' => '',
'minDaysInTransit' => 0
],
'pickupPromiseInMinutes' => 0,
'shipByDate' => '',
'type' => ''
]
]
],
'notificationMode' => '',
'pickupDetails' => [
'locationCode' => '',
'pickupLocationAddress' => [
],
'pickupLocationType' => '',
'pickupPersons' => [
[
'name' => '',
'phoneNumber' => ''
]
]
],
'predefinedBillingAddress' => '',
'predefinedDeliveryAddress' => '',
'predefinedEmail' => '',
'predefinedPickupDetails' => '',
'promotions' => [
[
'applicableItems' => [
[
'lineItemId' => '',
'offerId' => '',
'productId' => '',
'quantity' => 0
]
],
'appliedItems' => [
[
]
],
'endTime' => '',
'funder' => '',
'merchantPromotionId' => '',
'priceValue' => [
],
'shortTitle' => '',
'startTime' => '',
'subtype' => '',
'taxValue' => [
],
'title' => '',
'type' => ''
]
],
'shippingCost' => [
],
'shippingOption' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/testorders');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/testorders' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"country": "",
"templateName": "",
"testOrder": {
"deliveryDetails": {
"address": {
"country": "",
"fullAddress": [],
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"isScheduledDelivery": false,
"phoneNumber": ""
},
"enableOrderinvoices": false,
"kind": "",
"lineItems": [
{
"product": {
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
{
"amount": {
"currency": "",
"value": ""
},
"name": ""
}
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": {},
"targetCountry": "",
"title": "",
"variantAttributes": [
{
"dimension": "",
"value": ""
}
]
},
"quantityOrdered": 0,
"returnInfo": {
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
},
"shippingDetails": {
"deliverByDate": "",
"method": {
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
},
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
}
}
],
"notificationMode": "",
"pickupDetails": {
"locationCode": "",
"pickupLocationAddress": {},
"pickupLocationType": "",
"pickupPersons": [
{
"name": "",
"phoneNumber": ""
}
]
},
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
{
"applicableItems": [
{
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
}
],
"appliedItems": [
{}
],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": {},
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": {},
"title": "",
"type": ""
}
],
"shippingCost": {},
"shippingOption": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/testorders' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"country": "",
"templateName": "",
"testOrder": {
"deliveryDetails": {
"address": {
"country": "",
"fullAddress": [],
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"isScheduledDelivery": false,
"phoneNumber": ""
},
"enableOrderinvoices": false,
"kind": "",
"lineItems": [
{
"product": {
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
{
"amount": {
"currency": "",
"value": ""
},
"name": ""
}
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": {},
"targetCountry": "",
"title": "",
"variantAttributes": [
{
"dimension": "",
"value": ""
}
]
},
"quantityOrdered": 0,
"returnInfo": {
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
},
"shippingDetails": {
"deliverByDate": "",
"method": {
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
},
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
}
}
],
"notificationMode": "",
"pickupDetails": {
"locationCode": "",
"pickupLocationAddress": {},
"pickupLocationType": "",
"pickupPersons": [
{
"name": "",
"phoneNumber": ""
}
]
},
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
{
"applicableItems": [
{
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
}
],
"appliedItems": [
{}
],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": {},
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": {},
"title": "",
"type": ""
}
],
"shippingCost": {},
"shippingOption": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/testorders", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/testorders"
payload = {
"country": "",
"templateName": "",
"testOrder": {
"deliveryDetails": {
"address": {
"country": "",
"fullAddress": [],
"isPostOfficeBox": False,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"isScheduledDelivery": False,
"phoneNumber": ""
},
"enableOrderinvoices": False,
"kind": "",
"lineItems": [
{
"product": {
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
{
"amount": {
"currency": "",
"value": ""
},
"name": ""
}
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": {},
"targetCountry": "",
"title": "",
"variantAttributes": [
{
"dimension": "",
"value": ""
}
]
},
"quantityOrdered": 0,
"returnInfo": {
"daysToReturn": 0,
"isReturnable": False,
"policyUrl": ""
},
"shippingDetails": {
"deliverByDate": "",
"method": {
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
},
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
}
}
],
"notificationMode": "",
"pickupDetails": {
"locationCode": "",
"pickupLocationAddress": {},
"pickupLocationType": "",
"pickupPersons": [
{
"name": "",
"phoneNumber": ""
}
]
},
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
{
"applicableItems": [
{
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
}
],
"appliedItems": [{}],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": {},
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": {},
"title": "",
"type": ""
}
],
"shippingCost": {},
"shippingOption": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/testorders"
payload <- "{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/testorders")
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 \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\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.post('/baseUrl/:merchantId/testorders') do |req|
req.body = "{\n \"country\": \"\",\n \"templateName\": \"\",\n \"testOrder\": {\n \"deliveryDetails\": {\n \"address\": {\n \"country\": \"\",\n \"fullAddress\": [],\n \"isPostOfficeBox\": false,\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"isScheduledDelivery\": false,\n \"phoneNumber\": \"\"\n },\n \"enableOrderinvoices\": false,\n \"kind\": \"\",\n \"lineItems\": [\n {\n \"product\": {\n \"brand\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"fees\": [\n {\n \"amount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"name\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"imageLink\": \"\",\n \"itemGroupId\": \"\",\n \"mpn\": \"\",\n \"offerId\": \"\",\n \"price\": {},\n \"targetCountry\": \"\",\n \"title\": \"\",\n \"variantAttributes\": [\n {\n \"dimension\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"quantityOrdered\": 0,\n \"returnInfo\": {\n \"daysToReturn\": 0,\n \"isReturnable\": false,\n \"policyUrl\": \"\"\n },\n \"shippingDetails\": {\n \"deliverByDate\": \"\",\n \"method\": {\n \"carrier\": \"\",\n \"maxDaysInTransit\": 0,\n \"methodName\": \"\",\n \"minDaysInTransit\": 0\n },\n \"pickupPromiseInMinutes\": 0,\n \"shipByDate\": \"\",\n \"type\": \"\"\n }\n }\n ],\n \"notificationMode\": \"\",\n \"pickupDetails\": {\n \"locationCode\": \"\",\n \"pickupLocationAddress\": {},\n \"pickupLocationType\": \"\",\n \"pickupPersons\": [\n {\n \"name\": \"\",\n \"phoneNumber\": \"\"\n }\n ]\n },\n \"predefinedBillingAddress\": \"\",\n \"predefinedDeliveryAddress\": \"\",\n \"predefinedEmail\": \"\",\n \"predefinedPickupDetails\": \"\",\n \"promotions\": [\n {\n \"applicableItems\": [\n {\n \"lineItemId\": \"\",\n \"offerId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"appliedItems\": [\n {}\n ],\n \"endTime\": \"\",\n \"funder\": \"\",\n \"merchantPromotionId\": \"\",\n \"priceValue\": {},\n \"shortTitle\": \"\",\n \"startTime\": \"\",\n \"subtype\": \"\",\n \"taxValue\": {},\n \"title\": \"\",\n \"type\": \"\"\n }\n ],\n \"shippingCost\": {},\n \"shippingOption\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/testorders";
let payload = json!({
"country": "",
"templateName": "",
"testOrder": json!({
"deliveryDetails": json!({
"address": json!({
"country": "",
"fullAddress": (),
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": ()
}),
"isScheduledDelivery": false,
"phoneNumber": ""
}),
"enableOrderinvoices": false,
"kind": "",
"lineItems": (
json!({
"product": json!({
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": (
json!({
"amount": json!({
"currency": "",
"value": ""
}),
"name": ""
})
),
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": json!({}),
"targetCountry": "",
"title": "",
"variantAttributes": (
json!({
"dimension": "",
"value": ""
})
)
}),
"quantityOrdered": 0,
"returnInfo": json!({
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
}),
"shippingDetails": json!({
"deliverByDate": "",
"method": json!({
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
}),
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
})
})
),
"notificationMode": "",
"pickupDetails": json!({
"locationCode": "",
"pickupLocationAddress": json!({}),
"pickupLocationType": "",
"pickupPersons": (
json!({
"name": "",
"phoneNumber": ""
})
)
}),
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": (
json!({
"applicableItems": (
json!({
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
})
),
"appliedItems": (json!({})),
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": json!({}),
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": json!({}),
"title": "",
"type": ""
})
),
"shippingCost": json!({}),
"shippingOption": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/testorders \
--header 'content-type: application/json' \
--data '{
"country": "",
"templateName": "",
"testOrder": {
"deliveryDetails": {
"address": {
"country": "",
"fullAddress": [],
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"isScheduledDelivery": false,
"phoneNumber": ""
},
"enableOrderinvoices": false,
"kind": "",
"lineItems": [
{
"product": {
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
{
"amount": {
"currency": "",
"value": ""
},
"name": ""
}
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": {},
"targetCountry": "",
"title": "",
"variantAttributes": [
{
"dimension": "",
"value": ""
}
]
},
"quantityOrdered": 0,
"returnInfo": {
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
},
"shippingDetails": {
"deliverByDate": "",
"method": {
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
},
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
}
}
],
"notificationMode": "",
"pickupDetails": {
"locationCode": "",
"pickupLocationAddress": {},
"pickupLocationType": "",
"pickupPersons": [
{
"name": "",
"phoneNumber": ""
}
]
},
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
{
"applicableItems": [
{
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
}
],
"appliedItems": [
{}
],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": {},
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": {},
"title": "",
"type": ""
}
],
"shippingCost": {},
"shippingOption": ""
}
}'
echo '{
"country": "",
"templateName": "",
"testOrder": {
"deliveryDetails": {
"address": {
"country": "",
"fullAddress": [],
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"isScheduledDelivery": false,
"phoneNumber": ""
},
"enableOrderinvoices": false,
"kind": "",
"lineItems": [
{
"product": {
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
{
"amount": {
"currency": "",
"value": ""
},
"name": ""
}
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": {},
"targetCountry": "",
"title": "",
"variantAttributes": [
{
"dimension": "",
"value": ""
}
]
},
"quantityOrdered": 0,
"returnInfo": {
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
},
"shippingDetails": {
"deliverByDate": "",
"method": {
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
},
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
}
}
],
"notificationMode": "",
"pickupDetails": {
"locationCode": "",
"pickupLocationAddress": {},
"pickupLocationType": "",
"pickupPersons": [
{
"name": "",
"phoneNumber": ""
}
]
},
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
{
"applicableItems": [
{
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
}
],
"appliedItems": [
{}
],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": {},
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": {},
"title": "",
"type": ""
}
],
"shippingCost": {},
"shippingOption": ""
}
}' | \
http POST {{baseUrl}}/:merchantId/testorders \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "country": "",\n "templateName": "",\n "testOrder": {\n "deliveryDetails": {\n "address": {\n "country": "",\n "fullAddress": [],\n "isPostOfficeBox": false,\n "locality": "",\n "postalCode": "",\n "recipientName": "",\n "region": "",\n "streetAddress": []\n },\n "isScheduledDelivery": false,\n "phoneNumber": ""\n },\n "enableOrderinvoices": false,\n "kind": "",\n "lineItems": [\n {\n "product": {\n "brand": "",\n "condition": "",\n "contentLanguage": "",\n "fees": [\n {\n "amount": {\n "currency": "",\n "value": ""\n },\n "name": ""\n }\n ],\n "gtin": "",\n "imageLink": "",\n "itemGroupId": "",\n "mpn": "",\n "offerId": "",\n "price": {},\n "targetCountry": "",\n "title": "",\n "variantAttributes": [\n {\n "dimension": "",\n "value": ""\n }\n ]\n },\n "quantityOrdered": 0,\n "returnInfo": {\n "daysToReturn": 0,\n "isReturnable": false,\n "policyUrl": ""\n },\n "shippingDetails": {\n "deliverByDate": "",\n "method": {\n "carrier": "",\n "maxDaysInTransit": 0,\n "methodName": "",\n "minDaysInTransit": 0\n },\n "pickupPromiseInMinutes": 0,\n "shipByDate": "",\n "type": ""\n }\n }\n ],\n "notificationMode": "",\n "pickupDetails": {\n "locationCode": "",\n "pickupLocationAddress": {},\n "pickupLocationType": "",\n "pickupPersons": [\n {\n "name": "",\n "phoneNumber": ""\n }\n ]\n },\n "predefinedBillingAddress": "",\n "predefinedDeliveryAddress": "",\n "predefinedEmail": "",\n "predefinedPickupDetails": "",\n "promotions": [\n {\n "applicableItems": [\n {\n "lineItemId": "",\n "offerId": "",\n "productId": "",\n "quantity": 0\n }\n ],\n "appliedItems": [\n {}\n ],\n "endTime": "",\n "funder": "",\n "merchantPromotionId": "",\n "priceValue": {},\n "shortTitle": "",\n "startTime": "",\n "subtype": "",\n "taxValue": {},\n "title": "",\n "type": ""\n }\n ],\n "shippingCost": {},\n "shippingOption": ""\n }\n}' \
--output-document \
- {{baseUrl}}/:merchantId/testorders
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"country": "",
"templateName": "",
"testOrder": [
"deliveryDetails": [
"address": [
"country": "",
"fullAddress": [],
"isPostOfficeBox": false,
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
],
"isScheduledDelivery": false,
"phoneNumber": ""
],
"enableOrderinvoices": false,
"kind": "",
"lineItems": [
[
"product": [
"brand": "",
"condition": "",
"contentLanguage": "",
"fees": [
[
"amount": [
"currency": "",
"value": ""
],
"name": ""
]
],
"gtin": "",
"imageLink": "",
"itemGroupId": "",
"mpn": "",
"offerId": "",
"price": [],
"targetCountry": "",
"title": "",
"variantAttributes": [
[
"dimension": "",
"value": ""
]
]
],
"quantityOrdered": 0,
"returnInfo": [
"daysToReturn": 0,
"isReturnable": false,
"policyUrl": ""
],
"shippingDetails": [
"deliverByDate": "",
"method": [
"carrier": "",
"maxDaysInTransit": 0,
"methodName": "",
"minDaysInTransit": 0
],
"pickupPromiseInMinutes": 0,
"shipByDate": "",
"type": ""
]
]
],
"notificationMode": "",
"pickupDetails": [
"locationCode": "",
"pickupLocationAddress": [],
"pickupLocationType": "",
"pickupPersons": [
[
"name": "",
"phoneNumber": ""
]
]
],
"predefinedBillingAddress": "",
"predefinedDeliveryAddress": "",
"predefinedEmail": "",
"predefinedPickupDetails": "",
"promotions": [
[
"applicableItems": [
[
"lineItemId": "",
"offerId": "",
"productId": "",
"quantity": 0
]
],
"appliedItems": [[]],
"endTime": "",
"funder": "",
"merchantPromotionId": "",
"priceValue": [],
"shortTitle": "",
"startTime": "",
"subtype": "",
"taxValue": [],
"title": "",
"type": ""
]
],
"shippingCost": [],
"shippingOption": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/testorders")! 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()
POST
content.orders.createtestreturn
{{baseUrl}}/:merchantId/orders/:orderId/testreturn
QUERY PARAMS
merchantId
orderId
BODY json
{
"items": [
{
"lineItemId": "",
"quantity": 0
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/testreturn");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/testreturn" {:content-type :json
:form-params {:items [{:lineItemId ""
:quantity 0}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/testreturn"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\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}}/:merchantId/orders/:orderId/testreturn"),
Content = new StringContent("{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\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}}/:merchantId/orders/:orderId/testreturn");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/testreturn"
payload := strings.NewReader("{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/testreturn HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 76
{
"items": [
{
"lineItemId": "",
"quantity": 0
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/testreturn")
.setHeader("content-type", "application/json")
.setBody("{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/testreturn"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\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 \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/testreturn")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/testreturn")
.header("content-type", "application/json")
.body("{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}")
.asString();
const data = JSON.stringify({
items: [
{
lineItemId: '',
quantity: 0
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/testreturn');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/testreturn',
headers: {'content-type': 'application/json'},
data: {items: [{lineItemId: '', quantity: 0}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/testreturn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"items":[{"lineItemId":"","quantity":0}]}'
};
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}}/:merchantId/orders/:orderId/testreturn',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "items": [\n {\n "lineItemId": "",\n "quantity": 0\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/testreturn")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/testreturn',
headers: {
'content-type': 'application/json'
}
};
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({items: [{lineItemId: '', quantity: 0}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/testreturn',
headers: {'content-type': 'application/json'},
body: {items: [{lineItemId: '', quantity: 0}]},
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}}/:merchantId/orders/:orderId/testreturn');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
items: [
{
lineItemId: '',
quantity: 0
}
]
});
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}}/:merchantId/orders/:orderId/testreturn',
headers: {'content-type': 'application/json'},
data: {items: [{lineItemId: '', quantity: 0}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/testreturn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"items":[{"lineItemId":"","quantity":0}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"items": @[ @{ @"lineItemId": @"", @"quantity": @0 } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/testreturn"]
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}}/:merchantId/orders/:orderId/testreturn" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/testreturn",
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([
'items' => [
[
'lineItemId' => '',
'quantity' => 0
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/testreturn', [
'body' => '{
"items": [
{
"lineItemId": "",
"quantity": 0
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/testreturn');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'items' => [
[
'lineItemId' => '',
'quantity' => 0
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'items' => [
[
'lineItemId' => '',
'quantity' => 0
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/testreturn');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/testreturn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"items": [
{
"lineItemId": "",
"quantity": 0
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/testreturn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"items": [
{
"lineItemId": "",
"quantity": 0
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/testreturn", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/testreturn"
payload = { "items": [
{
"lineItemId": "",
"quantity": 0
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/testreturn"
payload <- "{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/testreturn")
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 \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\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.post('/baseUrl/:merchantId/orders/:orderId/testreturn') do |req|
req.body = "{\n \"items\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": 0\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/testreturn";
let payload = json!({"items": (
json!({
"lineItemId": "",
"quantity": 0
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/testreturn \
--header 'content-type: application/json' \
--data '{
"items": [
{
"lineItemId": "",
"quantity": 0
}
]
}'
echo '{
"items": [
{
"lineItemId": "",
"quantity": 0
}
]
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/testreturn \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "items": [\n {\n "lineItemId": "",\n "quantity": 0\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/testreturn
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["items": [
[
"lineItemId": "",
"quantity": 0
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/testreturn")! 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()
GET
content.orders.get
{{baseUrl}}/:merchantId/orders/:orderId
QUERY PARAMS
merchantId
orderId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/orders/:orderId")
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/orders/:orderId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/orders/:orderId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/orders/:orderId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/orders/:orderId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/orders/:orderId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/orders/:orderId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orders/:orderId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId';
const options = {method: 'GET'};
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}}/:merchantId/orders/:orderId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orders/:orderId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/orders/:orderId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orders/:orderId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/orders/:orderId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/orders/:orderId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/orders/:orderId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/orders/:orderId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/orders/:orderId
http GET {{baseUrl}}/:merchantId/orders/:orderId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.orders.getbymerchantorderid
{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId
QUERY PARAMS
merchantId
merchantOrderId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId")
require "http/client"
url = "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/ordersbymerchantid/:merchantOrderId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId';
const options = {method: 'GET'};
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}}/:merchantId/ordersbymerchantid/:merchantOrderId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/ordersbymerchantid/:merchantOrderId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/ordersbymerchantid/:merchantOrderId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/ordersbymerchantid/:merchantOrderId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/ordersbymerchantid/:merchantOrderId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId
http GET {{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/ordersbymerchantid/:merchantOrderId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.orders.gettestordertemplate
{{baseUrl}}/:merchantId/testordertemplates/:templateName
QUERY PARAMS
merchantId
templateName
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/testordertemplates/:templateName");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/testordertemplates/:templateName")
require "http/client"
url = "{{baseUrl}}/:merchantId/testordertemplates/:templateName"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/testordertemplates/:templateName"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/testordertemplates/:templateName");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/testordertemplates/:templateName"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/testordertemplates/:templateName HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/testordertemplates/:templateName")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/testordertemplates/:templateName"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/testordertemplates/:templateName")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/testordertemplates/:templateName")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/testordertemplates/:templateName');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/testordertemplates/:templateName'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/testordertemplates/:templateName';
const options = {method: 'GET'};
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}}/:merchantId/testordertemplates/:templateName',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/testordertemplates/:templateName")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/testordertemplates/:templateName',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/testordertemplates/:templateName'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/testordertemplates/:templateName');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/testordertemplates/:templateName'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/testordertemplates/:templateName';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/testordertemplates/:templateName"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/testordertemplates/:templateName" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/testordertemplates/:templateName",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/testordertemplates/:templateName');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/testordertemplates/:templateName');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/testordertemplates/:templateName');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/testordertemplates/:templateName' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/testordertemplates/:templateName' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/testordertemplates/:templateName")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/testordertemplates/:templateName"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/testordertemplates/:templateName"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/testordertemplates/:templateName")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/testordertemplates/:templateName') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/testordertemplates/:templateName";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/testordertemplates/:templateName
http GET {{baseUrl}}/:merchantId/testordertemplates/:templateName
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/testordertemplates/:templateName
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/testordertemplates/:templateName")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.orders.instorerefundlineitem
{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem
QUERY PARAMS
merchantId
orderId
BODY json
{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem" {:content-type :json
:form-params {:lineItemId ""
:operationId ""
:priceAmount {:currency ""
:value ""}
:productId ""
:quantity 0
:reason ""
:reasonText ""
:taxAmount {}}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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}}/:merchantId/orders/:orderId/inStoreRefundLineItem"),
Content = new StringContent("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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}}/:merchantId/orders/:orderId/inStoreRefundLineItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem"
payload := strings.NewReader("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/inStoreRefundLineItem HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 194
{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem")
.setHeader("content-type", "application/json")
.setBody("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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 \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem")
.header("content-type", "application/json")
.body("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}")
.asString();
const data = JSON.stringify({
lineItemId: '',
operationId: '',
priceAmount: {
currency: '',
value: ''
},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem',
headers: {'content-type': 'application/json'},
data: {
lineItemId: '',
operationId: '',
priceAmount: {currency: '', value: ''},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItemId":"","operationId":"","priceAmount":{"currency":"","value":""},"productId":"","quantity":0,"reason":"","reasonText":"","taxAmount":{}}'
};
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}}/:merchantId/orders/:orderId/inStoreRefundLineItem',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "lineItemId": "",\n "operationId": "",\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "productId": "",\n "quantity": 0,\n "reason": "",\n "reasonText": "",\n "taxAmount": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/inStoreRefundLineItem',
headers: {
'content-type': 'application/json'
}
};
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({
lineItemId: '',
operationId: '',
priceAmount: {currency: '', value: ''},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem',
headers: {'content-type': 'application/json'},
body: {
lineItemId: '',
operationId: '',
priceAmount: {currency: '', value: ''},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
},
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}}/:merchantId/orders/:orderId/inStoreRefundLineItem');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
lineItemId: '',
operationId: '',
priceAmount: {
currency: '',
value: ''
},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
});
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}}/:merchantId/orders/:orderId/inStoreRefundLineItem',
headers: {'content-type': 'application/json'},
data: {
lineItemId: '',
operationId: '',
priceAmount: {currency: '', value: ''},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItemId":"","operationId":"","priceAmount":{"currency":"","value":""},"productId":"","quantity":0,"reason":"","reasonText":"","taxAmount":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"lineItemId": @"",
@"operationId": @"",
@"priceAmount": @{ @"currency": @"", @"value": @"" },
@"productId": @"",
@"quantity": @0,
@"reason": @"",
@"reasonText": @"",
@"taxAmount": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem"]
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}}/:merchantId/orders/:orderId/inStoreRefundLineItem" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem",
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([
'lineItemId' => '',
'operationId' => '',
'priceAmount' => [
'currency' => '',
'value' => ''
],
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => '',
'taxAmount' => [
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem', [
'body' => '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'lineItemId' => '',
'operationId' => '',
'priceAmount' => [
'currency' => '',
'value' => ''
],
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => '',
'taxAmount' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'lineItemId' => '',
'operationId' => '',
'priceAmount' => [
'currency' => '',
'value' => ''
],
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => '',
'taxAmount' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/inStoreRefundLineItem", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem"
payload = {
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem"
payload <- "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem")
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 \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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.post('/baseUrl/:merchantId/orders/:orderId/inStoreRefundLineItem') do |req|
req.body = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem";
let payload = json!({
"lineItemId": "",
"operationId": "",
"priceAmount": json!({
"currency": "",
"value": ""
}),
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem \
--header 'content-type: application/json' \
--data '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}'
echo '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "lineItemId": "",\n "operationId": "",\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "productId": "",\n "quantity": 0,\n "reason": "",\n "reasonText": "",\n "taxAmount": {}\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"lineItemId": "",
"operationId": "",
"priceAmount": [
"currency": "",
"value": ""
],
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/inStoreRefundLineItem")! 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()
GET
content.orders.list
{{baseUrl}}/:merchantId/orders
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/orders")
require "http/client"
url = "{{baseUrl}}/:merchantId/orders"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/orders"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/orders");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/orders HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/orders")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/orders")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/orders');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orders'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders';
const options = {method: 'GET'};
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}}/:merchantId/orders',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orders'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/orders');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/orders'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/orders" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/orders');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/orders');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/orders")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/orders') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/orders
http GET {{baseUrl}}/:merchantId/orders
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/orders
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.orders.refunditem
{{baseUrl}}/:merchantId/orders/:orderId/refunditem
QUERY PARAMS
merchantId
orderId
BODY json
{
"items": [
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": {
"amount": {},
"fullRefund": false
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/refunditem");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/refunditem" {:content-type :json
:form-params {:items [{:amount {:priceAmount {:currency ""
:value ""}
:taxAmount {}}
:fullRefund false
:lineItemId ""
:productId ""
:quantity 0}]
:operationId ""
:reason ""
:reasonText ""
:shipping {:amount {}
:fullRefund false}}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/refunditem"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\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}}/:merchantId/orders/:orderId/refunditem"),
Content = new StringContent("{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\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}}/:merchantId/orders/:orderId/refunditem");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/refunditem"
payload := strings.NewReader("{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/refunditem HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 381
{
"items": [
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": {
"amount": {},
"fullRefund": false
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/refunditem")
.setHeader("content-type", "application/json")
.setBody("{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/refunditem"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\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 \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/refunditem")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/refunditem")
.header("content-type", "application/json")
.body("{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}")
.asString();
const data = JSON.stringify({
items: [
{
amount: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
fullRefund: false,
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
reason: '',
reasonText: '',
shipping: {
amount: {},
fullRefund: false
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/refunditem');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/refunditem',
headers: {'content-type': 'application/json'},
data: {
items: [
{
amount: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
fullRefund: false,
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
reason: '',
reasonText: '',
shipping: {amount: {}, fullRefund: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/refunditem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"items":[{"amount":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"fullRefund":false,"lineItemId":"","productId":"","quantity":0}],"operationId":"","reason":"","reasonText":"","shipping":{"amount":{},"fullRefund":false}}'
};
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}}/:merchantId/orders/:orderId/refunditem',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "items": [\n {\n "amount": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "fullRefund": false,\n "lineItemId": "",\n "productId": "",\n "quantity": 0\n }\n ],\n "operationId": "",\n "reason": "",\n "reasonText": "",\n "shipping": {\n "amount": {},\n "fullRefund": false\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/refunditem")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/refunditem',
headers: {
'content-type': 'application/json'
}
};
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({
items: [
{
amount: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
fullRefund: false,
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
reason: '',
reasonText: '',
shipping: {amount: {}, fullRefund: false}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/refunditem',
headers: {'content-type': 'application/json'},
body: {
items: [
{
amount: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
fullRefund: false,
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
reason: '',
reasonText: '',
shipping: {amount: {}, fullRefund: false}
},
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}}/:merchantId/orders/:orderId/refunditem');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
items: [
{
amount: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
fullRefund: false,
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
reason: '',
reasonText: '',
shipping: {
amount: {},
fullRefund: false
}
});
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}}/:merchantId/orders/:orderId/refunditem',
headers: {'content-type': 'application/json'},
data: {
items: [
{
amount: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
fullRefund: false,
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
reason: '',
reasonText: '',
shipping: {amount: {}, fullRefund: false}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/refunditem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"items":[{"amount":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"fullRefund":false,"lineItemId":"","productId":"","quantity":0}],"operationId":"","reason":"","reasonText":"","shipping":{"amount":{},"fullRefund":false}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"items": @[ @{ @"amount": @{ @"priceAmount": @{ @"currency": @"", @"value": @"" }, @"taxAmount": @{ } }, @"fullRefund": @NO, @"lineItemId": @"", @"productId": @"", @"quantity": @0 } ],
@"operationId": @"",
@"reason": @"",
@"reasonText": @"",
@"shipping": @{ @"amount": @{ }, @"fullRefund": @NO } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/refunditem"]
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}}/:merchantId/orders/:orderId/refunditem" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/refunditem",
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([
'items' => [
[
'amount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'fullRefund' => null,
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'reason' => '',
'reasonText' => '',
'shipping' => [
'amount' => [
],
'fullRefund' => null
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/refunditem', [
'body' => '{
"items": [
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": {
"amount": {},
"fullRefund": false
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/refunditem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'items' => [
[
'amount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'fullRefund' => null,
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'reason' => '',
'reasonText' => '',
'shipping' => [
'amount' => [
],
'fullRefund' => null
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'items' => [
[
'amount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'fullRefund' => null,
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'reason' => '',
'reasonText' => '',
'shipping' => [
'amount' => [
],
'fullRefund' => null
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/refunditem');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/refunditem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"items": [
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": {
"amount": {},
"fullRefund": false
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/refunditem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"items": [
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": {
"amount": {},
"fullRefund": false
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/refunditem", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/refunditem"
payload = {
"items": [
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": False,
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": {
"amount": {},
"fullRefund": False
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/refunditem"
payload <- "{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/refunditem")
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 \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\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.post('/baseUrl/:merchantId/orders/:orderId/refunditem') do |req|
req.body = "{\n \"items\": [\n {\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"shipping\": {\n \"amount\": {},\n \"fullRefund\": false\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/refunditem";
let payload = json!({
"items": (
json!({
"amount": json!({
"priceAmount": json!({
"currency": "",
"value": ""
}),
"taxAmount": json!({})
}),
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
})
),
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": json!({
"amount": json!({}),
"fullRefund": false
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/refunditem \
--header 'content-type: application/json' \
--data '{
"items": [
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": {
"amount": {},
"fullRefund": false
}
}'
echo '{
"items": [
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": {
"amount": {},
"fullRefund": false
}
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/refunditem \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "items": [\n {\n "amount": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "fullRefund": false,\n "lineItemId": "",\n "productId": "",\n "quantity": 0\n }\n ],\n "operationId": "",\n "reason": "",\n "reasonText": "",\n "shipping": {\n "amount": {},\n "fullRefund": false\n }\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/refunditem
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"items": [
[
"amount": [
"priceAmount": [
"currency": "",
"value": ""
],
"taxAmount": []
],
"fullRefund": false,
"lineItemId": "",
"productId": "",
"quantity": 0
]
],
"operationId": "",
"reason": "",
"reasonText": "",
"shipping": [
"amount": [],
"fullRefund": false
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/refunditem")! 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()
POST
content.orders.refundorder
{{baseUrl}}/:merchantId/orders/:orderId/refundorder
QUERY PARAMS
merchantId
orderId
BODY json
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/refundorder");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/refundorder" {:content-type :json
:form-params {:amount {:priceAmount {:currency ""
:value ""}
:taxAmount {}}
:fullRefund false
:operationId ""
:reason ""
:reasonText ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/refundorder"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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}}/:merchantId/orders/:orderId/refundorder"),
Content = new StringContent("{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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}}/:merchantId/orders/:orderId/refundorder");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/refundorder"
payload := strings.NewReader("{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/refundorder HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 189
{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/refundorder")
.setHeader("content-type", "application/json")
.setBody("{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/refundorder"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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 \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/refundorder")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/refundorder")
.header("content-type", "application/json")
.body("{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
.asString();
const data = JSON.stringify({
amount: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
fullRefund: false,
operationId: '',
reason: '',
reasonText: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/refundorder');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/refundorder',
headers: {'content-type': 'application/json'},
data: {
amount: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
fullRefund: false,
operationId: '',
reason: '',
reasonText: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/refundorder';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"amount":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"fullRefund":false,"operationId":"","reason":"","reasonText":""}'
};
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}}/:merchantId/orders/:orderId/refundorder',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "amount": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "fullRefund": false,\n "operationId": "",\n "reason": "",\n "reasonText": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/refundorder")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/refundorder',
headers: {
'content-type': 'application/json'
}
};
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({
amount: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
fullRefund: false,
operationId: '',
reason: '',
reasonText: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/refundorder',
headers: {'content-type': 'application/json'},
body: {
amount: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
fullRefund: false,
operationId: '',
reason: '',
reasonText: ''
},
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}}/:merchantId/orders/:orderId/refundorder');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
amount: {
priceAmount: {
currency: '',
value: ''
},
taxAmount: {}
},
fullRefund: false,
operationId: '',
reason: '',
reasonText: ''
});
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}}/:merchantId/orders/:orderId/refundorder',
headers: {'content-type': 'application/json'},
data: {
amount: {priceAmount: {currency: '', value: ''}, taxAmount: {}},
fullRefund: false,
operationId: '',
reason: '',
reasonText: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/refundorder';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"amount":{"priceAmount":{"currency":"","value":""},"taxAmount":{}},"fullRefund":false,"operationId":"","reason":"","reasonText":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"amount": @{ @"priceAmount": @{ @"currency": @"", @"value": @"" }, @"taxAmount": @{ } },
@"fullRefund": @NO,
@"operationId": @"",
@"reason": @"",
@"reasonText": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/refundorder"]
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}}/:merchantId/orders/:orderId/refundorder" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/refundorder",
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' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'fullRefund' => null,
'operationId' => '',
'reason' => '',
'reasonText' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/refundorder', [
'body' => '{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/refundorder');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'amount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'fullRefund' => null,
'operationId' => '',
'reason' => '',
'reasonText' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'amount' => [
'priceAmount' => [
'currency' => '',
'value' => ''
],
'taxAmount' => [
]
],
'fullRefund' => null,
'operationId' => '',
'reason' => '',
'reasonText' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/refundorder');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/refundorder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/refundorder' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/refundorder", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/refundorder"
payload = {
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": False,
"operationId": "",
"reason": "",
"reasonText": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/refundorder"
payload <- "{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/refundorder")
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\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/refundorder') do |req|
req.body = "{\n \"amount\": {\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"taxAmount\": {}\n },\n \"fullRefund\": false,\n \"operationId\": \"\",\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/refundorder";
let payload = json!({
"amount": json!({
"priceAmount": json!({
"currency": "",
"value": ""
}),
"taxAmount": json!({})
}),
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/refundorder \
--header 'content-type: application/json' \
--data '{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
}'
echo '{
"amount": {
"priceAmount": {
"currency": "",
"value": ""
},
"taxAmount": {}
},
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/refundorder \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "amount": {\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "taxAmount": {}\n },\n "fullRefund": false,\n "operationId": "",\n "reason": "",\n "reasonText": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/refundorder
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"amount": [
"priceAmount": [
"currency": "",
"value": ""
],
"taxAmount": []
],
"fullRefund": false,
"operationId": "",
"reason": "",
"reasonText": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/refundorder")! 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()
POST
content.orders.rejectreturnlineitem
{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem
QUERY PARAMS
merchantId
orderId
BODY json
{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem" {:content-type :json
:form-params {:lineItemId ""
:operationId ""
:productId ""
:quantity 0
:reason ""
:reasonText ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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}}/:merchantId/orders/:orderId/rejectReturnLineItem"),
Content = new StringContent("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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}}/:merchantId/orders/:orderId/rejectReturnLineItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem"
payload := strings.NewReader("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/rejectReturnLineItem HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 115
{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem")
.setHeader("content-type", "application/json")
.setBody("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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 \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem")
.header("content-type", "application/json")
.body("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
.asString();
const data = JSON.stringify({
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem',
headers: {'content-type': 'application/json'},
data: {
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItemId":"","operationId":"","productId":"","quantity":0,"reason":"","reasonText":""}'
};
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}}/:merchantId/orders/:orderId/rejectReturnLineItem',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "lineItemId": "",\n "operationId": "",\n "productId": "",\n "quantity": 0,\n "reason": "",\n "reasonText": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/rejectReturnLineItem',
headers: {
'content-type': 'application/json'
}
};
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({
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem',
headers: {'content-type': 'application/json'},
body: {
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
},
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}}/:merchantId/orders/:orderId/rejectReturnLineItem');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
});
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}}/:merchantId/orders/:orderId/rejectReturnLineItem',
headers: {'content-type': 'application/json'},
data: {
lineItemId: '',
operationId: '',
productId: '',
quantity: 0,
reason: '',
reasonText: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItemId":"","operationId":"","productId":"","quantity":0,"reason":"","reasonText":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"lineItemId": @"",
@"operationId": @"",
@"productId": @"",
@"quantity": @0,
@"reason": @"",
@"reasonText": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem"]
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}}/:merchantId/orders/:orderId/rejectReturnLineItem" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem",
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([
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem', [
'body' => '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/rejectReturnLineItem", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem"
payload = {
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem"
payload <- "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem")
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 \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/rejectReturnLineItem') do |req|
req.body = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem";
let payload = json!({
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem \
--header 'content-type: application/json' \
--data '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}'
echo '{
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "lineItemId": "",\n "operationId": "",\n "productId": "",\n "quantity": 0,\n "reason": "",\n "reasonText": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"lineItemId": "",
"operationId": "",
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/rejectReturnLineItem")! 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()
POST
content.orders.returnrefundlineitem
{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem
QUERY PARAMS
merchantId
orderId
BODY json
{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem" {:content-type :json
:form-params {:lineItemId ""
:operationId ""
:priceAmount {:currency ""
:value ""}
:productId ""
:quantity 0
:reason ""
:reasonText ""
:taxAmount {}}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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}}/:merchantId/orders/:orderId/returnRefundLineItem"),
Content = new StringContent("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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}}/:merchantId/orders/:orderId/returnRefundLineItem");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem"
payload := strings.NewReader("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/returnRefundLineItem HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 194
{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem")
.setHeader("content-type", "application/json")
.setBody("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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 \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem")
.header("content-type", "application/json")
.body("{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}")
.asString();
const data = JSON.stringify({
lineItemId: '',
operationId: '',
priceAmount: {
currency: '',
value: ''
},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem',
headers: {'content-type': 'application/json'},
data: {
lineItemId: '',
operationId: '',
priceAmount: {currency: '', value: ''},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItemId":"","operationId":"","priceAmount":{"currency":"","value":""},"productId":"","quantity":0,"reason":"","reasonText":"","taxAmount":{}}'
};
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}}/:merchantId/orders/:orderId/returnRefundLineItem',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "lineItemId": "",\n "operationId": "",\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "productId": "",\n "quantity": 0,\n "reason": "",\n "reasonText": "",\n "taxAmount": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/returnRefundLineItem',
headers: {
'content-type': 'application/json'
}
};
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({
lineItemId: '',
operationId: '',
priceAmount: {currency: '', value: ''},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem',
headers: {'content-type': 'application/json'},
body: {
lineItemId: '',
operationId: '',
priceAmount: {currency: '', value: ''},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
},
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}}/:merchantId/orders/:orderId/returnRefundLineItem');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
lineItemId: '',
operationId: '',
priceAmount: {
currency: '',
value: ''
},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
});
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}}/:merchantId/orders/:orderId/returnRefundLineItem',
headers: {'content-type': 'application/json'},
data: {
lineItemId: '',
operationId: '',
priceAmount: {currency: '', value: ''},
productId: '',
quantity: 0,
reason: '',
reasonText: '',
taxAmount: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItemId":"","operationId":"","priceAmount":{"currency":"","value":""},"productId":"","quantity":0,"reason":"","reasonText":"","taxAmount":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"lineItemId": @"",
@"operationId": @"",
@"priceAmount": @{ @"currency": @"", @"value": @"" },
@"productId": @"",
@"quantity": @0,
@"reason": @"",
@"reasonText": @"",
@"taxAmount": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem"]
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}}/:merchantId/orders/:orderId/returnRefundLineItem" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem",
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([
'lineItemId' => '',
'operationId' => '',
'priceAmount' => [
'currency' => '',
'value' => ''
],
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => '',
'taxAmount' => [
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem', [
'body' => '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'lineItemId' => '',
'operationId' => '',
'priceAmount' => [
'currency' => '',
'value' => ''
],
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => '',
'taxAmount' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'lineItemId' => '',
'operationId' => '',
'priceAmount' => [
'currency' => '',
'value' => ''
],
'productId' => '',
'quantity' => 0,
'reason' => '',
'reasonText' => '',
'taxAmount' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/returnRefundLineItem", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem"
payload = {
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem"
payload <- "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem")
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 \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\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.post('/baseUrl/:merchantId/orders/:orderId/returnRefundLineItem') do |req|
req.body = "{\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"priceAmount\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"productId\": \"\",\n \"quantity\": 0,\n \"reason\": \"\",\n \"reasonText\": \"\",\n \"taxAmount\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem";
let payload = json!({
"lineItemId": "",
"operationId": "",
"priceAmount": json!({
"currency": "",
"value": ""
}),
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem \
--header 'content-type: application/json' \
--data '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}'
echo '{
"lineItemId": "",
"operationId": "",
"priceAmount": {
"currency": "",
"value": ""
},
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": {}
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "lineItemId": "",\n "operationId": "",\n "priceAmount": {\n "currency": "",\n "value": ""\n },\n "productId": "",\n "quantity": 0,\n "reason": "",\n "reasonText": "",\n "taxAmount": {}\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"lineItemId": "",
"operationId": "",
"priceAmount": [
"currency": "",
"value": ""
],
"productId": "",
"quantity": 0,
"reason": "",
"reasonText": "",
"taxAmount": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/returnRefundLineItem")! 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()
POST
content.orders.setlineitemmetadata
{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata
QUERY PARAMS
merchantId
orderId
BODY json
{
"annotations": [
{
"key": "",
"value": ""
}
],
"lineItemId": "",
"operationId": "",
"productId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata" {:content-type :json
:form-params {:annotations [{:key ""
:value ""}]
:lineItemId ""
:operationId ""
:productId ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\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}}/:merchantId/orders/:orderId/setLineItemMetadata"),
Content = new StringContent("{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\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}}/:merchantId/orders/:orderId/setLineItemMetadata");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata"
payload := strings.NewReader("{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/setLineItemMetadata HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 133
{
"annotations": [
{
"key": "",
"value": ""
}
],
"lineItemId": "",
"operationId": "",
"productId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata")
.setHeader("content-type", "application/json")
.setBody("{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\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 \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata")
.header("content-type", "application/json")
.body("{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}")
.asString();
const data = JSON.stringify({
annotations: [
{
key: '',
value: ''
}
],
lineItemId: '',
operationId: '',
productId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata',
headers: {'content-type': 'application/json'},
data: {
annotations: [{key: '', value: ''}],
lineItemId: '',
operationId: '',
productId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"annotations":[{"key":"","value":""}],"lineItemId":"","operationId":"","productId":""}'
};
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}}/:merchantId/orders/:orderId/setLineItemMetadata',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "annotations": [\n {\n "key": "",\n "value": ""\n }\n ],\n "lineItemId": "",\n "operationId": "",\n "productId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/setLineItemMetadata',
headers: {
'content-type': 'application/json'
}
};
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({
annotations: [{key: '', value: ''}],
lineItemId: '',
operationId: '',
productId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata',
headers: {'content-type': 'application/json'},
body: {
annotations: [{key: '', value: ''}],
lineItemId: '',
operationId: '',
productId: ''
},
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}}/:merchantId/orders/:orderId/setLineItemMetadata');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
annotations: [
{
key: '',
value: ''
}
],
lineItemId: '',
operationId: '',
productId: ''
});
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}}/:merchantId/orders/:orderId/setLineItemMetadata',
headers: {'content-type': 'application/json'},
data: {
annotations: [{key: '', value: ''}],
lineItemId: '',
operationId: '',
productId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"annotations":[{"key":"","value":""}],"lineItemId":"","operationId":"","productId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"annotations": @[ @{ @"key": @"", @"value": @"" } ],
@"lineItemId": @"",
@"operationId": @"",
@"productId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata"]
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}}/:merchantId/orders/:orderId/setLineItemMetadata" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata",
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([
'annotations' => [
[
'key' => '',
'value' => ''
]
],
'lineItemId' => '',
'operationId' => '',
'productId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata', [
'body' => '{
"annotations": [
{
"key": "",
"value": ""
}
],
"lineItemId": "",
"operationId": "",
"productId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'annotations' => [
[
'key' => '',
'value' => ''
]
],
'lineItemId' => '',
'operationId' => '',
'productId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'annotations' => [
[
'key' => '',
'value' => ''
]
],
'lineItemId' => '',
'operationId' => '',
'productId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"annotations": [
{
"key": "",
"value": ""
}
],
"lineItemId": "",
"operationId": "",
"productId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"annotations": [
{
"key": "",
"value": ""
}
],
"lineItemId": "",
"operationId": "",
"productId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/setLineItemMetadata", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata"
payload = {
"annotations": [
{
"key": "",
"value": ""
}
],
"lineItemId": "",
"operationId": "",
"productId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata"
payload <- "{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata")
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 \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/setLineItemMetadata') do |req|
req.body = "{\n \"annotations\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata";
let payload = json!({
"annotations": (
json!({
"key": "",
"value": ""
})
),
"lineItemId": "",
"operationId": "",
"productId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata \
--header 'content-type: application/json' \
--data '{
"annotations": [
{
"key": "",
"value": ""
}
],
"lineItemId": "",
"operationId": "",
"productId": ""
}'
echo '{
"annotations": [
{
"key": "",
"value": ""
}
],
"lineItemId": "",
"operationId": "",
"productId": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "annotations": [\n {\n "key": "",\n "value": ""\n }\n ],\n "lineItemId": "",\n "operationId": "",\n "productId": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"annotations": [
[
"key": "",
"value": ""
]
],
"lineItemId": "",
"operationId": "",
"productId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/setLineItemMetadata")! 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()
POST
content.orders.shiplineitems
{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems
QUERY PARAMS
merchantId
orderId
BODY json
{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
{
"carrier": "",
"shipmentId": "",
"trackingId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems" {:content-type :json
:form-params {:lineItems [{:lineItemId ""
:productId ""
:quantity 0}]
:operationId ""
:shipmentGroupId ""
:shipmentInfos [{:carrier ""
:shipmentId ""
:trackingId ""}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\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}}/:merchantId/orders/:orderId/shipLineItems"),
Content = new StringContent("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\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}}/:merchantId/orders/:orderId/shipLineItems");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems"
payload := strings.NewReader("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/shipLineItems HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 255
{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
{
"carrier": "",
"shipmentId": "",
"trackingId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems")
.setHeader("content-type", "application/json")
.setBody("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\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 \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems")
.header("content-type", "application/json")
.body("{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
lineItems: [
{
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
shipmentGroupId: '',
shipmentInfos: [
{
carrier: '',
shipmentId: '',
trackingId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems',
headers: {'content-type': 'application/json'},
data: {
lineItems: [{lineItemId: '', productId: '', quantity: 0}],
operationId: '',
shipmentGroupId: '',
shipmentInfos: [{carrier: '', shipmentId: '', trackingId: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItems":[{"lineItemId":"","productId":"","quantity":0}],"operationId":"","shipmentGroupId":"","shipmentInfos":[{"carrier":"","shipmentId":"","trackingId":""}]}'
};
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}}/:merchantId/orders/:orderId/shipLineItems',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "lineItems": [\n {\n "lineItemId": "",\n "productId": "",\n "quantity": 0\n }\n ],\n "operationId": "",\n "shipmentGroupId": "",\n "shipmentInfos": [\n {\n "carrier": "",\n "shipmentId": "",\n "trackingId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/shipLineItems',
headers: {
'content-type': 'application/json'
}
};
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({
lineItems: [{lineItemId: '', productId: '', quantity: 0}],
operationId: '',
shipmentGroupId: '',
shipmentInfos: [{carrier: '', shipmentId: '', trackingId: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems',
headers: {'content-type': 'application/json'},
body: {
lineItems: [{lineItemId: '', productId: '', quantity: 0}],
operationId: '',
shipmentGroupId: '',
shipmentInfos: [{carrier: '', shipmentId: '', trackingId: ''}]
},
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}}/:merchantId/orders/:orderId/shipLineItems');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
lineItems: [
{
lineItemId: '',
productId: '',
quantity: 0
}
],
operationId: '',
shipmentGroupId: '',
shipmentInfos: [
{
carrier: '',
shipmentId: '',
trackingId: ''
}
]
});
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}}/:merchantId/orders/:orderId/shipLineItems',
headers: {'content-type': 'application/json'},
data: {
lineItems: [{lineItemId: '', productId: '', quantity: 0}],
operationId: '',
shipmentGroupId: '',
shipmentInfos: [{carrier: '', shipmentId: '', trackingId: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"lineItems":[{"lineItemId":"","productId":"","quantity":0}],"operationId":"","shipmentGroupId":"","shipmentInfos":[{"carrier":"","shipmentId":"","trackingId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"lineItems": @[ @{ @"lineItemId": @"", @"productId": @"", @"quantity": @0 } ],
@"operationId": @"",
@"shipmentGroupId": @"",
@"shipmentInfos": @[ @{ @"carrier": @"", @"shipmentId": @"", @"trackingId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems"]
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}}/:merchantId/orders/:orderId/shipLineItems" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems",
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([
'lineItems' => [
[
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'shipmentGroupId' => '',
'shipmentInfos' => [
[
'carrier' => '',
'shipmentId' => '',
'trackingId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems', [
'body' => '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
{
"carrier": "",
"shipmentId": "",
"trackingId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'lineItems' => [
[
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'shipmentGroupId' => '',
'shipmentInfos' => [
[
'carrier' => '',
'shipmentId' => '',
'trackingId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'lineItems' => [
[
'lineItemId' => '',
'productId' => '',
'quantity' => 0
]
],
'operationId' => '',
'shipmentGroupId' => '',
'shipmentInfos' => [
[
'carrier' => '',
'shipmentId' => '',
'trackingId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
{
"carrier": "",
"shipmentId": "",
"trackingId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
{
"carrier": "",
"shipmentId": "",
"trackingId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/shipLineItems", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems"
payload = {
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
{
"carrier": "",
"shipmentId": "",
"trackingId": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems"
payload <- "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems")
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 \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\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.post('/baseUrl/:merchantId/orders/:orderId/shipLineItems') do |req|
req.body = "{\n \"lineItems\": [\n {\n \"lineItemId\": \"\",\n \"productId\": \"\",\n \"quantity\": 0\n }\n ],\n \"operationId\": \"\",\n \"shipmentGroupId\": \"\",\n \"shipmentInfos\": [\n {\n \"carrier\": \"\",\n \"shipmentId\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems";
let payload = json!({
"lineItems": (
json!({
"lineItemId": "",
"productId": "",
"quantity": 0
})
),
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": (
json!({
"carrier": "",
"shipmentId": "",
"trackingId": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/shipLineItems \
--header 'content-type: application/json' \
--data '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
{
"carrier": "",
"shipmentId": "",
"trackingId": ""
}
]
}'
echo '{
"lineItems": [
{
"lineItemId": "",
"productId": "",
"quantity": 0
}
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
{
"carrier": "",
"shipmentId": "",
"trackingId": ""
}
]
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/shipLineItems \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "lineItems": [\n {\n "lineItemId": "",\n "productId": "",\n "quantity": 0\n }\n ],\n "operationId": "",\n "shipmentGroupId": "",\n "shipmentInfos": [\n {\n "carrier": "",\n "shipmentId": "",\n "trackingId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/shipLineItems
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"lineItems": [
[
"lineItemId": "",
"productId": "",
"quantity": 0
]
],
"operationId": "",
"shipmentGroupId": "",
"shipmentInfos": [
[
"carrier": "",
"shipmentId": "",
"trackingId": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/shipLineItems")! 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()
POST
content.orders.updatelineitemshippingdetails
{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails
QUERY PARAMS
merchantId
orderId
BODY json
{
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails" {:content-type :json
:form-params {:deliverByDate ""
:lineItemId ""
:operationId ""
:productId ""
:shipByDate ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\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}}/:merchantId/orders/:orderId/updateLineItemShippingDetails"),
Content = new StringContent("{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\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}}/:merchantId/orders/:orderId/updateLineItemShippingDetails");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails"
payload := strings.NewReader("{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/updateLineItemShippingDetails HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 105
{
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails")
.setHeader("content-type", "application/json")
.setBody("{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\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 \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails")
.header("content-type", "application/json")
.body("{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}")
.asString();
const data = JSON.stringify({
deliverByDate: '',
lineItemId: '',
operationId: '',
productId: '',
shipByDate: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails',
headers: {'content-type': 'application/json'},
data: {
deliverByDate: '',
lineItemId: '',
operationId: '',
productId: '',
shipByDate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"deliverByDate":"","lineItemId":"","operationId":"","productId":"","shipByDate":""}'
};
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}}/:merchantId/orders/:orderId/updateLineItemShippingDetails',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "deliverByDate": "",\n "lineItemId": "",\n "operationId": "",\n "productId": "",\n "shipByDate": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/updateLineItemShippingDetails',
headers: {
'content-type': 'application/json'
}
};
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({
deliverByDate: '',
lineItemId: '',
operationId: '',
productId: '',
shipByDate: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails',
headers: {'content-type': 'application/json'},
body: {
deliverByDate: '',
lineItemId: '',
operationId: '',
productId: '',
shipByDate: ''
},
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}}/:merchantId/orders/:orderId/updateLineItemShippingDetails');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
deliverByDate: '',
lineItemId: '',
operationId: '',
productId: '',
shipByDate: ''
});
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}}/:merchantId/orders/:orderId/updateLineItemShippingDetails',
headers: {'content-type': 'application/json'},
data: {
deliverByDate: '',
lineItemId: '',
operationId: '',
productId: '',
shipByDate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"deliverByDate":"","lineItemId":"","operationId":"","productId":"","shipByDate":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"deliverByDate": @"",
@"lineItemId": @"",
@"operationId": @"",
@"productId": @"",
@"shipByDate": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails"]
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}}/:merchantId/orders/:orderId/updateLineItemShippingDetails" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails",
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([
'deliverByDate' => '',
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'shipByDate' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails', [
'body' => '{
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'deliverByDate' => '',
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'shipByDate' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'deliverByDate' => '',
'lineItemId' => '',
'operationId' => '',
'productId' => '',
'shipByDate' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/updateLineItemShippingDetails", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails"
payload = {
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails"
payload <- "{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails")
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 \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/updateLineItemShippingDetails') do |req|
req.body = "{\n \"deliverByDate\": \"\",\n \"lineItemId\": \"\",\n \"operationId\": \"\",\n \"productId\": \"\",\n \"shipByDate\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails";
let payload = json!({
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails \
--header 'content-type: application/json' \
--data '{
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
}'
echo '{
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "deliverByDate": "",\n "lineItemId": "",\n "operationId": "",\n "productId": "",\n "shipByDate": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"deliverByDate": "",
"lineItemId": "",
"operationId": "",
"productId": "",
"shipByDate": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/updateLineItemShippingDetails")! 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()
POST
content.orders.updatemerchantorderid
{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId
QUERY PARAMS
merchantId
orderId
BODY json
{
"merchantOrderId": "",
"operationId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId" {:content-type :json
:form-params {:merchantOrderId ""
:operationId ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\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}}/:merchantId/orders/:orderId/updateMerchantOrderId"),
Content = new StringContent("{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\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}}/:merchantId/orders/:orderId/updateMerchantOrderId");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId"
payload := strings.NewReader("{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/updateMerchantOrderId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 48
{
"merchantOrderId": "",
"operationId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId")
.setHeader("content-type", "application/json")
.setBody("{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\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 \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId")
.header("content-type", "application/json")
.body("{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}")
.asString();
const data = JSON.stringify({
merchantOrderId: '',
operationId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId',
headers: {'content-type': 'application/json'},
data: {merchantOrderId: '', operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"merchantOrderId":"","operationId":""}'
};
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}}/:merchantId/orders/:orderId/updateMerchantOrderId',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "merchantOrderId": "",\n "operationId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/updateMerchantOrderId',
headers: {
'content-type': 'application/json'
}
};
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({merchantOrderId: '', operationId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId',
headers: {'content-type': 'application/json'},
body: {merchantOrderId: '', operationId: ''},
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}}/:merchantId/orders/:orderId/updateMerchantOrderId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
merchantOrderId: '',
operationId: ''
});
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}}/:merchantId/orders/:orderId/updateMerchantOrderId',
headers: {'content-type': 'application/json'},
data: {merchantOrderId: '', operationId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"merchantOrderId":"","operationId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"merchantOrderId": @"",
@"operationId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId"]
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}}/:merchantId/orders/:orderId/updateMerchantOrderId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId",
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([
'merchantOrderId' => '',
'operationId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId', [
'body' => '{
"merchantOrderId": "",
"operationId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'merchantOrderId' => '',
'operationId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'merchantOrderId' => '',
'operationId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"merchantOrderId": "",
"operationId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"merchantOrderId": "",
"operationId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/updateMerchantOrderId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId"
payload = {
"merchantOrderId": "",
"operationId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId"
payload <- "{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId")
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 \"merchantOrderId\": \"\",\n \"operationId\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/updateMerchantOrderId') do |req|
req.body = "{\n \"merchantOrderId\": \"\",\n \"operationId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId";
let payload = json!({
"merchantOrderId": "",
"operationId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId \
--header 'content-type: application/json' \
--data '{
"merchantOrderId": "",
"operationId": ""
}'
echo '{
"merchantOrderId": "",
"operationId": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "merchantOrderId": "",\n "operationId": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"merchantOrderId": "",
"operationId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/updateMerchantOrderId")! 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()
POST
content.orders.updateshipment
{{baseUrl}}/:merchantId/orders/:orderId/updateShipment
QUERY PARAMS
merchantId
orderId
BODY json
{
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": {
"carrierPhoneNumber": "",
"scheduledDate": ""
},
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment" {:content-type :json
:form-params {:carrier ""
:deliveryDate ""
:lastPickupDate ""
:operationId ""
:readyPickupDate ""
:scheduledDeliveryDetails {:carrierPhoneNumber ""
:scheduledDate ""}
:shipmentId ""
:status ""
:trackingId ""
:undeliveredDate ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\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}}/:merchantId/orders/:orderId/updateShipment"),
Content = new StringContent("{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\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}}/:merchantId/orders/:orderId/updateShipment");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment"
payload := strings.NewReader("{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/orders/:orderId/updateShipment HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 283
{
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": {
"carrierPhoneNumber": "",
"scheduledDate": ""
},
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment")
.setHeader("content-type", "application/json")
.setBody("{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/orders/:orderId/updateShipment"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\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 \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/updateShipment")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/orders/:orderId/updateShipment")
.header("content-type", "application/json")
.body("{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}")
.asString();
const data = JSON.stringify({
carrier: '',
deliveryDate: '',
lastPickupDate: '',
operationId: '',
readyPickupDate: '',
scheduledDeliveryDetails: {
carrierPhoneNumber: '',
scheduledDate: ''
},
shipmentId: '',
status: '',
trackingId: '',
undeliveredDate: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/orders/:orderId/updateShipment');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/updateShipment',
headers: {'content-type': 'application/json'},
data: {
carrier: '',
deliveryDate: '',
lastPickupDate: '',
operationId: '',
readyPickupDate: '',
scheduledDeliveryDetails: {carrierPhoneNumber: '', scheduledDate: ''},
shipmentId: '',
status: '',
trackingId: '',
undeliveredDate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/orders/:orderId/updateShipment';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"carrier":"","deliveryDate":"","lastPickupDate":"","operationId":"","readyPickupDate":"","scheduledDeliveryDetails":{"carrierPhoneNumber":"","scheduledDate":""},"shipmentId":"","status":"","trackingId":"","undeliveredDate":""}'
};
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}}/:merchantId/orders/:orderId/updateShipment',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "carrier": "",\n "deliveryDate": "",\n "lastPickupDate": "",\n "operationId": "",\n "readyPickupDate": "",\n "scheduledDeliveryDetails": {\n "carrierPhoneNumber": "",\n "scheduledDate": ""\n },\n "shipmentId": "",\n "status": "",\n "trackingId": "",\n "undeliveredDate": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/orders/:orderId/updateShipment")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/orders/:orderId/updateShipment',
headers: {
'content-type': 'application/json'
}
};
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({
carrier: '',
deliveryDate: '',
lastPickupDate: '',
operationId: '',
readyPickupDate: '',
scheduledDeliveryDetails: {carrierPhoneNumber: '', scheduledDate: ''},
shipmentId: '',
status: '',
trackingId: '',
undeliveredDate: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/orders/:orderId/updateShipment',
headers: {'content-type': 'application/json'},
body: {
carrier: '',
deliveryDate: '',
lastPickupDate: '',
operationId: '',
readyPickupDate: '',
scheduledDeliveryDetails: {carrierPhoneNumber: '', scheduledDate: ''},
shipmentId: '',
status: '',
trackingId: '',
undeliveredDate: ''
},
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}}/:merchantId/orders/:orderId/updateShipment');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
carrier: '',
deliveryDate: '',
lastPickupDate: '',
operationId: '',
readyPickupDate: '',
scheduledDeliveryDetails: {
carrierPhoneNumber: '',
scheduledDate: ''
},
shipmentId: '',
status: '',
trackingId: '',
undeliveredDate: ''
});
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}}/:merchantId/orders/:orderId/updateShipment',
headers: {'content-type': 'application/json'},
data: {
carrier: '',
deliveryDate: '',
lastPickupDate: '',
operationId: '',
readyPickupDate: '',
scheduledDeliveryDetails: {carrierPhoneNumber: '', scheduledDate: ''},
shipmentId: '',
status: '',
trackingId: '',
undeliveredDate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/orders/:orderId/updateShipment';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"carrier":"","deliveryDate":"","lastPickupDate":"","operationId":"","readyPickupDate":"","scheduledDeliveryDetails":{"carrierPhoneNumber":"","scheduledDate":""},"shipmentId":"","status":"","trackingId":"","undeliveredDate":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"carrier": @"",
@"deliveryDate": @"",
@"lastPickupDate": @"",
@"operationId": @"",
@"readyPickupDate": @"",
@"scheduledDeliveryDetails": @{ @"carrierPhoneNumber": @"", @"scheduledDate": @"" },
@"shipmentId": @"",
@"status": @"",
@"trackingId": @"",
@"undeliveredDate": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/orders/:orderId/updateShipment"]
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}}/:merchantId/orders/:orderId/updateShipment" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/orders/:orderId/updateShipment",
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([
'carrier' => '',
'deliveryDate' => '',
'lastPickupDate' => '',
'operationId' => '',
'readyPickupDate' => '',
'scheduledDeliveryDetails' => [
'carrierPhoneNumber' => '',
'scheduledDate' => ''
],
'shipmentId' => '',
'status' => '',
'trackingId' => '',
'undeliveredDate' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/orders/:orderId/updateShipment', [
'body' => '{
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": {
"carrierPhoneNumber": "",
"scheduledDate": ""
},
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/orders/:orderId/updateShipment');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'carrier' => '',
'deliveryDate' => '',
'lastPickupDate' => '',
'operationId' => '',
'readyPickupDate' => '',
'scheduledDeliveryDetails' => [
'carrierPhoneNumber' => '',
'scheduledDate' => ''
],
'shipmentId' => '',
'status' => '',
'trackingId' => '',
'undeliveredDate' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'carrier' => '',
'deliveryDate' => '',
'lastPickupDate' => '',
'operationId' => '',
'readyPickupDate' => '',
'scheduledDeliveryDetails' => [
'carrierPhoneNumber' => '',
'scheduledDate' => ''
],
'shipmentId' => '',
'status' => '',
'trackingId' => '',
'undeliveredDate' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/orders/:orderId/updateShipment');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/orders/:orderId/updateShipment' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": {
"carrierPhoneNumber": "",
"scheduledDate": ""
},
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/orders/:orderId/updateShipment' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": {
"carrierPhoneNumber": "",
"scheduledDate": ""
},
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/orders/:orderId/updateShipment", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment"
payload = {
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": {
"carrierPhoneNumber": "",
"scheduledDate": ""
},
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment"
payload <- "{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/orders/:orderId/updateShipment")
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 \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\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.post('/baseUrl/:merchantId/orders/:orderId/updateShipment') do |req|
req.body = "{\n \"carrier\": \"\",\n \"deliveryDate\": \"\",\n \"lastPickupDate\": \"\",\n \"operationId\": \"\",\n \"readyPickupDate\": \"\",\n \"scheduledDeliveryDetails\": {\n \"carrierPhoneNumber\": \"\",\n \"scheduledDate\": \"\"\n },\n \"shipmentId\": \"\",\n \"status\": \"\",\n \"trackingId\": \"\",\n \"undeliveredDate\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment";
let payload = json!({
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": json!({
"carrierPhoneNumber": "",
"scheduledDate": ""
}),
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/orders/:orderId/updateShipment \
--header 'content-type: application/json' \
--data '{
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": {
"carrierPhoneNumber": "",
"scheduledDate": ""
},
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
}'
echo '{
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": {
"carrierPhoneNumber": "",
"scheduledDate": ""
},
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
}' | \
http POST {{baseUrl}}/:merchantId/orders/:orderId/updateShipment \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "carrier": "",\n "deliveryDate": "",\n "lastPickupDate": "",\n "operationId": "",\n "readyPickupDate": "",\n "scheduledDeliveryDetails": {\n "carrierPhoneNumber": "",\n "scheduledDate": ""\n },\n "shipmentId": "",\n "status": "",\n "trackingId": "",\n "undeliveredDate": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/orders/:orderId/updateShipment
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"carrier": "",
"deliveryDate": "",
"lastPickupDate": "",
"operationId": "",
"readyPickupDate": "",
"scheduledDeliveryDetails": [
"carrierPhoneNumber": "",
"scheduledDate": ""
],
"shipmentId": "",
"status": "",
"trackingId": "",
"undeliveredDate": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/orders/:orderId/updateShipment")! 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()
POST
content.ordertrackingsignals.create
{{baseUrl}}/:merchantId/ordertrackingsignals
QUERY PARAMS
merchantId
BODY json
{
"customerShippingFee": {
"currency": "",
"value": ""
},
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
{
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
}
],
"merchantId": "",
"orderCreatedTime": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
{
"lineItemId": "",
"quantity": "",
"shipmentId": ""
}
],
"shippingInfo": [
{
"actualDeliveryTime": {},
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": {},
"latestDeliveryPromiseTime": {},
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": {},
"shippingStatus": "",
"trackingId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/ordertrackingsignals");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/ordertrackingsignals" {:content-type :json
:form-params {:customerShippingFee {:currency ""
:value ""}
:deliveryPostalCode ""
:deliveryRegionCode ""
:lineItems [{:brand ""
:gtin ""
:lineItemId ""
:mpn ""
:productDescription ""
:productId ""
:productTitle ""
:quantity ""
:sku ""
:upc ""}]
:merchantId ""
:orderCreatedTime {:day 0
:hours 0
:minutes 0
:month 0
:nanos 0
:seconds 0
:timeZone {:id ""
:version ""}
:utcOffset ""
:year 0}
:orderId ""
:orderTrackingSignalId ""
:shipmentLineItemMapping [{:lineItemId ""
:quantity ""
:shipmentId ""}]
:shippingInfo [{:actualDeliveryTime {}
:carrierName ""
:carrierServiceName ""
:earliestDeliveryPromiseTime {}
:latestDeliveryPromiseTime {}
:originPostalCode ""
:originRegionCode ""
:shipmentId ""
:shippedTime {}
:shippingStatus ""
:trackingId ""}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/ordertrackingsignals"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\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}}/:merchantId/ordertrackingsignals"),
Content = new StringContent("{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\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}}/:merchantId/ordertrackingsignals");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/ordertrackingsignals"
payload := strings.NewReader("{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/ordertrackingsignals HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1148
{
"customerShippingFee": {
"currency": "",
"value": ""
},
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
{
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
}
],
"merchantId": "",
"orderCreatedTime": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
{
"lineItemId": "",
"quantity": "",
"shipmentId": ""
}
],
"shippingInfo": [
{
"actualDeliveryTime": {},
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": {},
"latestDeliveryPromiseTime": {},
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": {},
"shippingStatus": "",
"trackingId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/ordertrackingsignals")
.setHeader("content-type", "application/json")
.setBody("{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/ordertrackingsignals"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\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 \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/ordertrackingsignals")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/ordertrackingsignals")
.header("content-type", "application/json")
.body("{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
customerShippingFee: {
currency: '',
value: ''
},
deliveryPostalCode: '',
deliveryRegionCode: '',
lineItems: [
{
brand: '',
gtin: '',
lineItemId: '',
mpn: '',
productDescription: '',
productId: '',
productTitle: '',
quantity: '',
sku: '',
upc: ''
}
],
merchantId: '',
orderCreatedTime: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {
id: '',
version: ''
},
utcOffset: '',
year: 0
},
orderId: '',
orderTrackingSignalId: '',
shipmentLineItemMapping: [
{
lineItemId: '',
quantity: '',
shipmentId: ''
}
],
shippingInfo: [
{
actualDeliveryTime: {},
carrierName: '',
carrierServiceName: '',
earliestDeliveryPromiseTime: {},
latestDeliveryPromiseTime: {},
originPostalCode: '',
originRegionCode: '',
shipmentId: '',
shippedTime: {},
shippingStatus: '',
trackingId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/ordertrackingsignals');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/ordertrackingsignals',
headers: {'content-type': 'application/json'},
data: {
customerShippingFee: {currency: '', value: ''},
deliveryPostalCode: '',
deliveryRegionCode: '',
lineItems: [
{
brand: '',
gtin: '',
lineItemId: '',
mpn: '',
productDescription: '',
productId: '',
productTitle: '',
quantity: '',
sku: '',
upc: ''
}
],
merchantId: '',
orderCreatedTime: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
orderId: '',
orderTrackingSignalId: '',
shipmentLineItemMapping: [{lineItemId: '', quantity: '', shipmentId: ''}],
shippingInfo: [
{
actualDeliveryTime: {},
carrierName: '',
carrierServiceName: '',
earliestDeliveryPromiseTime: {},
latestDeliveryPromiseTime: {},
originPostalCode: '',
originRegionCode: '',
shipmentId: '',
shippedTime: {},
shippingStatus: '',
trackingId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/ordertrackingsignals';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"customerShippingFee":{"currency":"","value":""},"deliveryPostalCode":"","deliveryRegionCode":"","lineItems":[{"brand":"","gtin":"","lineItemId":"","mpn":"","productDescription":"","productId":"","productTitle":"","quantity":"","sku":"","upc":""}],"merchantId":"","orderCreatedTime":{"day":0,"hours":0,"minutes":0,"month":0,"nanos":0,"seconds":0,"timeZone":{"id":"","version":""},"utcOffset":"","year":0},"orderId":"","orderTrackingSignalId":"","shipmentLineItemMapping":[{"lineItemId":"","quantity":"","shipmentId":""}],"shippingInfo":[{"actualDeliveryTime":{},"carrierName":"","carrierServiceName":"","earliestDeliveryPromiseTime":{},"latestDeliveryPromiseTime":{},"originPostalCode":"","originRegionCode":"","shipmentId":"","shippedTime":{},"shippingStatus":"","trackingId":""}]}'
};
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}}/:merchantId/ordertrackingsignals',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "customerShippingFee": {\n "currency": "",\n "value": ""\n },\n "deliveryPostalCode": "",\n "deliveryRegionCode": "",\n "lineItems": [\n {\n "brand": "",\n "gtin": "",\n "lineItemId": "",\n "mpn": "",\n "productDescription": "",\n "productId": "",\n "productTitle": "",\n "quantity": "",\n "sku": "",\n "upc": ""\n }\n ],\n "merchantId": "",\n "orderCreatedTime": {\n "day": 0,\n "hours": 0,\n "minutes": 0,\n "month": 0,\n "nanos": 0,\n "seconds": 0,\n "timeZone": {\n "id": "",\n "version": ""\n },\n "utcOffset": "",\n "year": 0\n },\n "orderId": "",\n "orderTrackingSignalId": "",\n "shipmentLineItemMapping": [\n {\n "lineItemId": "",\n "quantity": "",\n "shipmentId": ""\n }\n ],\n "shippingInfo": [\n {\n "actualDeliveryTime": {},\n "carrierName": "",\n "carrierServiceName": "",\n "earliestDeliveryPromiseTime": {},\n "latestDeliveryPromiseTime": {},\n "originPostalCode": "",\n "originRegionCode": "",\n "shipmentId": "",\n "shippedTime": {},\n "shippingStatus": "",\n "trackingId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/ordertrackingsignals")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/ordertrackingsignals',
headers: {
'content-type': 'application/json'
}
};
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({
customerShippingFee: {currency: '', value: ''},
deliveryPostalCode: '',
deliveryRegionCode: '',
lineItems: [
{
brand: '',
gtin: '',
lineItemId: '',
mpn: '',
productDescription: '',
productId: '',
productTitle: '',
quantity: '',
sku: '',
upc: ''
}
],
merchantId: '',
orderCreatedTime: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
orderId: '',
orderTrackingSignalId: '',
shipmentLineItemMapping: [{lineItemId: '', quantity: '', shipmentId: ''}],
shippingInfo: [
{
actualDeliveryTime: {},
carrierName: '',
carrierServiceName: '',
earliestDeliveryPromiseTime: {},
latestDeliveryPromiseTime: {},
originPostalCode: '',
originRegionCode: '',
shipmentId: '',
shippedTime: {},
shippingStatus: '',
trackingId: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/ordertrackingsignals',
headers: {'content-type': 'application/json'},
body: {
customerShippingFee: {currency: '', value: ''},
deliveryPostalCode: '',
deliveryRegionCode: '',
lineItems: [
{
brand: '',
gtin: '',
lineItemId: '',
mpn: '',
productDescription: '',
productId: '',
productTitle: '',
quantity: '',
sku: '',
upc: ''
}
],
merchantId: '',
orderCreatedTime: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
orderId: '',
orderTrackingSignalId: '',
shipmentLineItemMapping: [{lineItemId: '', quantity: '', shipmentId: ''}],
shippingInfo: [
{
actualDeliveryTime: {},
carrierName: '',
carrierServiceName: '',
earliestDeliveryPromiseTime: {},
latestDeliveryPromiseTime: {},
originPostalCode: '',
originRegionCode: '',
shipmentId: '',
shippedTime: {},
shippingStatus: '',
trackingId: ''
}
]
},
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}}/:merchantId/ordertrackingsignals');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
customerShippingFee: {
currency: '',
value: ''
},
deliveryPostalCode: '',
deliveryRegionCode: '',
lineItems: [
{
brand: '',
gtin: '',
lineItemId: '',
mpn: '',
productDescription: '',
productId: '',
productTitle: '',
quantity: '',
sku: '',
upc: ''
}
],
merchantId: '',
orderCreatedTime: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {
id: '',
version: ''
},
utcOffset: '',
year: 0
},
orderId: '',
orderTrackingSignalId: '',
shipmentLineItemMapping: [
{
lineItemId: '',
quantity: '',
shipmentId: ''
}
],
shippingInfo: [
{
actualDeliveryTime: {},
carrierName: '',
carrierServiceName: '',
earliestDeliveryPromiseTime: {},
latestDeliveryPromiseTime: {},
originPostalCode: '',
originRegionCode: '',
shipmentId: '',
shippedTime: {},
shippingStatus: '',
trackingId: ''
}
]
});
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}}/:merchantId/ordertrackingsignals',
headers: {'content-type': 'application/json'},
data: {
customerShippingFee: {currency: '', value: ''},
deliveryPostalCode: '',
deliveryRegionCode: '',
lineItems: [
{
brand: '',
gtin: '',
lineItemId: '',
mpn: '',
productDescription: '',
productId: '',
productTitle: '',
quantity: '',
sku: '',
upc: ''
}
],
merchantId: '',
orderCreatedTime: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
orderId: '',
orderTrackingSignalId: '',
shipmentLineItemMapping: [{lineItemId: '', quantity: '', shipmentId: ''}],
shippingInfo: [
{
actualDeliveryTime: {},
carrierName: '',
carrierServiceName: '',
earliestDeliveryPromiseTime: {},
latestDeliveryPromiseTime: {},
originPostalCode: '',
originRegionCode: '',
shipmentId: '',
shippedTime: {},
shippingStatus: '',
trackingId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/ordertrackingsignals';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"customerShippingFee":{"currency":"","value":""},"deliveryPostalCode":"","deliveryRegionCode":"","lineItems":[{"brand":"","gtin":"","lineItemId":"","mpn":"","productDescription":"","productId":"","productTitle":"","quantity":"","sku":"","upc":""}],"merchantId":"","orderCreatedTime":{"day":0,"hours":0,"minutes":0,"month":0,"nanos":0,"seconds":0,"timeZone":{"id":"","version":""},"utcOffset":"","year":0},"orderId":"","orderTrackingSignalId":"","shipmentLineItemMapping":[{"lineItemId":"","quantity":"","shipmentId":""}],"shippingInfo":[{"actualDeliveryTime":{},"carrierName":"","carrierServiceName":"","earliestDeliveryPromiseTime":{},"latestDeliveryPromiseTime":{},"originPostalCode":"","originRegionCode":"","shipmentId":"","shippedTime":{},"shippingStatus":"","trackingId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"customerShippingFee": @{ @"currency": @"", @"value": @"" },
@"deliveryPostalCode": @"",
@"deliveryRegionCode": @"",
@"lineItems": @[ @{ @"brand": @"", @"gtin": @"", @"lineItemId": @"", @"mpn": @"", @"productDescription": @"", @"productId": @"", @"productTitle": @"", @"quantity": @"", @"sku": @"", @"upc": @"" } ],
@"merchantId": @"",
@"orderCreatedTime": @{ @"day": @0, @"hours": @0, @"minutes": @0, @"month": @0, @"nanos": @0, @"seconds": @0, @"timeZone": @{ @"id": @"", @"version": @"" }, @"utcOffset": @"", @"year": @0 },
@"orderId": @"",
@"orderTrackingSignalId": @"",
@"shipmentLineItemMapping": @[ @{ @"lineItemId": @"", @"quantity": @"", @"shipmentId": @"" } ],
@"shippingInfo": @[ @{ @"actualDeliveryTime": @{ }, @"carrierName": @"", @"carrierServiceName": @"", @"earliestDeliveryPromiseTime": @{ }, @"latestDeliveryPromiseTime": @{ }, @"originPostalCode": @"", @"originRegionCode": @"", @"shipmentId": @"", @"shippedTime": @{ }, @"shippingStatus": @"", @"trackingId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/ordertrackingsignals"]
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}}/:merchantId/ordertrackingsignals" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/ordertrackingsignals",
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([
'customerShippingFee' => [
'currency' => '',
'value' => ''
],
'deliveryPostalCode' => '',
'deliveryRegionCode' => '',
'lineItems' => [
[
'brand' => '',
'gtin' => '',
'lineItemId' => '',
'mpn' => '',
'productDescription' => '',
'productId' => '',
'productTitle' => '',
'quantity' => '',
'sku' => '',
'upc' => ''
]
],
'merchantId' => '',
'orderCreatedTime' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'orderId' => '',
'orderTrackingSignalId' => '',
'shipmentLineItemMapping' => [
[
'lineItemId' => '',
'quantity' => '',
'shipmentId' => ''
]
],
'shippingInfo' => [
[
'actualDeliveryTime' => [
],
'carrierName' => '',
'carrierServiceName' => '',
'earliestDeliveryPromiseTime' => [
],
'latestDeliveryPromiseTime' => [
],
'originPostalCode' => '',
'originRegionCode' => '',
'shipmentId' => '',
'shippedTime' => [
],
'shippingStatus' => '',
'trackingId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/ordertrackingsignals', [
'body' => '{
"customerShippingFee": {
"currency": "",
"value": ""
},
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
{
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
}
],
"merchantId": "",
"orderCreatedTime": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
{
"lineItemId": "",
"quantity": "",
"shipmentId": ""
}
],
"shippingInfo": [
{
"actualDeliveryTime": {},
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": {},
"latestDeliveryPromiseTime": {},
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": {},
"shippingStatus": "",
"trackingId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/ordertrackingsignals');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'customerShippingFee' => [
'currency' => '',
'value' => ''
],
'deliveryPostalCode' => '',
'deliveryRegionCode' => '',
'lineItems' => [
[
'brand' => '',
'gtin' => '',
'lineItemId' => '',
'mpn' => '',
'productDescription' => '',
'productId' => '',
'productTitle' => '',
'quantity' => '',
'sku' => '',
'upc' => ''
]
],
'merchantId' => '',
'orderCreatedTime' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'orderId' => '',
'orderTrackingSignalId' => '',
'shipmentLineItemMapping' => [
[
'lineItemId' => '',
'quantity' => '',
'shipmentId' => ''
]
],
'shippingInfo' => [
[
'actualDeliveryTime' => [
],
'carrierName' => '',
'carrierServiceName' => '',
'earliestDeliveryPromiseTime' => [
],
'latestDeliveryPromiseTime' => [
],
'originPostalCode' => '',
'originRegionCode' => '',
'shipmentId' => '',
'shippedTime' => [
],
'shippingStatus' => '',
'trackingId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'customerShippingFee' => [
'currency' => '',
'value' => ''
],
'deliveryPostalCode' => '',
'deliveryRegionCode' => '',
'lineItems' => [
[
'brand' => '',
'gtin' => '',
'lineItemId' => '',
'mpn' => '',
'productDescription' => '',
'productId' => '',
'productTitle' => '',
'quantity' => '',
'sku' => '',
'upc' => ''
]
],
'merchantId' => '',
'orderCreatedTime' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'orderId' => '',
'orderTrackingSignalId' => '',
'shipmentLineItemMapping' => [
[
'lineItemId' => '',
'quantity' => '',
'shipmentId' => ''
]
],
'shippingInfo' => [
[
'actualDeliveryTime' => [
],
'carrierName' => '',
'carrierServiceName' => '',
'earliestDeliveryPromiseTime' => [
],
'latestDeliveryPromiseTime' => [
],
'originPostalCode' => '',
'originRegionCode' => '',
'shipmentId' => '',
'shippedTime' => [
],
'shippingStatus' => '',
'trackingId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/ordertrackingsignals');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/ordertrackingsignals' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customerShippingFee": {
"currency": "",
"value": ""
},
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
{
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
}
],
"merchantId": "",
"orderCreatedTime": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
{
"lineItemId": "",
"quantity": "",
"shipmentId": ""
}
],
"shippingInfo": [
{
"actualDeliveryTime": {},
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": {},
"latestDeliveryPromiseTime": {},
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": {},
"shippingStatus": "",
"trackingId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/ordertrackingsignals' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customerShippingFee": {
"currency": "",
"value": ""
},
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
{
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
}
],
"merchantId": "",
"orderCreatedTime": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
{
"lineItemId": "",
"quantity": "",
"shipmentId": ""
}
],
"shippingInfo": [
{
"actualDeliveryTime": {},
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": {},
"latestDeliveryPromiseTime": {},
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": {},
"shippingStatus": "",
"trackingId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/ordertrackingsignals", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/ordertrackingsignals"
payload = {
"customerShippingFee": {
"currency": "",
"value": ""
},
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
{
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
}
],
"merchantId": "",
"orderCreatedTime": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
{
"lineItemId": "",
"quantity": "",
"shipmentId": ""
}
],
"shippingInfo": [
{
"actualDeliveryTime": {},
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": {},
"latestDeliveryPromiseTime": {},
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": {},
"shippingStatus": "",
"trackingId": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/ordertrackingsignals"
payload <- "{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/ordertrackingsignals")
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 \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\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.post('/baseUrl/:merchantId/ordertrackingsignals') do |req|
req.body = "{\n \"customerShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"deliveryPostalCode\": \"\",\n \"deliveryRegionCode\": \"\",\n \"lineItems\": [\n {\n \"brand\": \"\",\n \"gtin\": \"\",\n \"lineItemId\": \"\",\n \"mpn\": \"\",\n \"productDescription\": \"\",\n \"productId\": \"\",\n \"productTitle\": \"\",\n \"quantity\": \"\",\n \"sku\": \"\",\n \"upc\": \"\"\n }\n ],\n \"merchantId\": \"\",\n \"orderCreatedTime\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"orderId\": \"\",\n \"orderTrackingSignalId\": \"\",\n \"shipmentLineItemMapping\": [\n {\n \"lineItemId\": \"\",\n \"quantity\": \"\",\n \"shipmentId\": \"\"\n }\n ],\n \"shippingInfo\": [\n {\n \"actualDeliveryTime\": {},\n \"carrierName\": \"\",\n \"carrierServiceName\": \"\",\n \"earliestDeliveryPromiseTime\": {},\n \"latestDeliveryPromiseTime\": {},\n \"originPostalCode\": \"\",\n \"originRegionCode\": \"\",\n \"shipmentId\": \"\",\n \"shippedTime\": {},\n \"shippingStatus\": \"\",\n \"trackingId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/ordertrackingsignals";
let payload = json!({
"customerShippingFee": json!({
"currency": "",
"value": ""
}),
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": (
json!({
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
})
),
"merchantId": "",
"orderCreatedTime": json!({
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": json!({
"id": "",
"version": ""
}),
"utcOffset": "",
"year": 0
}),
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": (
json!({
"lineItemId": "",
"quantity": "",
"shipmentId": ""
})
),
"shippingInfo": (
json!({
"actualDeliveryTime": json!({}),
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": json!({}),
"latestDeliveryPromiseTime": json!({}),
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": json!({}),
"shippingStatus": "",
"trackingId": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/ordertrackingsignals \
--header 'content-type: application/json' \
--data '{
"customerShippingFee": {
"currency": "",
"value": ""
},
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
{
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
}
],
"merchantId": "",
"orderCreatedTime": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
{
"lineItemId": "",
"quantity": "",
"shipmentId": ""
}
],
"shippingInfo": [
{
"actualDeliveryTime": {},
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": {},
"latestDeliveryPromiseTime": {},
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": {},
"shippingStatus": "",
"trackingId": ""
}
]
}'
echo '{
"customerShippingFee": {
"currency": "",
"value": ""
},
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
{
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
}
],
"merchantId": "",
"orderCreatedTime": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
{
"lineItemId": "",
"quantity": "",
"shipmentId": ""
}
],
"shippingInfo": [
{
"actualDeliveryTime": {},
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": {},
"latestDeliveryPromiseTime": {},
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": {},
"shippingStatus": "",
"trackingId": ""
}
]
}' | \
http POST {{baseUrl}}/:merchantId/ordertrackingsignals \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "customerShippingFee": {\n "currency": "",\n "value": ""\n },\n "deliveryPostalCode": "",\n "deliveryRegionCode": "",\n "lineItems": [\n {\n "brand": "",\n "gtin": "",\n "lineItemId": "",\n "mpn": "",\n "productDescription": "",\n "productId": "",\n "productTitle": "",\n "quantity": "",\n "sku": "",\n "upc": ""\n }\n ],\n "merchantId": "",\n "orderCreatedTime": {\n "day": 0,\n "hours": 0,\n "minutes": 0,\n "month": 0,\n "nanos": 0,\n "seconds": 0,\n "timeZone": {\n "id": "",\n "version": ""\n },\n "utcOffset": "",\n "year": 0\n },\n "orderId": "",\n "orderTrackingSignalId": "",\n "shipmentLineItemMapping": [\n {\n "lineItemId": "",\n "quantity": "",\n "shipmentId": ""\n }\n ],\n "shippingInfo": [\n {\n "actualDeliveryTime": {},\n "carrierName": "",\n "carrierServiceName": "",\n "earliestDeliveryPromiseTime": {},\n "latestDeliveryPromiseTime": {},\n "originPostalCode": "",\n "originRegionCode": "",\n "shipmentId": "",\n "shippedTime": {},\n "shippingStatus": "",\n "trackingId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/ordertrackingsignals
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"customerShippingFee": [
"currency": "",
"value": ""
],
"deliveryPostalCode": "",
"deliveryRegionCode": "",
"lineItems": [
[
"brand": "",
"gtin": "",
"lineItemId": "",
"mpn": "",
"productDescription": "",
"productId": "",
"productTitle": "",
"quantity": "",
"sku": "",
"upc": ""
]
],
"merchantId": "",
"orderCreatedTime": [
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": [
"id": "",
"version": ""
],
"utcOffset": "",
"year": 0
],
"orderId": "",
"orderTrackingSignalId": "",
"shipmentLineItemMapping": [
[
"lineItemId": "",
"quantity": "",
"shipmentId": ""
]
],
"shippingInfo": [
[
"actualDeliveryTime": [],
"carrierName": "",
"carrierServiceName": "",
"earliestDeliveryPromiseTime": [],
"latestDeliveryPromiseTime": [],
"originPostalCode": "",
"originRegionCode": "",
"shipmentId": "",
"shippedTime": [],
"shippingStatus": "",
"trackingId": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/ordertrackingsignals")! 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()
POST
content.pos.custombatch
{{baseUrl}}/pos/batch
BODY json
{
"entries": [
{
"batchId": 0,
"inventory": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"merchantId": "",
"method": "",
"sale": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"store": {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
},
"storeCode": "",
"targetMerchantId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/pos/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/pos/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:inventory {:contentLanguage ""
:gtin ""
:itemId ""
:kind ""
:price {:currency ""
:value ""}
:quantity ""
:storeCode ""
:targetCountry ""
:timestamp ""}
:merchantId ""
:method ""
:sale {:contentLanguage ""
:gtin ""
:itemId ""
:kind ""
:price {}
:quantity ""
:saleId ""
:storeCode ""
:targetCountry ""
:timestamp ""}
:store {:gcidCategory []
:kind ""
:phoneNumber ""
:placeId ""
:storeAddress ""
:storeCode ""
:storeName ""
:websiteUrl ""}
:storeCode ""
:targetMerchantId ""}]}})
require "http/client"
url = "{{baseUrl}}/pos/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\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}}/pos/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\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}}/pos/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/pos/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/pos/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 943
{
"entries": [
{
"batchId": 0,
"inventory": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"merchantId": "",
"method": "",
"sale": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"store": {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
},
"storeCode": "",
"targetMerchantId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/pos/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/pos/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/pos/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/pos/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
inventory: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {
currency: '',
value: ''
},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
merchantId: '',
method: '',
sale: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
store: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
},
storeCode: '',
targetMerchantId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/pos/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/pos/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
inventory: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {currency: '', value: ''},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
merchantId: '',
method: '',
sale: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
store: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
},
storeCode: '',
targetMerchantId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/pos/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"inventory":{"contentLanguage":"","gtin":"","itemId":"","kind":"","price":{"currency":"","value":""},"quantity":"","storeCode":"","targetCountry":"","timestamp":""},"merchantId":"","method":"","sale":{"contentLanguage":"","gtin":"","itemId":"","kind":"","price":{},"quantity":"","saleId":"","storeCode":"","targetCountry":"","timestamp":""},"store":{"gcidCategory":[],"kind":"","phoneNumber":"","placeId":"","storeAddress":"","storeCode":"","storeName":"","websiteUrl":""},"storeCode":"","targetMerchantId":""}]}'
};
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}}/pos/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "inventory": {\n "contentLanguage": "",\n "gtin": "",\n "itemId": "",\n "kind": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": "",\n "storeCode": "",\n "targetCountry": "",\n "timestamp": ""\n },\n "merchantId": "",\n "method": "",\n "sale": {\n "contentLanguage": "",\n "gtin": "",\n "itemId": "",\n "kind": "",\n "price": {},\n "quantity": "",\n "saleId": "",\n "storeCode": "",\n "targetCountry": "",\n "timestamp": ""\n },\n "store": {\n "gcidCategory": [],\n "kind": "",\n "phoneNumber": "",\n "placeId": "",\n "storeAddress": "",\n "storeCode": "",\n "storeName": "",\n "websiteUrl": ""\n },\n "storeCode": "",\n "targetMerchantId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/pos/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/pos/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
inventory: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {currency: '', value: ''},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
merchantId: '',
method: '',
sale: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
store: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
},
storeCode: '',
targetMerchantId: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/pos/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
inventory: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {currency: '', value: ''},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
merchantId: '',
method: '',
sale: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
store: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
},
storeCode: '',
targetMerchantId: ''
}
]
},
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}}/pos/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
inventory: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {
currency: '',
value: ''
},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
merchantId: '',
method: '',
sale: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
store: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
},
storeCode: '',
targetMerchantId: ''
}
]
});
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}}/pos/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
inventory: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {currency: '', value: ''},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
merchantId: '',
method: '',
sale: {
contentLanguage: '',
gtin: '',
itemId: '',
kind: '',
price: {},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
store: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
},
storeCode: '',
targetMerchantId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/pos/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"inventory":{"contentLanguage":"","gtin":"","itemId":"","kind":"","price":{"currency":"","value":""},"quantity":"","storeCode":"","targetCountry":"","timestamp":""},"merchantId":"","method":"","sale":{"contentLanguage":"","gtin":"","itemId":"","kind":"","price":{},"quantity":"","saleId":"","storeCode":"","targetCountry":"","timestamp":""},"store":{"gcidCategory":[],"kind":"","phoneNumber":"","placeId":"","storeAddress":"","storeCode":"","storeName":"","websiteUrl":""},"storeCode":"","targetMerchantId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"inventory": @{ @"contentLanguage": @"", @"gtin": @"", @"itemId": @"", @"kind": @"", @"price": @{ @"currency": @"", @"value": @"" }, @"quantity": @"", @"storeCode": @"", @"targetCountry": @"", @"timestamp": @"" }, @"merchantId": @"", @"method": @"", @"sale": @{ @"contentLanguage": @"", @"gtin": @"", @"itemId": @"", @"kind": @"", @"price": @{ }, @"quantity": @"", @"saleId": @"", @"storeCode": @"", @"targetCountry": @"", @"timestamp": @"" }, @"store": @{ @"gcidCategory": @[ ], @"kind": @"", @"phoneNumber": @"", @"placeId": @"", @"storeAddress": @"", @"storeCode": @"", @"storeName": @"", @"websiteUrl": @"" }, @"storeCode": @"", @"targetMerchantId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/pos/batch"]
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}}/pos/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/pos/batch",
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([
'entries' => [
[
'batchId' => 0,
'inventory' => [
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
],
'merchantId' => '',
'method' => '',
'sale' => [
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'kind' => '',
'price' => [
],
'quantity' => '',
'saleId' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
],
'store' => [
'gcidCategory' => [
],
'kind' => '',
'phoneNumber' => '',
'placeId' => '',
'storeAddress' => '',
'storeCode' => '',
'storeName' => '',
'websiteUrl' => ''
],
'storeCode' => '',
'targetMerchantId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/pos/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"inventory": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"merchantId": "",
"method": "",
"sale": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"store": {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
},
"storeCode": "",
"targetMerchantId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/pos/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'inventory' => [
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
],
'merchantId' => '',
'method' => '',
'sale' => [
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'kind' => '',
'price' => [
],
'quantity' => '',
'saleId' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
],
'store' => [
'gcidCategory' => [
],
'kind' => '',
'phoneNumber' => '',
'placeId' => '',
'storeAddress' => '',
'storeCode' => '',
'storeName' => '',
'websiteUrl' => ''
],
'storeCode' => '',
'targetMerchantId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'inventory' => [
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
],
'merchantId' => '',
'method' => '',
'sale' => [
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'kind' => '',
'price' => [
],
'quantity' => '',
'saleId' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
],
'store' => [
'gcidCategory' => [
],
'kind' => '',
'phoneNumber' => '',
'placeId' => '',
'storeAddress' => '',
'storeCode' => '',
'storeName' => '',
'websiteUrl' => ''
],
'storeCode' => '',
'targetMerchantId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/pos/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/pos/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"inventory": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"merchantId": "",
"method": "",
"sale": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"store": {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
},
"storeCode": "",
"targetMerchantId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/pos/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"inventory": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"merchantId": "",
"method": "",
"sale": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"store": {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
},
"storeCode": "",
"targetMerchantId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/pos/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/pos/batch"
payload = { "entries": [
{
"batchId": 0,
"inventory": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"merchantId": "",
"method": "",
"sale": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"store": {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
},
"storeCode": "",
"targetMerchantId": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/pos/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/pos/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\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.post('/baseUrl/pos/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"inventory\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"merchantId\": \"\",\n \"method\": \"\",\n \"sale\": {\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"kind\": \"\",\n \"price\": {},\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n },\n \"store\": {\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n },\n \"storeCode\": \"\",\n \"targetMerchantId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/pos/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"inventory": json!({
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": json!({
"currency": "",
"value": ""
}),
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}),
"merchantId": "",
"method": "",
"sale": json!({
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": json!({}),
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}),
"store": json!({
"gcidCategory": (),
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}),
"storeCode": "",
"targetMerchantId": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/pos/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"inventory": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"merchantId": "",
"method": "",
"sale": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"store": {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
},
"storeCode": "",
"targetMerchantId": ""
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"inventory": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"merchantId": "",
"method": "",
"sale": {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": {},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
},
"store": {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
},
"storeCode": "",
"targetMerchantId": ""
}
]
}' | \
http POST {{baseUrl}}/pos/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "inventory": {\n "contentLanguage": "",\n "gtin": "",\n "itemId": "",\n "kind": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": "",\n "storeCode": "",\n "targetCountry": "",\n "timestamp": ""\n },\n "merchantId": "",\n "method": "",\n "sale": {\n "contentLanguage": "",\n "gtin": "",\n "itemId": "",\n "kind": "",\n "price": {},\n "quantity": "",\n "saleId": "",\n "storeCode": "",\n "targetCountry": "",\n "timestamp": ""\n },\n "store": {\n "gcidCategory": [],\n "kind": "",\n "phoneNumber": "",\n "placeId": "",\n "storeAddress": "",\n "storeCode": "",\n "storeName": "",\n "websiteUrl": ""\n },\n "storeCode": "",\n "targetMerchantId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/pos/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"inventory": [
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": [
"currency": "",
"value": ""
],
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
],
"merchantId": "",
"method": "",
"sale": [
"contentLanguage": "",
"gtin": "",
"itemId": "",
"kind": "",
"price": [],
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
],
"store": [
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
],
"storeCode": "",
"targetMerchantId": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/pos/batch")! 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()
DELETE
content.pos.delete
{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode
QUERY PARAMS
merchantId
targetMerchantId
storeCode
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
require "http/client"
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/pos/:targetMerchantId/store/:storeCode HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode';
const options = {method: 'DELETE'};
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}}/:merchantId/pos/:targetMerchantId/store/:storeCode',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/pos/:targetMerchantId/store/:storeCode',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/pos/:targetMerchantId/store/:storeCode" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/pos/:targetMerchantId/store/:storeCode")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/pos/:targetMerchantId/store/:storeCode') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode
http DELETE {{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.pos.get
{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode
QUERY PARAMS
merchantId
targetMerchantId
storeCode
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
require "http/client"
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/pos/:targetMerchantId/store/:storeCode HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode';
const options = {method: 'GET'};
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}}/:merchantId/pos/:targetMerchantId/store/:storeCode',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/pos/:targetMerchantId/store/:storeCode',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/pos/:targetMerchantId/store/:storeCode" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/pos/:targetMerchantId/store/:storeCode")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/pos/:targetMerchantId/store/:storeCode') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode
http GET {{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store/:storeCode")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.pos.insert
{{baseUrl}}/:merchantId/pos/:targetMerchantId/store
QUERY PARAMS
merchantId
targetMerchantId
BODY json
{
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store" {:content-type :json
:form-params {:gcidCategory []
:kind ""
:phoneNumber ""
:placeId ""
:storeAddress ""
:storeCode ""
:storeName ""
:websiteUrl ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\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}}/:merchantId/pos/:targetMerchantId/store"),
Content = new StringContent("{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\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}}/:merchantId/pos/:targetMerchantId/store");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"
payload := strings.NewReader("{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/pos/:targetMerchantId/store HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 156
{
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
.setHeader("content-type", "application/json")
.setBody("{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\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 \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
.header("content-type", "application/json")
.body("{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store',
headers: {'content-type': 'application/json'},
data: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gcidCategory":[],"kind":"","phoneNumber":"","placeId":"","storeAddress":"","storeCode":"","storeName":"","websiteUrl":""}'
};
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}}/:merchantId/pos/:targetMerchantId/store',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "gcidCategory": [],\n "kind": "",\n "phoneNumber": "",\n "placeId": "",\n "storeAddress": "",\n "storeCode": "",\n "storeName": "",\n "websiteUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/pos/:targetMerchantId/store',
headers: {
'content-type': 'application/json'
}
};
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({
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store',
headers: {'content-type': 'application/json'},
body: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
},
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}}/:merchantId/pos/:targetMerchantId/store');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
});
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}}/:merchantId/pos/:targetMerchantId/store',
headers: {'content-type': 'application/json'},
data: {
gcidCategory: [],
kind: '',
phoneNumber: '',
placeId: '',
storeAddress: '',
storeCode: '',
storeName: '',
websiteUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"gcidCategory":[],"kind":"","phoneNumber":"","placeId":"","storeAddress":"","storeCode":"","storeName":"","websiteUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"gcidCategory": @[ ],
@"kind": @"",
@"phoneNumber": @"",
@"placeId": @"",
@"storeAddress": @"",
@"storeCode": @"",
@"storeName": @"",
@"websiteUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"]
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}}/:merchantId/pos/:targetMerchantId/store" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/pos/:targetMerchantId/store",
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([
'gcidCategory' => [
],
'kind' => '',
'phoneNumber' => '',
'placeId' => '',
'storeAddress' => '',
'storeCode' => '',
'storeName' => '',
'websiteUrl' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store', [
'body' => '{
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/store');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'gcidCategory' => [
],
'kind' => '',
'phoneNumber' => '',
'placeId' => '',
'storeAddress' => '',
'storeCode' => '',
'storeName' => '',
'websiteUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'gcidCategory' => [
],
'kind' => '',
'phoneNumber' => '',
'placeId' => '',
'storeAddress' => '',
'storeCode' => '',
'storeName' => '',
'websiteUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/store');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/pos/:targetMerchantId/store", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"
payload = {
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"
payload <- "{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
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 \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\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.post('/baseUrl/:merchantId/pos/:targetMerchantId/store') do |req|
req.body = "{\n \"gcidCategory\": [],\n \"kind\": \"\",\n \"phoneNumber\": \"\",\n \"placeId\": \"\",\n \"storeAddress\": \"\",\n \"storeCode\": \"\",\n \"storeName\": \"\",\n \"websiteUrl\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store";
let payload = json!({
"gcidCategory": (),
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/pos/:targetMerchantId/store \
--header 'content-type: application/json' \
--data '{
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}'
echo '{
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
}' | \
http POST {{baseUrl}}/:merchantId/pos/:targetMerchantId/store \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "gcidCategory": [],\n "kind": "",\n "phoneNumber": "",\n "placeId": "",\n "storeAddress": "",\n "storeCode": "",\n "storeName": "",\n "websiteUrl": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/pos/:targetMerchantId/store
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"gcidCategory": [],
"kind": "",
"phoneNumber": "",
"placeId": "",
"storeAddress": "",
"storeCode": "",
"storeName": "",
"websiteUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")! 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()
POST
content.pos.inventory
{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory
QUERY PARAMS
merchantId
targetMerchantId
BODY json
{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory" {:content-type :json
:form-params {:contentLanguage ""
:gtin ""
:itemId ""
:price {:currency ""
:value ""}
:quantity ""
:storeCode ""
:targetCountry ""
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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}}/:merchantId/pos/:targetMerchantId/inventory"),
Content = new StringContent("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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}}/:merchantId/pos/:targetMerchantId/inventory");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory"
payload := strings.NewReader("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/pos/:targetMerchantId/inventory HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 190
{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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 \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory")
.header("content-type", "application/json")
.body("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
contentLanguage: '',
gtin: '',
itemId: '',
price: {
currency: '',
value: ''
},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory',
headers: {'content-type': 'application/json'},
data: {
contentLanguage: '',
gtin: '',
itemId: '',
price: {currency: '', value: ''},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentLanguage":"","gtin":"","itemId":"","price":{"currency":"","value":""},"quantity":"","storeCode":"","targetCountry":"","timestamp":""}'
};
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}}/:merchantId/pos/:targetMerchantId/inventory',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentLanguage": "",\n "gtin": "",\n "itemId": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": "",\n "storeCode": "",\n "targetCountry": "",\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/pos/:targetMerchantId/inventory',
headers: {
'content-type': 'application/json'
}
};
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({
contentLanguage: '',
gtin: '',
itemId: '',
price: {currency: '', value: ''},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory',
headers: {'content-type': 'application/json'},
body: {
contentLanguage: '',
gtin: '',
itemId: '',
price: {currency: '', value: ''},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
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}}/:merchantId/pos/:targetMerchantId/inventory');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentLanguage: '',
gtin: '',
itemId: '',
price: {
currency: '',
value: ''
},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
});
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}}/:merchantId/pos/:targetMerchantId/inventory',
headers: {'content-type': 'application/json'},
data: {
contentLanguage: '',
gtin: '',
itemId: '',
price: {currency: '', value: ''},
quantity: '',
storeCode: '',
targetCountry: '',
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentLanguage":"","gtin":"","itemId":"","price":{"currency":"","value":""},"quantity":"","storeCode":"","targetCountry":"","timestamp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"contentLanguage": @"",
@"gtin": @"",
@"itemId": @"",
@"price": @{ @"currency": @"", @"value": @"" },
@"quantity": @"",
@"storeCode": @"",
@"targetCountry": @"",
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory"]
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}}/:merchantId/pos/:targetMerchantId/inventory" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory",
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([
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory', [
'body' => '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/pos/:targetMerchantId/inventory", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory"
payload = {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory"
payload <- "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory")
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 \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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.post('/baseUrl/:merchantId/pos/:targetMerchantId/inventory') do |req|
req.body = "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory";
let payload = json!({
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": json!({
"currency": "",
"value": ""
}),
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory \
--header 'content-type: application/json' \
--data '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}'
echo '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}' | \
http POST {{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "contentLanguage": "",\n "gtin": "",\n "itemId": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": "",\n "storeCode": "",\n "targetCountry": "",\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": [
"currency": "",
"value": ""
],
"quantity": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/pos/:targetMerchantId/inventory")! 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()
GET
content.pos.list
{{baseUrl}}/:merchantId/pos/:targetMerchantId/store
QUERY PARAMS
merchantId
targetMerchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
require "http/client"
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/pos/:targetMerchantId/store HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store';
const options = {method: 'GET'};
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}}/:merchantId/pos/:targetMerchantId/store',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/pos/:targetMerchantId/store',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/pos/:targetMerchantId/store" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/pos/:targetMerchantId/store",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/store');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/store');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/store' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/pos/:targetMerchantId/store")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/pos/:targetMerchantId/store') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/pos/:targetMerchantId/store
http GET {{baseUrl}}/:merchantId/pos/:targetMerchantId/store
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/pos/:targetMerchantId/store
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/pos/:targetMerchantId/store")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.pos.sale
{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale
QUERY PARAMS
merchantId
targetMerchantId
BODY json
{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale" {:content-type :json
:form-params {:contentLanguage ""
:gtin ""
:itemId ""
:price {:currency ""
:value ""}
:quantity ""
:saleId ""
:storeCode ""
:targetCountry ""
:timestamp ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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}}/:merchantId/pos/:targetMerchantId/sale"),
Content = new StringContent("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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}}/:merchantId/pos/:targetMerchantId/sale");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale"
payload := strings.NewReader("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/pos/:targetMerchantId/sale HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 206
{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale")
.setHeader("content-type", "application/json")
.setBody("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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 \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale")
.header("content-type", "application/json")
.body("{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}")
.asString();
const data = JSON.stringify({
contentLanguage: '',
gtin: '',
itemId: '',
price: {
currency: '',
value: ''
},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale',
headers: {'content-type': 'application/json'},
data: {
contentLanguage: '',
gtin: '',
itemId: '',
price: {currency: '', value: ''},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentLanguage":"","gtin":"","itemId":"","price":{"currency":"","value":""},"quantity":"","saleId":"","storeCode":"","targetCountry":"","timestamp":""}'
};
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}}/:merchantId/pos/:targetMerchantId/sale',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "contentLanguage": "",\n "gtin": "",\n "itemId": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": "",\n "saleId": "",\n "storeCode": "",\n "targetCountry": "",\n "timestamp": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/pos/:targetMerchantId/sale',
headers: {
'content-type': 'application/json'
}
};
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({
contentLanguage: '',
gtin: '',
itemId: '',
price: {currency: '', value: ''},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale',
headers: {'content-type': 'application/json'},
body: {
contentLanguage: '',
gtin: '',
itemId: '',
price: {currency: '', value: ''},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
},
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}}/:merchantId/pos/:targetMerchantId/sale');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
contentLanguage: '',
gtin: '',
itemId: '',
price: {
currency: '',
value: ''
},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
});
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}}/:merchantId/pos/:targetMerchantId/sale',
headers: {'content-type': 'application/json'},
data: {
contentLanguage: '',
gtin: '',
itemId: '',
price: {currency: '', value: ''},
quantity: '',
saleId: '',
storeCode: '',
targetCountry: '',
timestamp: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"contentLanguage":"","gtin":"","itemId":"","price":{"currency":"","value":""},"quantity":"","saleId":"","storeCode":"","targetCountry":"","timestamp":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"contentLanguage": @"",
@"gtin": @"",
@"itemId": @"",
@"price": @{ @"currency": @"", @"value": @"" },
@"quantity": @"",
@"saleId": @"",
@"storeCode": @"",
@"targetCountry": @"",
@"timestamp": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale"]
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}}/:merchantId/pos/:targetMerchantId/sale" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale",
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([
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'saleId' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale', [
'body' => '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'saleId' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'contentLanguage' => '',
'gtin' => '',
'itemId' => '',
'price' => [
'currency' => '',
'value' => ''
],
'quantity' => '',
'saleId' => '',
'storeCode' => '',
'targetCountry' => '',
'timestamp' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/pos/:targetMerchantId/sale", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale"
payload = {
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale"
payload <- "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale")
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 \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\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.post('/baseUrl/:merchantId/pos/:targetMerchantId/sale') do |req|
req.body = "{\n \"contentLanguage\": \"\",\n \"gtin\": \"\",\n \"itemId\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"quantity\": \"\",\n \"saleId\": \"\",\n \"storeCode\": \"\",\n \"targetCountry\": \"\",\n \"timestamp\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale";
let payload = json!({
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": json!({
"currency": "",
"value": ""
}),
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/pos/:targetMerchantId/sale \
--header 'content-type: application/json' \
--data '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}'
echo '{
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": {
"currency": "",
"value": ""
},
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
}' | \
http POST {{baseUrl}}/:merchantId/pos/:targetMerchantId/sale \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "contentLanguage": "",\n "gtin": "",\n "itemId": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "quantity": "",\n "saleId": "",\n "storeCode": "",\n "targetCountry": "",\n "timestamp": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/pos/:targetMerchantId/sale
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"contentLanguage": "",
"gtin": "",
"itemId": "",
"price": [
"currency": "",
"value": ""
],
"quantity": "",
"saleId": "",
"storeCode": "",
"targetCountry": "",
"timestamp": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/pos/:targetMerchantId/sale")! 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()
POST
content.productdeliverytime.create
{{baseUrl}}/:merchantId/productdeliverytime
QUERY PARAMS
merchantId
BODY json
{
"areaDeliveryTimes": [
{
"deliveryArea": {
"countryCode": "",
"postalCodeRange": {
"firstPostalCode": "",
"lastPostalCode": ""
},
"regionCode": ""
},
"deliveryTime": {
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
}
}
],
"productId": {
"productId": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/productdeliverytime");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/productdeliverytime" {:content-type :json
:form-params {:areaDeliveryTimes [{:deliveryArea {:countryCode ""
:postalCodeRange {:firstPostalCode ""
:lastPostalCode ""}
:regionCode ""}
:deliveryTime {:maxHandlingTimeDays 0
:maxTransitTimeDays 0
:minHandlingTimeDays 0
:minTransitTimeDays 0}}]
:productId {:productId ""}}})
require "http/client"
url = "{{baseUrl}}/:merchantId/productdeliverytime"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\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}}/:merchantId/productdeliverytime"),
Content = new StringContent("{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\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}}/:merchantId/productdeliverytime");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/productdeliverytime"
payload := strings.NewReader("{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/productdeliverytime HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 440
{
"areaDeliveryTimes": [
{
"deliveryArea": {
"countryCode": "",
"postalCodeRange": {
"firstPostalCode": "",
"lastPostalCode": ""
},
"regionCode": ""
},
"deliveryTime": {
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
}
}
],
"productId": {
"productId": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/productdeliverytime")
.setHeader("content-type", "application/json")
.setBody("{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/productdeliverytime"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\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 \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/productdeliverytime")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/productdeliverytime")
.header("content-type", "application/json")
.body("{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
areaDeliveryTimes: [
{
deliveryArea: {
countryCode: '',
postalCodeRange: {
firstPostalCode: '',
lastPostalCode: ''
},
regionCode: ''
},
deliveryTime: {
maxHandlingTimeDays: 0,
maxTransitTimeDays: 0,
minHandlingTimeDays: 0,
minTransitTimeDays: 0
}
}
],
productId: {
productId: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/productdeliverytime');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/productdeliverytime',
headers: {'content-type': 'application/json'},
data: {
areaDeliveryTimes: [
{
deliveryArea: {
countryCode: '',
postalCodeRange: {firstPostalCode: '', lastPostalCode: ''},
regionCode: ''
},
deliveryTime: {
maxHandlingTimeDays: 0,
maxTransitTimeDays: 0,
minHandlingTimeDays: 0,
minTransitTimeDays: 0
}
}
],
productId: {productId: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/productdeliverytime';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"areaDeliveryTimes":[{"deliveryArea":{"countryCode":"","postalCodeRange":{"firstPostalCode":"","lastPostalCode":""},"regionCode":""},"deliveryTime":{"maxHandlingTimeDays":0,"maxTransitTimeDays":0,"minHandlingTimeDays":0,"minTransitTimeDays":0}}],"productId":{"productId":""}}'
};
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}}/:merchantId/productdeliverytime',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "areaDeliveryTimes": [\n {\n "deliveryArea": {\n "countryCode": "",\n "postalCodeRange": {\n "firstPostalCode": "",\n "lastPostalCode": ""\n },\n "regionCode": ""\n },\n "deliveryTime": {\n "maxHandlingTimeDays": 0,\n "maxTransitTimeDays": 0,\n "minHandlingTimeDays": 0,\n "minTransitTimeDays": 0\n }\n }\n ],\n "productId": {\n "productId": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/productdeliverytime")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/productdeliverytime',
headers: {
'content-type': 'application/json'
}
};
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({
areaDeliveryTimes: [
{
deliveryArea: {
countryCode: '',
postalCodeRange: {firstPostalCode: '', lastPostalCode: ''},
regionCode: ''
},
deliveryTime: {
maxHandlingTimeDays: 0,
maxTransitTimeDays: 0,
minHandlingTimeDays: 0,
minTransitTimeDays: 0
}
}
],
productId: {productId: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/productdeliverytime',
headers: {'content-type': 'application/json'},
body: {
areaDeliveryTimes: [
{
deliveryArea: {
countryCode: '',
postalCodeRange: {firstPostalCode: '', lastPostalCode: ''},
regionCode: ''
},
deliveryTime: {
maxHandlingTimeDays: 0,
maxTransitTimeDays: 0,
minHandlingTimeDays: 0,
minTransitTimeDays: 0
}
}
],
productId: {productId: ''}
},
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}}/:merchantId/productdeliverytime');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
areaDeliveryTimes: [
{
deliveryArea: {
countryCode: '',
postalCodeRange: {
firstPostalCode: '',
lastPostalCode: ''
},
regionCode: ''
},
deliveryTime: {
maxHandlingTimeDays: 0,
maxTransitTimeDays: 0,
minHandlingTimeDays: 0,
minTransitTimeDays: 0
}
}
],
productId: {
productId: ''
}
});
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}}/:merchantId/productdeliverytime',
headers: {'content-type': 'application/json'},
data: {
areaDeliveryTimes: [
{
deliveryArea: {
countryCode: '',
postalCodeRange: {firstPostalCode: '', lastPostalCode: ''},
regionCode: ''
},
deliveryTime: {
maxHandlingTimeDays: 0,
maxTransitTimeDays: 0,
minHandlingTimeDays: 0,
minTransitTimeDays: 0
}
}
],
productId: {productId: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/productdeliverytime';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"areaDeliveryTimes":[{"deliveryArea":{"countryCode":"","postalCodeRange":{"firstPostalCode":"","lastPostalCode":""},"regionCode":""},"deliveryTime":{"maxHandlingTimeDays":0,"maxTransitTimeDays":0,"minHandlingTimeDays":0,"minTransitTimeDays":0}}],"productId":{"productId":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"areaDeliveryTimes": @[ @{ @"deliveryArea": @{ @"countryCode": @"", @"postalCodeRange": @{ @"firstPostalCode": @"", @"lastPostalCode": @"" }, @"regionCode": @"" }, @"deliveryTime": @{ @"maxHandlingTimeDays": @0, @"maxTransitTimeDays": @0, @"minHandlingTimeDays": @0, @"minTransitTimeDays": @0 } } ],
@"productId": @{ @"productId": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/productdeliverytime"]
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}}/:merchantId/productdeliverytime" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/productdeliverytime",
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([
'areaDeliveryTimes' => [
[
'deliveryArea' => [
'countryCode' => '',
'postalCodeRange' => [
'firstPostalCode' => '',
'lastPostalCode' => ''
],
'regionCode' => ''
],
'deliveryTime' => [
'maxHandlingTimeDays' => 0,
'maxTransitTimeDays' => 0,
'minHandlingTimeDays' => 0,
'minTransitTimeDays' => 0
]
]
],
'productId' => [
'productId' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/productdeliverytime', [
'body' => '{
"areaDeliveryTimes": [
{
"deliveryArea": {
"countryCode": "",
"postalCodeRange": {
"firstPostalCode": "",
"lastPostalCode": ""
},
"regionCode": ""
},
"deliveryTime": {
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
}
}
],
"productId": {
"productId": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/productdeliverytime');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'areaDeliveryTimes' => [
[
'deliveryArea' => [
'countryCode' => '',
'postalCodeRange' => [
'firstPostalCode' => '',
'lastPostalCode' => ''
],
'regionCode' => ''
],
'deliveryTime' => [
'maxHandlingTimeDays' => 0,
'maxTransitTimeDays' => 0,
'minHandlingTimeDays' => 0,
'minTransitTimeDays' => 0
]
]
],
'productId' => [
'productId' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'areaDeliveryTimes' => [
[
'deliveryArea' => [
'countryCode' => '',
'postalCodeRange' => [
'firstPostalCode' => '',
'lastPostalCode' => ''
],
'regionCode' => ''
],
'deliveryTime' => [
'maxHandlingTimeDays' => 0,
'maxTransitTimeDays' => 0,
'minHandlingTimeDays' => 0,
'minTransitTimeDays' => 0
]
]
],
'productId' => [
'productId' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/productdeliverytime');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/productdeliverytime' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"areaDeliveryTimes": [
{
"deliveryArea": {
"countryCode": "",
"postalCodeRange": {
"firstPostalCode": "",
"lastPostalCode": ""
},
"regionCode": ""
},
"deliveryTime": {
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
}
}
],
"productId": {
"productId": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/productdeliverytime' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"areaDeliveryTimes": [
{
"deliveryArea": {
"countryCode": "",
"postalCodeRange": {
"firstPostalCode": "",
"lastPostalCode": ""
},
"regionCode": ""
},
"deliveryTime": {
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
}
}
],
"productId": {
"productId": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/productdeliverytime", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/productdeliverytime"
payload = {
"areaDeliveryTimes": [
{
"deliveryArea": {
"countryCode": "",
"postalCodeRange": {
"firstPostalCode": "",
"lastPostalCode": ""
},
"regionCode": ""
},
"deliveryTime": {
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
}
}
],
"productId": { "productId": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/productdeliverytime"
payload <- "{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/productdeliverytime")
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 \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\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.post('/baseUrl/:merchantId/productdeliverytime') do |req|
req.body = "{\n \"areaDeliveryTimes\": [\n {\n \"deliveryArea\": {\n \"countryCode\": \"\",\n \"postalCodeRange\": {\n \"firstPostalCode\": \"\",\n \"lastPostalCode\": \"\"\n },\n \"regionCode\": \"\"\n },\n \"deliveryTime\": {\n \"maxHandlingTimeDays\": 0,\n \"maxTransitTimeDays\": 0,\n \"minHandlingTimeDays\": 0,\n \"minTransitTimeDays\": 0\n }\n }\n ],\n \"productId\": {\n \"productId\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/productdeliverytime";
let payload = json!({
"areaDeliveryTimes": (
json!({
"deliveryArea": json!({
"countryCode": "",
"postalCodeRange": json!({
"firstPostalCode": "",
"lastPostalCode": ""
}),
"regionCode": ""
}),
"deliveryTime": json!({
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
})
})
),
"productId": json!({"productId": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/productdeliverytime \
--header 'content-type: application/json' \
--data '{
"areaDeliveryTimes": [
{
"deliveryArea": {
"countryCode": "",
"postalCodeRange": {
"firstPostalCode": "",
"lastPostalCode": ""
},
"regionCode": ""
},
"deliveryTime": {
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
}
}
],
"productId": {
"productId": ""
}
}'
echo '{
"areaDeliveryTimes": [
{
"deliveryArea": {
"countryCode": "",
"postalCodeRange": {
"firstPostalCode": "",
"lastPostalCode": ""
},
"regionCode": ""
},
"deliveryTime": {
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
}
}
],
"productId": {
"productId": ""
}
}' | \
http POST {{baseUrl}}/:merchantId/productdeliverytime \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "areaDeliveryTimes": [\n {\n "deliveryArea": {\n "countryCode": "",\n "postalCodeRange": {\n "firstPostalCode": "",\n "lastPostalCode": ""\n },\n "regionCode": ""\n },\n "deliveryTime": {\n "maxHandlingTimeDays": 0,\n "maxTransitTimeDays": 0,\n "minHandlingTimeDays": 0,\n "minTransitTimeDays": 0\n }\n }\n ],\n "productId": {\n "productId": ""\n }\n}' \
--output-document \
- {{baseUrl}}/:merchantId/productdeliverytime
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"areaDeliveryTimes": [
[
"deliveryArea": [
"countryCode": "",
"postalCodeRange": [
"firstPostalCode": "",
"lastPostalCode": ""
],
"regionCode": ""
],
"deliveryTime": [
"maxHandlingTimeDays": 0,
"maxTransitTimeDays": 0,
"minHandlingTimeDays": 0,
"minTransitTimeDays": 0
]
]
],
"productId": ["productId": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/productdeliverytime")! 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()
DELETE
content.productdeliverytime.delete
{{baseUrl}}/:merchantId/productdeliverytime/:productId
QUERY PARAMS
merchantId
productId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/productdeliverytime/:productId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/productdeliverytime/:productId")
require "http/client"
url = "{{baseUrl}}/:merchantId/productdeliverytime/:productId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/productdeliverytime/:productId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/productdeliverytime/:productId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/productdeliverytime/:productId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/productdeliverytime/:productId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/productdeliverytime/:productId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/productdeliverytime/:productId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/productdeliverytime/:productId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/productdeliverytime/:productId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/productdeliverytime/:productId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/productdeliverytime/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/productdeliverytime/:productId';
const options = {method: 'DELETE'};
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}}/:merchantId/productdeliverytime/:productId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/productdeliverytime/:productId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/productdeliverytime/:productId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/productdeliverytime/:productId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/productdeliverytime/:productId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/productdeliverytime/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/productdeliverytime/:productId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/productdeliverytime/:productId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/productdeliverytime/:productId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/productdeliverytime/:productId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/productdeliverytime/:productId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/productdeliverytime/:productId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/productdeliverytime/:productId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/productdeliverytime/:productId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/productdeliverytime/:productId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/productdeliverytime/:productId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/productdeliverytime/:productId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/productdeliverytime/:productId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/productdeliverytime/:productId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/productdeliverytime/:productId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/productdeliverytime/:productId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/productdeliverytime/:productId
http DELETE {{baseUrl}}/:merchantId/productdeliverytime/:productId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/productdeliverytime/:productId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/productdeliverytime/:productId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.productdeliverytime.get
{{baseUrl}}/:merchantId/productdeliverytime/:productId
QUERY PARAMS
merchantId
productId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/productdeliverytime/:productId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/productdeliverytime/:productId")
require "http/client"
url = "{{baseUrl}}/:merchantId/productdeliverytime/:productId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/productdeliverytime/:productId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/productdeliverytime/:productId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/productdeliverytime/:productId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/productdeliverytime/:productId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/productdeliverytime/:productId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/productdeliverytime/:productId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/productdeliverytime/:productId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/productdeliverytime/:productId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/productdeliverytime/:productId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productdeliverytime/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/productdeliverytime/:productId';
const options = {method: 'GET'};
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}}/:merchantId/productdeliverytime/:productId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/productdeliverytime/:productId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/productdeliverytime/:productId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productdeliverytime/:productId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/productdeliverytime/:productId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productdeliverytime/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/productdeliverytime/:productId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/productdeliverytime/:productId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/productdeliverytime/:productId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/productdeliverytime/:productId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/productdeliverytime/:productId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/productdeliverytime/:productId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/productdeliverytime/:productId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/productdeliverytime/:productId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/productdeliverytime/:productId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/productdeliverytime/:productId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/productdeliverytime/:productId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/productdeliverytime/:productId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/productdeliverytime/:productId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/productdeliverytime/:productId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/productdeliverytime/:productId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/productdeliverytime/:productId
http GET {{baseUrl}}/:merchantId/productdeliverytime/:productId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/productdeliverytime/:productId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/productdeliverytime/:productId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.products.custombatch
{{baseUrl}}/products/batch
BODY json
{
"entries": [
{
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
},
"productId": "",
"updateMask": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/products/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/products/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:feedId ""
:merchantId ""
:method ""
:product {:additionalImageLinks []
:additionalSizeType ""
:adsGrouping ""
:adsLabels []
:adsRedirect ""
:adult false
:ageGroup ""
:availability ""
:availabilityDate ""
:brand ""
:canonicalLink ""
:channel ""
:color ""
:condition ""
:contentLanguage ""
:costOfGoodsSold {:currency ""
:value ""}
:customAttributes [{:groupValues []
:name ""
:value ""}]
:customLabel0 ""
:customLabel1 ""
:customLabel2 ""
:customLabel3 ""
:customLabel4 ""
:description ""
:displayAdsId ""
:displayAdsLink ""
:displayAdsSimilarIds []
:displayAdsTitle ""
:displayAdsValue ""
:energyEfficiencyClass ""
:excludedDestinations []
:expirationDate ""
:externalSellerId ""
:feedLabel ""
:gender ""
:googleProductCategory ""
:gtin ""
:id ""
:identifierExists false
:imageLink ""
:includedDestinations []
:installment {:amount {}
:months ""}
:isBundle false
:itemGroupId ""
:kind ""
:lifestyleImageLinks []
:link ""
:linkTemplate ""
:loyaltyPoints {:name ""
:pointsValue ""
:ratio ""}
:material ""
:maxEnergyEfficiencyClass ""
:maxHandlingTime ""
:minEnergyEfficiencyClass ""
:minHandlingTime ""
:mobileLink ""
:mobileLinkTemplate ""
:mpn ""
:multipack ""
:offerId ""
:pattern ""
:pause ""
:pickupMethod ""
:pickupSla ""
:price {}
:productDetails [{:attributeName ""
:attributeValue ""
:sectionName ""}]
:productHeight {:unit ""
:value ""}
:productHighlights []
:productLength {}
:productTypes []
:productWeight {:unit ""
:value ""}
:productWidth {}
:promotionIds []
:salePrice {}
:salePriceEffectiveDate ""
:sellOnGoogleQuantity ""
:shipping [{:country ""
:locationGroupName ""
:locationId ""
:maxHandlingTime ""
:maxTransitTime ""
:minHandlingTime ""
:minTransitTime ""
:postalCode ""
:price {}
:region ""
:service ""}]
:shippingHeight {:unit ""
:value ""}
:shippingLabel ""
:shippingLength {}
:shippingWeight {:unit ""
:value ""}
:shippingWidth {}
:shoppingAdsExcludedCountries []
:sizeSystem ""
:sizeType ""
:sizes []
:source ""
:subscriptionCost {:amount {}
:period ""
:periodLength ""}
:targetCountry ""
:taxCategory ""
:taxes [{:country ""
:locationId ""
:postalCode ""
:rate ""
:region ""
:taxShip false}]
:title ""
:transitTimeLabel ""
:unitPricingBaseMeasure {:unit ""
:value ""}
:unitPricingMeasure {:unit ""
:value ""}}
:productId ""
:updateMask ""}]}})
require "http/client"
url = "{{baseUrl}}/products/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\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}}/products/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\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}}/products/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/products/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/products/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 4249
{
"entries": [
{
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
},
"productId": "",
"updateMask": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/products/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/products/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/products/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/products/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
feedId: '',
merchantId: '',
method: '',
product: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {
currency: '',
value: ''
},
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {
amount: {},
months: ''
},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {
name: '',
pointsValue: '',
ratio: ''
},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [
{
attributeName: '',
attributeValue: '',
sectionName: ''
}
],
productHeight: {
unit: '',
value: ''
},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {
unit: '',
value: ''
},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {
unit: '',
value: ''
},
shippingLabel: '',
shippingLength: {},
shippingWeight: {
unit: '',
value: ''
},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {
amount: {},
period: '',
periodLength: ''
},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {
unit: '',
value: ''
},
unitPricingMeasure: {
unit: '',
value: ''
}
},
productId: '',
updateMask: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/products/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/products/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
feedId: '',
merchantId: '',
method: '',
product: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
},
productId: '',
updateMask: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/products/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"feedId":"","merchantId":"","method":"","product":{"additionalImageLinks":[],"additionalSizeType":"","adsGrouping":"","adsLabels":[],"adsRedirect":"","adult":false,"ageGroup":"","availability":"","availabilityDate":"","brand":"","canonicalLink":"","channel":"","color":"","condition":"","contentLanguage":"","costOfGoodsSold":{"currency":"","value":""},"customAttributes":[{"groupValues":[],"name":"","value":""}],"customLabel0":"","customLabel1":"","customLabel2":"","customLabel3":"","customLabel4":"","description":"","displayAdsId":"","displayAdsLink":"","displayAdsSimilarIds":[],"displayAdsTitle":"","displayAdsValue":"","energyEfficiencyClass":"","excludedDestinations":[],"expirationDate":"","externalSellerId":"","feedLabel":"","gender":"","googleProductCategory":"","gtin":"","id":"","identifierExists":false,"imageLink":"","includedDestinations":[],"installment":{"amount":{},"months":""},"isBundle":false,"itemGroupId":"","kind":"","lifestyleImageLinks":[],"link":"","linkTemplate":"","loyaltyPoints":{"name":"","pointsValue":"","ratio":""},"material":"","maxEnergyEfficiencyClass":"","maxHandlingTime":"","minEnergyEfficiencyClass":"","minHandlingTime":"","mobileLink":"","mobileLinkTemplate":"","mpn":"","multipack":"","offerId":"","pattern":"","pause":"","pickupMethod":"","pickupSla":"","price":{},"productDetails":[{"attributeName":"","attributeValue":"","sectionName":""}],"productHeight":{"unit":"","value":""},"productHighlights":[],"productLength":{},"productTypes":[],"productWeight":{"unit":"","value":""},"productWidth":{},"promotionIds":[],"salePrice":{},"salePriceEffectiveDate":"","sellOnGoogleQuantity":"","shipping":[{"country":"","locationGroupName":"","locationId":"","maxHandlingTime":"","maxTransitTime":"","minHandlingTime":"","minTransitTime":"","postalCode":"","price":{},"region":"","service":""}],"shippingHeight":{"unit":"","value":""},"shippingLabel":"","shippingLength":{},"shippingWeight":{"unit":"","value":""},"shippingWidth":{},"shoppingAdsExcludedCountries":[],"sizeSystem":"","sizeType":"","sizes":[],"source":"","subscriptionCost":{"amount":{},"period":"","periodLength":""},"targetCountry":"","taxCategory":"","taxes":[{"country":"","locationId":"","postalCode":"","rate":"","region":"","taxShip":false}],"title":"","transitTimeLabel":"","unitPricingBaseMeasure":{"unit":"","value":""},"unitPricingMeasure":{"unit":"","value":""}},"productId":"","updateMask":""}]}'
};
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}}/products/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "feedId": "",\n "merchantId": "",\n "method": "",\n "product": {\n "additionalImageLinks": [],\n "additionalSizeType": "",\n "adsGrouping": "",\n "adsLabels": [],\n "adsRedirect": "",\n "adult": false,\n "ageGroup": "",\n "availability": "",\n "availabilityDate": "",\n "brand": "",\n "canonicalLink": "",\n "channel": "",\n "color": "",\n "condition": "",\n "contentLanguage": "",\n "costOfGoodsSold": {\n "currency": "",\n "value": ""\n },\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "customLabel0": "",\n "customLabel1": "",\n "customLabel2": "",\n "customLabel3": "",\n "customLabel4": "",\n "description": "",\n "displayAdsId": "",\n "displayAdsLink": "",\n "displayAdsSimilarIds": [],\n "displayAdsTitle": "",\n "displayAdsValue": "",\n "energyEfficiencyClass": "",\n "excludedDestinations": [],\n "expirationDate": "",\n "externalSellerId": "",\n "feedLabel": "",\n "gender": "",\n "googleProductCategory": "",\n "gtin": "",\n "id": "",\n "identifierExists": false,\n "imageLink": "",\n "includedDestinations": [],\n "installment": {\n "amount": {},\n "months": ""\n },\n "isBundle": false,\n "itemGroupId": "",\n "kind": "",\n "lifestyleImageLinks": [],\n "link": "",\n "linkTemplate": "",\n "loyaltyPoints": {\n "name": "",\n "pointsValue": "",\n "ratio": ""\n },\n "material": "",\n "maxEnergyEfficiencyClass": "",\n "maxHandlingTime": "",\n "minEnergyEfficiencyClass": "",\n "minHandlingTime": "",\n "mobileLink": "",\n "mobileLinkTemplate": "",\n "mpn": "",\n "multipack": "",\n "offerId": "",\n "pattern": "",\n "pause": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {},\n "productDetails": [\n {\n "attributeName": "",\n "attributeValue": "",\n "sectionName": ""\n }\n ],\n "productHeight": {\n "unit": "",\n "value": ""\n },\n "productHighlights": [],\n "productLength": {},\n "productTypes": [],\n "productWeight": {\n "unit": "",\n "value": ""\n },\n "productWidth": {},\n "promotionIds": [],\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "sellOnGoogleQuantity": "",\n "shipping": [\n {\n "country": "",\n "locationGroupName": "",\n "locationId": "",\n "maxHandlingTime": "",\n "maxTransitTime": "",\n "minHandlingTime": "",\n "minTransitTime": "",\n "postalCode": "",\n "price": {},\n "region": "",\n "service": ""\n }\n ],\n "shippingHeight": {\n "unit": "",\n "value": ""\n },\n "shippingLabel": "",\n "shippingLength": {},\n "shippingWeight": {\n "unit": "",\n "value": ""\n },\n "shippingWidth": {},\n "shoppingAdsExcludedCountries": [],\n "sizeSystem": "",\n "sizeType": "",\n "sizes": [],\n "source": "",\n "subscriptionCost": {\n "amount": {},\n "period": "",\n "periodLength": ""\n },\n "targetCountry": "",\n "taxCategory": "",\n "taxes": [\n {\n "country": "",\n "locationId": "",\n "postalCode": "",\n "rate": "",\n "region": "",\n "taxShip": false\n }\n ],\n "title": "",\n "transitTimeLabel": "",\n "unitPricingBaseMeasure": {\n "unit": "",\n "value": ""\n },\n "unitPricingMeasure": {\n "unit": "",\n "value": ""\n }\n },\n "productId": "",\n "updateMask": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/products/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/products/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
feedId: '',
merchantId: '',
method: '',
product: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
},
productId: '',
updateMask: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/products/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
feedId: '',
merchantId: '',
method: '',
product: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
},
productId: '',
updateMask: ''
}
]
},
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}}/products/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
feedId: '',
merchantId: '',
method: '',
product: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {
currency: '',
value: ''
},
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {
amount: {},
months: ''
},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {
name: '',
pointsValue: '',
ratio: ''
},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [
{
attributeName: '',
attributeValue: '',
sectionName: ''
}
],
productHeight: {
unit: '',
value: ''
},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {
unit: '',
value: ''
},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {
unit: '',
value: ''
},
shippingLabel: '',
shippingLength: {},
shippingWeight: {
unit: '',
value: ''
},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {
amount: {},
period: '',
periodLength: ''
},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {
unit: '',
value: ''
},
unitPricingMeasure: {
unit: '',
value: ''
}
},
productId: '',
updateMask: ''
}
]
});
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}}/products/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
feedId: '',
merchantId: '',
method: '',
product: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
},
productId: '',
updateMask: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/products/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"feedId":"","merchantId":"","method":"","product":{"additionalImageLinks":[],"additionalSizeType":"","adsGrouping":"","adsLabels":[],"adsRedirect":"","adult":false,"ageGroup":"","availability":"","availabilityDate":"","brand":"","canonicalLink":"","channel":"","color":"","condition":"","contentLanguage":"","costOfGoodsSold":{"currency":"","value":""},"customAttributes":[{"groupValues":[],"name":"","value":""}],"customLabel0":"","customLabel1":"","customLabel2":"","customLabel3":"","customLabel4":"","description":"","displayAdsId":"","displayAdsLink":"","displayAdsSimilarIds":[],"displayAdsTitle":"","displayAdsValue":"","energyEfficiencyClass":"","excludedDestinations":[],"expirationDate":"","externalSellerId":"","feedLabel":"","gender":"","googleProductCategory":"","gtin":"","id":"","identifierExists":false,"imageLink":"","includedDestinations":[],"installment":{"amount":{},"months":""},"isBundle":false,"itemGroupId":"","kind":"","lifestyleImageLinks":[],"link":"","linkTemplate":"","loyaltyPoints":{"name":"","pointsValue":"","ratio":""},"material":"","maxEnergyEfficiencyClass":"","maxHandlingTime":"","minEnergyEfficiencyClass":"","minHandlingTime":"","mobileLink":"","mobileLinkTemplate":"","mpn":"","multipack":"","offerId":"","pattern":"","pause":"","pickupMethod":"","pickupSla":"","price":{},"productDetails":[{"attributeName":"","attributeValue":"","sectionName":""}],"productHeight":{"unit":"","value":""},"productHighlights":[],"productLength":{},"productTypes":[],"productWeight":{"unit":"","value":""},"productWidth":{},"promotionIds":[],"salePrice":{},"salePriceEffectiveDate":"","sellOnGoogleQuantity":"","shipping":[{"country":"","locationGroupName":"","locationId":"","maxHandlingTime":"","maxTransitTime":"","minHandlingTime":"","minTransitTime":"","postalCode":"","price":{},"region":"","service":""}],"shippingHeight":{"unit":"","value":""},"shippingLabel":"","shippingLength":{},"shippingWeight":{"unit":"","value":""},"shippingWidth":{},"shoppingAdsExcludedCountries":[],"sizeSystem":"","sizeType":"","sizes":[],"source":"","subscriptionCost":{"amount":{},"period":"","periodLength":""},"targetCountry":"","taxCategory":"","taxes":[{"country":"","locationId":"","postalCode":"","rate":"","region":"","taxShip":false}],"title":"","transitTimeLabel":"","unitPricingBaseMeasure":{"unit":"","value":""},"unitPricingMeasure":{"unit":"","value":""}},"productId":"","updateMask":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"feedId": @"", @"merchantId": @"", @"method": @"", @"product": @{ @"additionalImageLinks": @[ ], @"additionalSizeType": @"", @"adsGrouping": @"", @"adsLabels": @[ ], @"adsRedirect": @"", @"adult": @NO, @"ageGroup": @"", @"availability": @"", @"availabilityDate": @"", @"brand": @"", @"canonicalLink": @"", @"channel": @"", @"color": @"", @"condition": @"", @"contentLanguage": @"", @"costOfGoodsSold": @{ @"currency": @"", @"value": @"" }, @"customAttributes": @[ @{ @"groupValues": @[ ], @"name": @"", @"value": @"" } ], @"customLabel0": @"", @"customLabel1": @"", @"customLabel2": @"", @"customLabel3": @"", @"customLabel4": @"", @"description": @"", @"displayAdsId": @"", @"displayAdsLink": @"", @"displayAdsSimilarIds": @[ ], @"displayAdsTitle": @"", @"displayAdsValue": @"", @"energyEfficiencyClass": @"", @"excludedDestinations": @[ ], @"expirationDate": @"", @"externalSellerId": @"", @"feedLabel": @"", @"gender": @"", @"googleProductCategory": @"", @"gtin": @"", @"id": @"", @"identifierExists": @NO, @"imageLink": @"", @"includedDestinations": @[ ], @"installment": @{ @"amount": @{ }, @"months": @"" }, @"isBundle": @NO, @"itemGroupId": @"", @"kind": @"", @"lifestyleImageLinks": @[ ], @"link": @"", @"linkTemplate": @"", @"loyaltyPoints": @{ @"name": @"", @"pointsValue": @"", @"ratio": @"" }, @"material": @"", @"maxEnergyEfficiencyClass": @"", @"maxHandlingTime": @"", @"minEnergyEfficiencyClass": @"", @"minHandlingTime": @"", @"mobileLink": @"", @"mobileLinkTemplate": @"", @"mpn": @"", @"multipack": @"", @"offerId": @"", @"pattern": @"", @"pause": @"", @"pickupMethod": @"", @"pickupSla": @"", @"price": @{ }, @"productDetails": @[ @{ @"attributeName": @"", @"attributeValue": @"", @"sectionName": @"" } ], @"productHeight": @{ @"unit": @"", @"value": @"" }, @"productHighlights": @[ ], @"productLength": @{ }, @"productTypes": @[ ], @"productWeight": @{ @"unit": @"", @"value": @"" }, @"productWidth": @{ }, @"promotionIds": @[ ], @"salePrice": @{ }, @"salePriceEffectiveDate": @"", @"sellOnGoogleQuantity": @"", @"shipping": @[ @{ @"country": @"", @"locationGroupName": @"", @"locationId": @"", @"maxHandlingTime": @"", @"maxTransitTime": @"", @"minHandlingTime": @"", @"minTransitTime": @"", @"postalCode": @"", @"price": @{ }, @"region": @"", @"service": @"" } ], @"shippingHeight": @{ @"unit": @"", @"value": @"" }, @"shippingLabel": @"", @"shippingLength": @{ }, @"shippingWeight": @{ @"unit": @"", @"value": @"" }, @"shippingWidth": @{ }, @"shoppingAdsExcludedCountries": @[ ], @"sizeSystem": @"", @"sizeType": @"", @"sizes": @[ ], @"source": @"", @"subscriptionCost": @{ @"amount": @{ }, @"period": @"", @"periodLength": @"" }, @"targetCountry": @"", @"taxCategory": @"", @"taxes": @[ @{ @"country": @"", @"locationId": @"", @"postalCode": @"", @"rate": @"", @"region": @"", @"taxShip": @NO } ], @"title": @"", @"transitTimeLabel": @"", @"unitPricingBaseMeasure": @{ @"unit": @"", @"value": @"" }, @"unitPricingMeasure": @{ @"unit": @"", @"value": @"" } }, @"productId": @"", @"updateMask": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/products/batch"]
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}}/products/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/products/batch",
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([
'entries' => [
[
'batchId' => 0,
'feedId' => '',
'merchantId' => '',
'method' => '',
'product' => [
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
],
'productId' => '',
'updateMask' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/products/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
},
"productId": "",
"updateMask": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/products/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'feedId' => '',
'merchantId' => '',
'method' => '',
'product' => [
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
],
'productId' => '',
'updateMask' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'feedId' => '',
'merchantId' => '',
'method' => '',
'product' => [
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
],
'productId' => '',
'updateMask' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/products/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/products/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
},
"productId": "",
"updateMask": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/products/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
},
"productId": "",
"updateMask": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/products/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/products/batch"
payload = { "entries": [
{
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": False,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": False,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": False,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": False
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
},
"productId": "",
"updateMask": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/products/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/products/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\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.post('/baseUrl/products/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"feedId\": \"\",\n \"merchantId\": \"\",\n \"method\": \"\",\n \"product\": {\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n },\n \"productId\": \"\",\n \"updateMask\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/products/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": json!({
"additionalImageLinks": (),
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": (),
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": json!({
"currency": "",
"value": ""
}),
"customAttributes": (
json!({
"groupValues": (),
"name": "",
"value": ""
})
),
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": (),
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": (),
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": (),
"installment": json!({
"amount": json!({}),
"months": ""
}),
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": (),
"link": "",
"linkTemplate": "",
"loyaltyPoints": json!({
"name": "",
"pointsValue": "",
"ratio": ""
}),
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": json!({}),
"productDetails": (
json!({
"attributeName": "",
"attributeValue": "",
"sectionName": ""
})
),
"productHeight": json!({
"unit": "",
"value": ""
}),
"productHighlights": (),
"productLength": json!({}),
"productTypes": (),
"productWeight": json!({
"unit": "",
"value": ""
}),
"productWidth": json!({}),
"promotionIds": (),
"salePrice": json!({}),
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": (
json!({
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": json!({}),
"region": "",
"service": ""
})
),
"shippingHeight": json!({
"unit": "",
"value": ""
}),
"shippingLabel": "",
"shippingLength": json!({}),
"shippingWeight": json!({
"unit": "",
"value": ""
}),
"shippingWidth": json!({}),
"shoppingAdsExcludedCountries": (),
"sizeSystem": "",
"sizeType": "",
"sizes": (),
"source": "",
"subscriptionCost": json!({
"amount": json!({}),
"period": "",
"periodLength": ""
}),
"targetCountry": "",
"taxCategory": "",
"taxes": (
json!({
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
})
),
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": json!({
"unit": "",
"value": ""
}),
"unitPricingMeasure": json!({
"unit": "",
"value": ""
})
}),
"productId": "",
"updateMask": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/products/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
},
"productId": "",
"updateMask": ""
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
},
"productId": "",
"updateMask": ""
}
]
}' | \
http POST {{baseUrl}}/products/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "feedId": "",\n "merchantId": "",\n "method": "",\n "product": {\n "additionalImageLinks": [],\n "additionalSizeType": "",\n "adsGrouping": "",\n "adsLabels": [],\n "adsRedirect": "",\n "adult": false,\n "ageGroup": "",\n "availability": "",\n "availabilityDate": "",\n "brand": "",\n "canonicalLink": "",\n "channel": "",\n "color": "",\n "condition": "",\n "contentLanguage": "",\n "costOfGoodsSold": {\n "currency": "",\n "value": ""\n },\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "customLabel0": "",\n "customLabel1": "",\n "customLabel2": "",\n "customLabel3": "",\n "customLabel4": "",\n "description": "",\n "displayAdsId": "",\n "displayAdsLink": "",\n "displayAdsSimilarIds": [],\n "displayAdsTitle": "",\n "displayAdsValue": "",\n "energyEfficiencyClass": "",\n "excludedDestinations": [],\n "expirationDate": "",\n "externalSellerId": "",\n "feedLabel": "",\n "gender": "",\n "googleProductCategory": "",\n "gtin": "",\n "id": "",\n "identifierExists": false,\n "imageLink": "",\n "includedDestinations": [],\n "installment": {\n "amount": {},\n "months": ""\n },\n "isBundle": false,\n "itemGroupId": "",\n "kind": "",\n "lifestyleImageLinks": [],\n "link": "",\n "linkTemplate": "",\n "loyaltyPoints": {\n "name": "",\n "pointsValue": "",\n "ratio": ""\n },\n "material": "",\n "maxEnergyEfficiencyClass": "",\n "maxHandlingTime": "",\n "minEnergyEfficiencyClass": "",\n "minHandlingTime": "",\n "mobileLink": "",\n "mobileLinkTemplate": "",\n "mpn": "",\n "multipack": "",\n "offerId": "",\n "pattern": "",\n "pause": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {},\n "productDetails": [\n {\n "attributeName": "",\n "attributeValue": "",\n "sectionName": ""\n }\n ],\n "productHeight": {\n "unit": "",\n "value": ""\n },\n "productHighlights": [],\n "productLength": {},\n "productTypes": [],\n "productWeight": {\n "unit": "",\n "value": ""\n },\n "productWidth": {},\n "promotionIds": [],\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "sellOnGoogleQuantity": "",\n "shipping": [\n {\n "country": "",\n "locationGroupName": "",\n "locationId": "",\n "maxHandlingTime": "",\n "maxTransitTime": "",\n "minHandlingTime": "",\n "minTransitTime": "",\n "postalCode": "",\n "price": {},\n "region": "",\n "service": ""\n }\n ],\n "shippingHeight": {\n "unit": "",\n "value": ""\n },\n "shippingLabel": "",\n "shippingLength": {},\n "shippingWeight": {\n "unit": "",\n "value": ""\n },\n "shippingWidth": {},\n "shoppingAdsExcludedCountries": [],\n "sizeSystem": "",\n "sizeType": "",\n "sizes": [],\n "source": "",\n "subscriptionCost": {\n "amount": {},\n "period": "",\n "periodLength": ""\n },\n "targetCountry": "",\n "taxCategory": "",\n "taxes": [\n {\n "country": "",\n "locationId": "",\n "postalCode": "",\n "rate": "",\n "region": "",\n "taxShip": false\n }\n ],\n "title": "",\n "transitTimeLabel": "",\n "unitPricingBaseMeasure": {\n "unit": "",\n "value": ""\n },\n "unitPricingMeasure": {\n "unit": "",\n "value": ""\n }\n },\n "productId": "",\n "updateMask": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/products/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"feedId": "",
"merchantId": "",
"method": "",
"product": [
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": [
"currency": "",
"value": ""
],
"customAttributes": [
[
"groupValues": [],
"name": "",
"value": ""
]
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": [
"amount": [],
"months": ""
],
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": [
"name": "",
"pointsValue": "",
"ratio": ""
],
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": [],
"productDetails": [
[
"attributeName": "",
"attributeValue": "",
"sectionName": ""
]
],
"productHeight": [
"unit": "",
"value": ""
],
"productHighlights": [],
"productLength": [],
"productTypes": [],
"productWeight": [
"unit": "",
"value": ""
],
"productWidth": [],
"promotionIds": [],
"salePrice": [],
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
[
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": [],
"region": "",
"service": ""
]
],
"shippingHeight": [
"unit": "",
"value": ""
],
"shippingLabel": "",
"shippingLength": [],
"shippingWeight": [
"unit": "",
"value": ""
],
"shippingWidth": [],
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": [
"amount": [],
"period": "",
"periodLength": ""
],
"targetCountry": "",
"taxCategory": "",
"taxes": [
[
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
]
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": [
"unit": "",
"value": ""
],
"unitPricingMeasure": [
"unit": "",
"value": ""
]
],
"productId": "",
"updateMask": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/products/batch")! 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()
DELETE
content.products.delete
{{baseUrl}}/:merchantId/products/:productId
QUERY PARAMS
merchantId
productId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/products/:productId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/products/:productId")
require "http/client"
url = "{{baseUrl}}/:merchantId/products/:productId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/products/:productId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/products/:productId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/products/:productId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/products/:productId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/products/:productId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/products/:productId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/products/:productId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/products/:productId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/products/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/products/:productId';
const options = {method: 'DELETE'};
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}}/:merchantId/products/:productId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/products/:productId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/products/:productId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/products/:productId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/products/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/products/:productId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/products/:productId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/products/:productId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/products/:productId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/products/:productId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/products/:productId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/products/:productId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/products/:productId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/products/:productId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/products/:productId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/products/:productId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/products/:productId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/products/:productId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/products/:productId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/products/:productId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/products/:productId
http DELETE {{baseUrl}}/:merchantId/products/:productId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/products/:productId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/products/:productId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.products.get
{{baseUrl}}/:merchantId/products/:productId
QUERY PARAMS
merchantId
productId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/products/:productId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/products/:productId")
require "http/client"
url = "{{baseUrl}}/:merchantId/products/:productId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/products/:productId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/products/:productId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/products/:productId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/products/:productId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/products/:productId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/products/:productId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/products/:productId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/products/:productId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/products/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/products/:productId';
const options = {method: 'GET'};
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}}/:merchantId/products/:productId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/products/:productId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/products/:productId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/products/:productId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/products/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/products/:productId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/products/:productId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/products/:productId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/products/:productId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/products/:productId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/products/:productId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/products/:productId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/products/:productId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/products/:productId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/products/:productId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/products/:productId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/products/:productId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/products/:productId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/products/:productId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/products/:productId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/products/:productId
http GET {{baseUrl}}/:merchantId/products/:productId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/products/:productId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/products/:productId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.products.insert
{{baseUrl}}/:merchantId/products
QUERY PARAMS
merchantId
BODY json
{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/products");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/products" {:content-type :json
:form-params {:additionalImageLinks []
:additionalSizeType ""
:adsGrouping ""
:adsLabels []
:adsRedirect ""
:adult false
:ageGroup ""
:availability ""
:availabilityDate ""
:brand ""
:canonicalLink ""
:channel ""
:color ""
:condition ""
:contentLanguage ""
:costOfGoodsSold {:currency ""
:value ""}
:customAttributes [{:groupValues []
:name ""
:value ""}]
:customLabel0 ""
:customLabel1 ""
:customLabel2 ""
:customLabel3 ""
:customLabel4 ""
:description ""
:displayAdsId ""
:displayAdsLink ""
:displayAdsSimilarIds []
:displayAdsTitle ""
:displayAdsValue ""
:energyEfficiencyClass ""
:excludedDestinations []
:expirationDate ""
:externalSellerId ""
:feedLabel ""
:gender ""
:googleProductCategory ""
:gtin ""
:id ""
:identifierExists false
:imageLink ""
:includedDestinations []
:installment {:amount {}
:months ""}
:isBundle false
:itemGroupId ""
:kind ""
:lifestyleImageLinks []
:link ""
:linkTemplate ""
:loyaltyPoints {:name ""
:pointsValue ""
:ratio ""}
:material ""
:maxEnergyEfficiencyClass ""
:maxHandlingTime ""
:minEnergyEfficiencyClass ""
:minHandlingTime ""
:mobileLink ""
:mobileLinkTemplate ""
:mpn ""
:multipack ""
:offerId ""
:pattern ""
:pause ""
:pickupMethod ""
:pickupSla ""
:price {}
:productDetails [{:attributeName ""
:attributeValue ""
:sectionName ""}]
:productHeight {:unit ""
:value ""}
:productHighlights []
:productLength {}
:productTypes []
:productWeight {:unit ""
:value ""}
:productWidth {}
:promotionIds []
:salePrice {}
:salePriceEffectiveDate ""
:sellOnGoogleQuantity ""
:shipping [{:country ""
:locationGroupName ""
:locationId ""
:maxHandlingTime ""
:maxTransitTime ""
:minHandlingTime ""
:minTransitTime ""
:postalCode ""
:price {}
:region ""
:service ""}]
:shippingHeight {:unit ""
:value ""}
:shippingLabel ""
:shippingLength {}
:shippingWeight {:unit ""
:value ""}
:shippingWidth {}
:shoppingAdsExcludedCountries []
:sizeSystem ""
:sizeType ""
:sizes []
:source ""
:subscriptionCost {:amount {}
:period ""
:periodLength ""}
:targetCountry ""
:taxCategory ""
:taxes [{:country ""
:locationId ""
:postalCode ""
:rate ""
:region ""
:taxShip false}]
:title ""
:transitTimeLabel ""
:unitPricingBaseMeasure {:unit ""
:value ""}
:unitPricingMeasure {:unit ""
:value ""}}})
require "http/client"
url = "{{baseUrl}}/:merchantId/products"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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}}/:merchantId/products"),
Content = new StringContent("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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}}/:merchantId/products");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/products"
payload := strings.NewReader("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/products HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 3100
{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/products")
.setHeader("content-type", "application/json")
.setBody("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/products"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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 \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/products")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/products")
.header("content-type", "application/json")
.body("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {
currency: '',
value: ''
},
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {
amount: {},
months: ''
},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {
name: '',
pointsValue: '',
ratio: ''
},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [
{
attributeName: '',
attributeValue: '',
sectionName: ''
}
],
productHeight: {
unit: '',
value: ''
},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {
unit: '',
value: ''
},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {
unit: '',
value: ''
},
shippingLabel: '',
shippingLength: {},
shippingWeight: {
unit: '',
value: ''
},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {
amount: {},
period: '',
periodLength: ''
},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {
unit: '',
value: ''
},
unitPricingMeasure: {
unit: '',
value: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/products');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/products',
headers: {'content-type': 'application/json'},
data: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/products';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"additionalImageLinks":[],"additionalSizeType":"","adsGrouping":"","adsLabels":[],"adsRedirect":"","adult":false,"ageGroup":"","availability":"","availabilityDate":"","brand":"","canonicalLink":"","channel":"","color":"","condition":"","contentLanguage":"","costOfGoodsSold":{"currency":"","value":""},"customAttributes":[{"groupValues":[],"name":"","value":""}],"customLabel0":"","customLabel1":"","customLabel2":"","customLabel3":"","customLabel4":"","description":"","displayAdsId":"","displayAdsLink":"","displayAdsSimilarIds":[],"displayAdsTitle":"","displayAdsValue":"","energyEfficiencyClass":"","excludedDestinations":[],"expirationDate":"","externalSellerId":"","feedLabel":"","gender":"","googleProductCategory":"","gtin":"","id":"","identifierExists":false,"imageLink":"","includedDestinations":[],"installment":{"amount":{},"months":""},"isBundle":false,"itemGroupId":"","kind":"","lifestyleImageLinks":[],"link":"","linkTemplate":"","loyaltyPoints":{"name":"","pointsValue":"","ratio":""},"material":"","maxEnergyEfficiencyClass":"","maxHandlingTime":"","minEnergyEfficiencyClass":"","minHandlingTime":"","mobileLink":"","mobileLinkTemplate":"","mpn":"","multipack":"","offerId":"","pattern":"","pause":"","pickupMethod":"","pickupSla":"","price":{},"productDetails":[{"attributeName":"","attributeValue":"","sectionName":""}],"productHeight":{"unit":"","value":""},"productHighlights":[],"productLength":{},"productTypes":[],"productWeight":{"unit":"","value":""},"productWidth":{},"promotionIds":[],"salePrice":{},"salePriceEffectiveDate":"","sellOnGoogleQuantity":"","shipping":[{"country":"","locationGroupName":"","locationId":"","maxHandlingTime":"","maxTransitTime":"","minHandlingTime":"","minTransitTime":"","postalCode":"","price":{},"region":"","service":""}],"shippingHeight":{"unit":"","value":""},"shippingLabel":"","shippingLength":{},"shippingWeight":{"unit":"","value":""},"shippingWidth":{},"shoppingAdsExcludedCountries":[],"sizeSystem":"","sizeType":"","sizes":[],"source":"","subscriptionCost":{"amount":{},"period":"","periodLength":""},"targetCountry":"","taxCategory":"","taxes":[{"country":"","locationId":"","postalCode":"","rate":"","region":"","taxShip":false}],"title":"","transitTimeLabel":"","unitPricingBaseMeasure":{"unit":"","value":""},"unitPricingMeasure":{"unit":"","value":""}}'
};
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}}/:merchantId/products',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "additionalImageLinks": [],\n "additionalSizeType": "",\n "adsGrouping": "",\n "adsLabels": [],\n "adsRedirect": "",\n "adult": false,\n "ageGroup": "",\n "availability": "",\n "availabilityDate": "",\n "brand": "",\n "canonicalLink": "",\n "channel": "",\n "color": "",\n "condition": "",\n "contentLanguage": "",\n "costOfGoodsSold": {\n "currency": "",\n "value": ""\n },\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "customLabel0": "",\n "customLabel1": "",\n "customLabel2": "",\n "customLabel3": "",\n "customLabel4": "",\n "description": "",\n "displayAdsId": "",\n "displayAdsLink": "",\n "displayAdsSimilarIds": [],\n "displayAdsTitle": "",\n "displayAdsValue": "",\n "energyEfficiencyClass": "",\n "excludedDestinations": [],\n "expirationDate": "",\n "externalSellerId": "",\n "feedLabel": "",\n "gender": "",\n "googleProductCategory": "",\n "gtin": "",\n "id": "",\n "identifierExists": false,\n "imageLink": "",\n "includedDestinations": [],\n "installment": {\n "amount": {},\n "months": ""\n },\n "isBundle": false,\n "itemGroupId": "",\n "kind": "",\n "lifestyleImageLinks": [],\n "link": "",\n "linkTemplate": "",\n "loyaltyPoints": {\n "name": "",\n "pointsValue": "",\n "ratio": ""\n },\n "material": "",\n "maxEnergyEfficiencyClass": "",\n "maxHandlingTime": "",\n "minEnergyEfficiencyClass": "",\n "minHandlingTime": "",\n "mobileLink": "",\n "mobileLinkTemplate": "",\n "mpn": "",\n "multipack": "",\n "offerId": "",\n "pattern": "",\n "pause": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {},\n "productDetails": [\n {\n "attributeName": "",\n "attributeValue": "",\n "sectionName": ""\n }\n ],\n "productHeight": {\n "unit": "",\n "value": ""\n },\n "productHighlights": [],\n "productLength": {},\n "productTypes": [],\n "productWeight": {\n "unit": "",\n "value": ""\n },\n "productWidth": {},\n "promotionIds": [],\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "sellOnGoogleQuantity": "",\n "shipping": [\n {\n "country": "",\n "locationGroupName": "",\n "locationId": "",\n "maxHandlingTime": "",\n "maxTransitTime": "",\n "minHandlingTime": "",\n "minTransitTime": "",\n "postalCode": "",\n "price": {},\n "region": "",\n "service": ""\n }\n ],\n "shippingHeight": {\n "unit": "",\n "value": ""\n },\n "shippingLabel": "",\n "shippingLength": {},\n "shippingWeight": {\n "unit": "",\n "value": ""\n },\n "shippingWidth": {},\n "shoppingAdsExcludedCountries": [],\n "sizeSystem": "",\n "sizeType": "",\n "sizes": [],\n "source": "",\n "subscriptionCost": {\n "amount": {},\n "period": "",\n "periodLength": ""\n },\n "targetCountry": "",\n "taxCategory": "",\n "taxes": [\n {\n "country": "",\n "locationId": "",\n "postalCode": "",\n "rate": "",\n "region": "",\n "taxShip": false\n }\n ],\n "title": "",\n "transitTimeLabel": "",\n "unitPricingBaseMeasure": {\n "unit": "",\n "value": ""\n },\n "unitPricingMeasure": {\n "unit": "",\n "value": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/products")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/products',
headers: {
'content-type': 'application/json'
}
};
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({
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/products',
headers: {'content-type': 'application/json'},
body: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
},
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}}/:merchantId/products');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {
currency: '',
value: ''
},
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {
amount: {},
months: ''
},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {
name: '',
pointsValue: '',
ratio: ''
},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [
{
attributeName: '',
attributeValue: '',
sectionName: ''
}
],
productHeight: {
unit: '',
value: ''
},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {
unit: '',
value: ''
},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {
unit: '',
value: ''
},
shippingLabel: '',
shippingLength: {},
shippingWeight: {
unit: '',
value: ''
},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {
amount: {},
period: '',
periodLength: ''
},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {
unit: '',
value: ''
},
unitPricingMeasure: {
unit: '',
value: ''
}
});
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}}/:merchantId/products',
headers: {'content-type': 'application/json'},
data: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/products';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"additionalImageLinks":[],"additionalSizeType":"","adsGrouping":"","adsLabels":[],"adsRedirect":"","adult":false,"ageGroup":"","availability":"","availabilityDate":"","brand":"","canonicalLink":"","channel":"","color":"","condition":"","contentLanguage":"","costOfGoodsSold":{"currency":"","value":""},"customAttributes":[{"groupValues":[],"name":"","value":""}],"customLabel0":"","customLabel1":"","customLabel2":"","customLabel3":"","customLabel4":"","description":"","displayAdsId":"","displayAdsLink":"","displayAdsSimilarIds":[],"displayAdsTitle":"","displayAdsValue":"","energyEfficiencyClass":"","excludedDestinations":[],"expirationDate":"","externalSellerId":"","feedLabel":"","gender":"","googleProductCategory":"","gtin":"","id":"","identifierExists":false,"imageLink":"","includedDestinations":[],"installment":{"amount":{},"months":""},"isBundle":false,"itemGroupId":"","kind":"","lifestyleImageLinks":[],"link":"","linkTemplate":"","loyaltyPoints":{"name":"","pointsValue":"","ratio":""},"material":"","maxEnergyEfficiencyClass":"","maxHandlingTime":"","minEnergyEfficiencyClass":"","minHandlingTime":"","mobileLink":"","mobileLinkTemplate":"","mpn":"","multipack":"","offerId":"","pattern":"","pause":"","pickupMethod":"","pickupSla":"","price":{},"productDetails":[{"attributeName":"","attributeValue":"","sectionName":""}],"productHeight":{"unit":"","value":""},"productHighlights":[],"productLength":{},"productTypes":[],"productWeight":{"unit":"","value":""},"productWidth":{},"promotionIds":[],"salePrice":{},"salePriceEffectiveDate":"","sellOnGoogleQuantity":"","shipping":[{"country":"","locationGroupName":"","locationId":"","maxHandlingTime":"","maxTransitTime":"","minHandlingTime":"","minTransitTime":"","postalCode":"","price":{},"region":"","service":""}],"shippingHeight":{"unit":"","value":""},"shippingLabel":"","shippingLength":{},"shippingWeight":{"unit":"","value":""},"shippingWidth":{},"shoppingAdsExcludedCountries":[],"sizeSystem":"","sizeType":"","sizes":[],"source":"","subscriptionCost":{"amount":{},"period":"","periodLength":""},"targetCountry":"","taxCategory":"","taxes":[{"country":"","locationId":"","postalCode":"","rate":"","region":"","taxShip":false}],"title":"","transitTimeLabel":"","unitPricingBaseMeasure":{"unit":"","value":""},"unitPricingMeasure":{"unit":"","value":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"additionalImageLinks": @[ ],
@"additionalSizeType": @"",
@"adsGrouping": @"",
@"adsLabels": @[ ],
@"adsRedirect": @"",
@"adult": @NO,
@"ageGroup": @"",
@"availability": @"",
@"availabilityDate": @"",
@"brand": @"",
@"canonicalLink": @"",
@"channel": @"",
@"color": @"",
@"condition": @"",
@"contentLanguage": @"",
@"costOfGoodsSold": @{ @"currency": @"", @"value": @"" },
@"customAttributes": @[ @{ @"groupValues": @[ ], @"name": @"", @"value": @"" } ],
@"customLabel0": @"",
@"customLabel1": @"",
@"customLabel2": @"",
@"customLabel3": @"",
@"customLabel4": @"",
@"description": @"",
@"displayAdsId": @"",
@"displayAdsLink": @"",
@"displayAdsSimilarIds": @[ ],
@"displayAdsTitle": @"",
@"displayAdsValue": @"",
@"energyEfficiencyClass": @"",
@"excludedDestinations": @[ ],
@"expirationDate": @"",
@"externalSellerId": @"",
@"feedLabel": @"",
@"gender": @"",
@"googleProductCategory": @"",
@"gtin": @"",
@"id": @"",
@"identifierExists": @NO,
@"imageLink": @"",
@"includedDestinations": @[ ],
@"installment": @{ @"amount": @{ }, @"months": @"" },
@"isBundle": @NO,
@"itemGroupId": @"",
@"kind": @"",
@"lifestyleImageLinks": @[ ],
@"link": @"",
@"linkTemplate": @"",
@"loyaltyPoints": @{ @"name": @"", @"pointsValue": @"", @"ratio": @"" },
@"material": @"",
@"maxEnergyEfficiencyClass": @"",
@"maxHandlingTime": @"",
@"minEnergyEfficiencyClass": @"",
@"minHandlingTime": @"",
@"mobileLink": @"",
@"mobileLinkTemplate": @"",
@"mpn": @"",
@"multipack": @"",
@"offerId": @"",
@"pattern": @"",
@"pause": @"",
@"pickupMethod": @"",
@"pickupSla": @"",
@"price": @{ },
@"productDetails": @[ @{ @"attributeName": @"", @"attributeValue": @"", @"sectionName": @"" } ],
@"productHeight": @{ @"unit": @"", @"value": @"" },
@"productHighlights": @[ ],
@"productLength": @{ },
@"productTypes": @[ ],
@"productWeight": @{ @"unit": @"", @"value": @"" },
@"productWidth": @{ },
@"promotionIds": @[ ],
@"salePrice": @{ },
@"salePriceEffectiveDate": @"",
@"sellOnGoogleQuantity": @"",
@"shipping": @[ @{ @"country": @"", @"locationGroupName": @"", @"locationId": @"", @"maxHandlingTime": @"", @"maxTransitTime": @"", @"minHandlingTime": @"", @"minTransitTime": @"", @"postalCode": @"", @"price": @{ }, @"region": @"", @"service": @"" } ],
@"shippingHeight": @{ @"unit": @"", @"value": @"" },
@"shippingLabel": @"",
@"shippingLength": @{ },
@"shippingWeight": @{ @"unit": @"", @"value": @"" },
@"shippingWidth": @{ },
@"shoppingAdsExcludedCountries": @[ ],
@"sizeSystem": @"",
@"sizeType": @"",
@"sizes": @[ ],
@"source": @"",
@"subscriptionCost": @{ @"amount": @{ }, @"period": @"", @"periodLength": @"" },
@"targetCountry": @"",
@"taxCategory": @"",
@"taxes": @[ @{ @"country": @"", @"locationId": @"", @"postalCode": @"", @"rate": @"", @"region": @"", @"taxShip": @NO } ],
@"title": @"",
@"transitTimeLabel": @"",
@"unitPricingBaseMeasure": @{ @"unit": @"", @"value": @"" },
@"unitPricingMeasure": @{ @"unit": @"", @"value": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/products"]
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}}/:merchantId/products" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/products",
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([
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/products', [
'body' => '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/products');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/products');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/products' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/products' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/products", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/products"
payload = {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": False,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": False,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": False,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": False
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/products"
payload <- "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/products")
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 \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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.post('/baseUrl/:merchantId/products') do |req|
req.body = "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/products";
let payload = json!({
"additionalImageLinks": (),
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": (),
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": json!({
"currency": "",
"value": ""
}),
"customAttributes": (
json!({
"groupValues": (),
"name": "",
"value": ""
})
),
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": (),
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": (),
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": (),
"installment": json!({
"amount": json!({}),
"months": ""
}),
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": (),
"link": "",
"linkTemplate": "",
"loyaltyPoints": json!({
"name": "",
"pointsValue": "",
"ratio": ""
}),
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": json!({}),
"productDetails": (
json!({
"attributeName": "",
"attributeValue": "",
"sectionName": ""
})
),
"productHeight": json!({
"unit": "",
"value": ""
}),
"productHighlights": (),
"productLength": json!({}),
"productTypes": (),
"productWeight": json!({
"unit": "",
"value": ""
}),
"productWidth": json!({}),
"promotionIds": (),
"salePrice": json!({}),
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": (
json!({
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": json!({}),
"region": "",
"service": ""
})
),
"shippingHeight": json!({
"unit": "",
"value": ""
}),
"shippingLabel": "",
"shippingLength": json!({}),
"shippingWeight": json!({
"unit": "",
"value": ""
}),
"shippingWidth": json!({}),
"shoppingAdsExcludedCountries": (),
"sizeSystem": "",
"sizeType": "",
"sizes": (),
"source": "",
"subscriptionCost": json!({
"amount": json!({}),
"period": "",
"periodLength": ""
}),
"targetCountry": "",
"taxCategory": "",
"taxes": (
json!({
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
})
),
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": json!({
"unit": "",
"value": ""
}),
"unitPricingMeasure": json!({
"unit": "",
"value": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/products \
--header 'content-type: application/json' \
--data '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}'
echo '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}' | \
http POST {{baseUrl}}/:merchantId/products \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "additionalImageLinks": [],\n "additionalSizeType": "",\n "adsGrouping": "",\n "adsLabels": [],\n "adsRedirect": "",\n "adult": false,\n "ageGroup": "",\n "availability": "",\n "availabilityDate": "",\n "brand": "",\n "canonicalLink": "",\n "channel": "",\n "color": "",\n "condition": "",\n "contentLanguage": "",\n "costOfGoodsSold": {\n "currency": "",\n "value": ""\n },\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "customLabel0": "",\n "customLabel1": "",\n "customLabel2": "",\n "customLabel3": "",\n "customLabel4": "",\n "description": "",\n "displayAdsId": "",\n "displayAdsLink": "",\n "displayAdsSimilarIds": [],\n "displayAdsTitle": "",\n "displayAdsValue": "",\n "energyEfficiencyClass": "",\n "excludedDestinations": [],\n "expirationDate": "",\n "externalSellerId": "",\n "feedLabel": "",\n "gender": "",\n "googleProductCategory": "",\n "gtin": "",\n "id": "",\n "identifierExists": false,\n "imageLink": "",\n "includedDestinations": [],\n "installment": {\n "amount": {},\n "months": ""\n },\n "isBundle": false,\n "itemGroupId": "",\n "kind": "",\n "lifestyleImageLinks": [],\n "link": "",\n "linkTemplate": "",\n "loyaltyPoints": {\n "name": "",\n "pointsValue": "",\n "ratio": ""\n },\n "material": "",\n "maxEnergyEfficiencyClass": "",\n "maxHandlingTime": "",\n "minEnergyEfficiencyClass": "",\n "minHandlingTime": "",\n "mobileLink": "",\n "mobileLinkTemplate": "",\n "mpn": "",\n "multipack": "",\n "offerId": "",\n "pattern": "",\n "pause": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {},\n "productDetails": [\n {\n "attributeName": "",\n "attributeValue": "",\n "sectionName": ""\n }\n ],\n "productHeight": {\n "unit": "",\n "value": ""\n },\n "productHighlights": [],\n "productLength": {},\n "productTypes": [],\n "productWeight": {\n "unit": "",\n "value": ""\n },\n "productWidth": {},\n "promotionIds": [],\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "sellOnGoogleQuantity": "",\n "shipping": [\n {\n "country": "",\n "locationGroupName": "",\n "locationId": "",\n "maxHandlingTime": "",\n "maxTransitTime": "",\n "minHandlingTime": "",\n "minTransitTime": "",\n "postalCode": "",\n "price": {},\n "region": "",\n "service": ""\n }\n ],\n "shippingHeight": {\n "unit": "",\n "value": ""\n },\n "shippingLabel": "",\n "shippingLength": {},\n "shippingWeight": {\n "unit": "",\n "value": ""\n },\n "shippingWidth": {},\n "shoppingAdsExcludedCountries": [],\n "sizeSystem": "",\n "sizeType": "",\n "sizes": [],\n "source": "",\n "subscriptionCost": {\n "amount": {},\n "period": "",\n "periodLength": ""\n },\n "targetCountry": "",\n "taxCategory": "",\n "taxes": [\n {\n "country": "",\n "locationId": "",\n "postalCode": "",\n "rate": "",\n "region": "",\n "taxShip": false\n }\n ],\n "title": "",\n "transitTimeLabel": "",\n "unitPricingBaseMeasure": {\n "unit": "",\n "value": ""\n },\n "unitPricingMeasure": {\n "unit": "",\n "value": ""\n }\n}' \
--output-document \
- {{baseUrl}}/:merchantId/products
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": [
"currency": "",
"value": ""
],
"customAttributes": [
[
"groupValues": [],
"name": "",
"value": ""
]
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": [
"amount": [],
"months": ""
],
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": [
"name": "",
"pointsValue": "",
"ratio": ""
],
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": [],
"productDetails": [
[
"attributeName": "",
"attributeValue": "",
"sectionName": ""
]
],
"productHeight": [
"unit": "",
"value": ""
],
"productHighlights": [],
"productLength": [],
"productTypes": [],
"productWeight": [
"unit": "",
"value": ""
],
"productWidth": [],
"promotionIds": [],
"salePrice": [],
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
[
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": [],
"region": "",
"service": ""
]
],
"shippingHeight": [
"unit": "",
"value": ""
],
"shippingLabel": "",
"shippingLength": [],
"shippingWeight": [
"unit": "",
"value": ""
],
"shippingWidth": [],
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": [
"amount": [],
"period": "",
"periodLength": ""
],
"targetCountry": "",
"taxCategory": "",
"taxes": [
[
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
]
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": [
"unit": "",
"value": ""
],
"unitPricingMeasure": [
"unit": "",
"value": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/products")! 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()
GET
content.products.list
{{baseUrl}}/:merchantId/products
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/products");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/products")
require "http/client"
url = "{{baseUrl}}/:merchantId/products"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/products"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/products");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/products"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/products HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/products")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/products"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/products")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/products")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/products');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/products'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/products';
const options = {method: 'GET'};
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}}/:merchantId/products',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/products")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/products',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/products'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/products');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/products'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/products';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/products"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/products" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/products');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/products');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/products');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/products' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/products' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/products")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/products"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/products"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/products') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/products";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/products
http GET {{baseUrl}}/:merchantId/products
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/products
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/products")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PATCH
content.products.update
{{baseUrl}}/:merchantId/products/:productId
QUERY PARAMS
merchantId
productId
BODY json
{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/products/:productId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/:merchantId/products/:productId" {:content-type :json
:form-params {:additionalImageLinks []
:additionalSizeType ""
:adsGrouping ""
:adsLabels []
:adsRedirect ""
:adult false
:ageGroup ""
:availability ""
:availabilityDate ""
:brand ""
:canonicalLink ""
:channel ""
:color ""
:condition ""
:contentLanguage ""
:costOfGoodsSold {:currency ""
:value ""}
:customAttributes [{:groupValues []
:name ""
:value ""}]
:customLabel0 ""
:customLabel1 ""
:customLabel2 ""
:customLabel3 ""
:customLabel4 ""
:description ""
:displayAdsId ""
:displayAdsLink ""
:displayAdsSimilarIds []
:displayAdsTitle ""
:displayAdsValue ""
:energyEfficiencyClass ""
:excludedDestinations []
:expirationDate ""
:externalSellerId ""
:feedLabel ""
:gender ""
:googleProductCategory ""
:gtin ""
:id ""
:identifierExists false
:imageLink ""
:includedDestinations []
:installment {:amount {}
:months ""}
:isBundle false
:itemGroupId ""
:kind ""
:lifestyleImageLinks []
:link ""
:linkTemplate ""
:loyaltyPoints {:name ""
:pointsValue ""
:ratio ""}
:material ""
:maxEnergyEfficiencyClass ""
:maxHandlingTime ""
:minEnergyEfficiencyClass ""
:minHandlingTime ""
:mobileLink ""
:mobileLinkTemplate ""
:mpn ""
:multipack ""
:offerId ""
:pattern ""
:pause ""
:pickupMethod ""
:pickupSla ""
:price {}
:productDetails [{:attributeName ""
:attributeValue ""
:sectionName ""}]
:productHeight {:unit ""
:value ""}
:productHighlights []
:productLength {}
:productTypes []
:productWeight {:unit ""
:value ""}
:productWidth {}
:promotionIds []
:salePrice {}
:salePriceEffectiveDate ""
:sellOnGoogleQuantity ""
:shipping [{:country ""
:locationGroupName ""
:locationId ""
:maxHandlingTime ""
:maxTransitTime ""
:minHandlingTime ""
:minTransitTime ""
:postalCode ""
:price {}
:region ""
:service ""}]
:shippingHeight {:unit ""
:value ""}
:shippingLabel ""
:shippingLength {}
:shippingWeight {:unit ""
:value ""}
:shippingWidth {}
:shoppingAdsExcludedCountries []
:sizeSystem ""
:sizeType ""
:sizes []
:source ""
:subscriptionCost {:amount {}
:period ""
:periodLength ""}
:targetCountry ""
:taxCategory ""
:taxes [{:country ""
:locationId ""
:postalCode ""
:rate ""
:region ""
:taxShip false}]
:title ""
:transitTimeLabel ""
:unitPricingBaseMeasure {:unit ""
:value ""}
:unitPricingMeasure {:unit ""
:value ""}}})
require "http/client"
url = "{{baseUrl}}/:merchantId/products/:productId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/:merchantId/products/:productId"),
Content = new StringContent("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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}}/:merchantId/products/:productId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/products/:productId"
payload := strings.NewReader("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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(res)
fmt.Println(string(body))
}
PATCH /baseUrl/:merchantId/products/:productId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 3100
{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/:merchantId/products/:productId")
.setHeader("content-type", "application/json")
.setBody("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/products/:productId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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 \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/:merchantId/products/:productId")
.header("content-type", "application/json")
.body("{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {
currency: '',
value: ''
},
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {
amount: {},
months: ''
},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {
name: '',
pointsValue: '',
ratio: ''
},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [
{
attributeName: '',
attributeValue: '',
sectionName: ''
}
],
productHeight: {
unit: '',
value: ''
},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {
unit: '',
value: ''
},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {
unit: '',
value: ''
},
shippingLabel: '',
shippingLength: {},
shippingWeight: {
unit: '',
value: ''
},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {
amount: {},
period: '',
periodLength: ''
},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {
unit: '',
value: ''
},
unitPricingMeasure: {
unit: '',
value: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/:merchantId/products/:productId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/products/:productId',
headers: {'content-type': 'application/json'},
data: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/products/:productId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"additionalImageLinks":[],"additionalSizeType":"","adsGrouping":"","adsLabels":[],"adsRedirect":"","adult":false,"ageGroup":"","availability":"","availabilityDate":"","brand":"","canonicalLink":"","channel":"","color":"","condition":"","contentLanguage":"","costOfGoodsSold":{"currency":"","value":""},"customAttributes":[{"groupValues":[],"name":"","value":""}],"customLabel0":"","customLabel1":"","customLabel2":"","customLabel3":"","customLabel4":"","description":"","displayAdsId":"","displayAdsLink":"","displayAdsSimilarIds":[],"displayAdsTitle":"","displayAdsValue":"","energyEfficiencyClass":"","excludedDestinations":[],"expirationDate":"","externalSellerId":"","feedLabel":"","gender":"","googleProductCategory":"","gtin":"","id":"","identifierExists":false,"imageLink":"","includedDestinations":[],"installment":{"amount":{},"months":""},"isBundle":false,"itemGroupId":"","kind":"","lifestyleImageLinks":[],"link":"","linkTemplate":"","loyaltyPoints":{"name":"","pointsValue":"","ratio":""},"material":"","maxEnergyEfficiencyClass":"","maxHandlingTime":"","minEnergyEfficiencyClass":"","minHandlingTime":"","mobileLink":"","mobileLinkTemplate":"","mpn":"","multipack":"","offerId":"","pattern":"","pause":"","pickupMethod":"","pickupSla":"","price":{},"productDetails":[{"attributeName":"","attributeValue":"","sectionName":""}],"productHeight":{"unit":"","value":""},"productHighlights":[],"productLength":{},"productTypes":[],"productWeight":{"unit":"","value":""},"productWidth":{},"promotionIds":[],"salePrice":{},"salePriceEffectiveDate":"","sellOnGoogleQuantity":"","shipping":[{"country":"","locationGroupName":"","locationId":"","maxHandlingTime":"","maxTransitTime":"","minHandlingTime":"","minTransitTime":"","postalCode":"","price":{},"region":"","service":""}],"shippingHeight":{"unit":"","value":""},"shippingLabel":"","shippingLength":{},"shippingWeight":{"unit":"","value":""},"shippingWidth":{},"shoppingAdsExcludedCountries":[],"sizeSystem":"","sizeType":"","sizes":[],"source":"","subscriptionCost":{"amount":{},"period":"","periodLength":""},"targetCountry":"","taxCategory":"","taxes":[{"country":"","locationId":"","postalCode":"","rate":"","region":"","taxShip":false}],"title":"","transitTimeLabel":"","unitPricingBaseMeasure":{"unit":"","value":""},"unitPricingMeasure":{"unit":"","value":""}}'
};
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}}/:merchantId/products/:productId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "additionalImageLinks": [],\n "additionalSizeType": "",\n "adsGrouping": "",\n "adsLabels": [],\n "adsRedirect": "",\n "adult": false,\n "ageGroup": "",\n "availability": "",\n "availabilityDate": "",\n "brand": "",\n "canonicalLink": "",\n "channel": "",\n "color": "",\n "condition": "",\n "contentLanguage": "",\n "costOfGoodsSold": {\n "currency": "",\n "value": ""\n },\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "customLabel0": "",\n "customLabel1": "",\n "customLabel2": "",\n "customLabel3": "",\n "customLabel4": "",\n "description": "",\n "displayAdsId": "",\n "displayAdsLink": "",\n "displayAdsSimilarIds": [],\n "displayAdsTitle": "",\n "displayAdsValue": "",\n "energyEfficiencyClass": "",\n "excludedDestinations": [],\n "expirationDate": "",\n "externalSellerId": "",\n "feedLabel": "",\n "gender": "",\n "googleProductCategory": "",\n "gtin": "",\n "id": "",\n "identifierExists": false,\n "imageLink": "",\n "includedDestinations": [],\n "installment": {\n "amount": {},\n "months": ""\n },\n "isBundle": false,\n "itemGroupId": "",\n "kind": "",\n "lifestyleImageLinks": [],\n "link": "",\n "linkTemplate": "",\n "loyaltyPoints": {\n "name": "",\n "pointsValue": "",\n "ratio": ""\n },\n "material": "",\n "maxEnergyEfficiencyClass": "",\n "maxHandlingTime": "",\n "minEnergyEfficiencyClass": "",\n "minHandlingTime": "",\n "mobileLink": "",\n "mobileLinkTemplate": "",\n "mpn": "",\n "multipack": "",\n "offerId": "",\n "pattern": "",\n "pause": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {},\n "productDetails": [\n {\n "attributeName": "",\n "attributeValue": "",\n "sectionName": ""\n }\n ],\n "productHeight": {\n "unit": "",\n "value": ""\n },\n "productHighlights": [],\n "productLength": {},\n "productTypes": [],\n "productWeight": {\n "unit": "",\n "value": ""\n },\n "productWidth": {},\n "promotionIds": [],\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "sellOnGoogleQuantity": "",\n "shipping": [\n {\n "country": "",\n "locationGroupName": "",\n "locationId": "",\n "maxHandlingTime": "",\n "maxTransitTime": "",\n "minHandlingTime": "",\n "minTransitTime": "",\n "postalCode": "",\n "price": {},\n "region": "",\n "service": ""\n }\n ],\n "shippingHeight": {\n "unit": "",\n "value": ""\n },\n "shippingLabel": "",\n "shippingLength": {},\n "shippingWeight": {\n "unit": "",\n "value": ""\n },\n "shippingWidth": {},\n "shoppingAdsExcludedCountries": [],\n "sizeSystem": "",\n "sizeType": "",\n "sizes": [],\n "source": "",\n "subscriptionCost": {\n "amount": {},\n "period": "",\n "periodLength": ""\n },\n "targetCountry": "",\n "taxCategory": "",\n "taxes": [\n {\n "country": "",\n "locationId": "",\n "postalCode": "",\n "rate": "",\n "region": "",\n "taxShip": false\n }\n ],\n "title": "",\n "transitTimeLabel": "",\n "unitPricingBaseMeasure": {\n "unit": "",\n "value": ""\n },\n "unitPricingMeasure": {\n "unit": "",\n "value": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/products/:productId',
headers: {
'content-type': 'application/json'
}
};
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({
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/products/:productId',
headers: {'content-type': 'application/json'},
body: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/:merchantId/products/:productId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {
currency: '',
value: ''
},
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {
amount: {},
months: ''
},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {
name: '',
pointsValue: '',
ratio: ''
},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [
{
attributeName: '',
attributeValue: '',
sectionName: ''
}
],
productHeight: {
unit: '',
value: ''
},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {
unit: '',
value: ''
},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {
unit: '',
value: ''
},
shippingLabel: '',
shippingLength: {},
shippingWeight: {
unit: '',
value: ''
},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {
amount: {},
period: '',
periodLength: ''
},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {
unit: '',
value: ''
},
unitPricingMeasure: {
unit: '',
value: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/products/:productId',
headers: {'content-type': 'application/json'},
data: {
additionalImageLinks: [],
additionalSizeType: '',
adsGrouping: '',
adsLabels: [],
adsRedirect: '',
adult: false,
ageGroup: '',
availability: '',
availabilityDate: '',
brand: '',
canonicalLink: '',
channel: '',
color: '',
condition: '',
contentLanguage: '',
costOfGoodsSold: {currency: '', value: ''},
customAttributes: [{groupValues: [], name: '', value: ''}],
customLabel0: '',
customLabel1: '',
customLabel2: '',
customLabel3: '',
customLabel4: '',
description: '',
displayAdsId: '',
displayAdsLink: '',
displayAdsSimilarIds: [],
displayAdsTitle: '',
displayAdsValue: '',
energyEfficiencyClass: '',
excludedDestinations: [],
expirationDate: '',
externalSellerId: '',
feedLabel: '',
gender: '',
googleProductCategory: '',
gtin: '',
id: '',
identifierExists: false,
imageLink: '',
includedDestinations: [],
installment: {amount: {}, months: ''},
isBundle: false,
itemGroupId: '',
kind: '',
lifestyleImageLinks: [],
link: '',
linkTemplate: '',
loyaltyPoints: {name: '', pointsValue: '', ratio: ''},
material: '',
maxEnergyEfficiencyClass: '',
maxHandlingTime: '',
minEnergyEfficiencyClass: '',
minHandlingTime: '',
mobileLink: '',
mobileLinkTemplate: '',
mpn: '',
multipack: '',
offerId: '',
pattern: '',
pause: '',
pickupMethod: '',
pickupSla: '',
price: {},
productDetails: [{attributeName: '', attributeValue: '', sectionName: ''}],
productHeight: {unit: '', value: ''},
productHighlights: [],
productLength: {},
productTypes: [],
productWeight: {unit: '', value: ''},
productWidth: {},
promotionIds: [],
salePrice: {},
salePriceEffectiveDate: '',
sellOnGoogleQuantity: '',
shipping: [
{
country: '',
locationGroupName: '',
locationId: '',
maxHandlingTime: '',
maxTransitTime: '',
minHandlingTime: '',
minTransitTime: '',
postalCode: '',
price: {},
region: '',
service: ''
}
],
shippingHeight: {unit: '', value: ''},
shippingLabel: '',
shippingLength: {},
shippingWeight: {unit: '', value: ''},
shippingWidth: {},
shoppingAdsExcludedCountries: [],
sizeSystem: '',
sizeType: '',
sizes: [],
source: '',
subscriptionCost: {amount: {}, period: '', periodLength: ''},
targetCountry: '',
taxCategory: '',
taxes: [
{
country: '',
locationId: '',
postalCode: '',
rate: '',
region: '',
taxShip: false
}
],
title: '',
transitTimeLabel: '',
unitPricingBaseMeasure: {unit: '', value: ''},
unitPricingMeasure: {unit: '', value: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/products/:productId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"additionalImageLinks":[],"additionalSizeType":"","adsGrouping":"","adsLabels":[],"adsRedirect":"","adult":false,"ageGroup":"","availability":"","availabilityDate":"","brand":"","canonicalLink":"","channel":"","color":"","condition":"","contentLanguage":"","costOfGoodsSold":{"currency":"","value":""},"customAttributes":[{"groupValues":[],"name":"","value":""}],"customLabel0":"","customLabel1":"","customLabel2":"","customLabel3":"","customLabel4":"","description":"","displayAdsId":"","displayAdsLink":"","displayAdsSimilarIds":[],"displayAdsTitle":"","displayAdsValue":"","energyEfficiencyClass":"","excludedDestinations":[],"expirationDate":"","externalSellerId":"","feedLabel":"","gender":"","googleProductCategory":"","gtin":"","id":"","identifierExists":false,"imageLink":"","includedDestinations":[],"installment":{"amount":{},"months":""},"isBundle":false,"itemGroupId":"","kind":"","lifestyleImageLinks":[],"link":"","linkTemplate":"","loyaltyPoints":{"name":"","pointsValue":"","ratio":""},"material":"","maxEnergyEfficiencyClass":"","maxHandlingTime":"","minEnergyEfficiencyClass":"","minHandlingTime":"","mobileLink":"","mobileLinkTemplate":"","mpn":"","multipack":"","offerId":"","pattern":"","pause":"","pickupMethod":"","pickupSla":"","price":{},"productDetails":[{"attributeName":"","attributeValue":"","sectionName":""}],"productHeight":{"unit":"","value":""},"productHighlights":[],"productLength":{},"productTypes":[],"productWeight":{"unit":"","value":""},"productWidth":{},"promotionIds":[],"salePrice":{},"salePriceEffectiveDate":"","sellOnGoogleQuantity":"","shipping":[{"country":"","locationGroupName":"","locationId":"","maxHandlingTime":"","maxTransitTime":"","minHandlingTime":"","minTransitTime":"","postalCode":"","price":{},"region":"","service":""}],"shippingHeight":{"unit":"","value":""},"shippingLabel":"","shippingLength":{},"shippingWeight":{"unit":"","value":""},"shippingWidth":{},"shoppingAdsExcludedCountries":[],"sizeSystem":"","sizeType":"","sizes":[],"source":"","subscriptionCost":{"amount":{},"period":"","periodLength":""},"targetCountry":"","taxCategory":"","taxes":[{"country":"","locationId":"","postalCode":"","rate":"","region":"","taxShip":false}],"title":"","transitTimeLabel":"","unitPricingBaseMeasure":{"unit":"","value":""},"unitPricingMeasure":{"unit":"","value":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"additionalImageLinks": @[ ],
@"additionalSizeType": @"",
@"adsGrouping": @"",
@"adsLabels": @[ ],
@"adsRedirect": @"",
@"adult": @NO,
@"ageGroup": @"",
@"availability": @"",
@"availabilityDate": @"",
@"brand": @"",
@"canonicalLink": @"",
@"channel": @"",
@"color": @"",
@"condition": @"",
@"contentLanguage": @"",
@"costOfGoodsSold": @{ @"currency": @"", @"value": @"" },
@"customAttributes": @[ @{ @"groupValues": @[ ], @"name": @"", @"value": @"" } ],
@"customLabel0": @"",
@"customLabel1": @"",
@"customLabel2": @"",
@"customLabel3": @"",
@"customLabel4": @"",
@"description": @"",
@"displayAdsId": @"",
@"displayAdsLink": @"",
@"displayAdsSimilarIds": @[ ],
@"displayAdsTitle": @"",
@"displayAdsValue": @"",
@"energyEfficiencyClass": @"",
@"excludedDestinations": @[ ],
@"expirationDate": @"",
@"externalSellerId": @"",
@"feedLabel": @"",
@"gender": @"",
@"googleProductCategory": @"",
@"gtin": @"",
@"id": @"",
@"identifierExists": @NO,
@"imageLink": @"",
@"includedDestinations": @[ ],
@"installment": @{ @"amount": @{ }, @"months": @"" },
@"isBundle": @NO,
@"itemGroupId": @"",
@"kind": @"",
@"lifestyleImageLinks": @[ ],
@"link": @"",
@"linkTemplate": @"",
@"loyaltyPoints": @{ @"name": @"", @"pointsValue": @"", @"ratio": @"" },
@"material": @"",
@"maxEnergyEfficiencyClass": @"",
@"maxHandlingTime": @"",
@"minEnergyEfficiencyClass": @"",
@"minHandlingTime": @"",
@"mobileLink": @"",
@"mobileLinkTemplate": @"",
@"mpn": @"",
@"multipack": @"",
@"offerId": @"",
@"pattern": @"",
@"pause": @"",
@"pickupMethod": @"",
@"pickupSla": @"",
@"price": @{ },
@"productDetails": @[ @{ @"attributeName": @"", @"attributeValue": @"", @"sectionName": @"" } ],
@"productHeight": @{ @"unit": @"", @"value": @"" },
@"productHighlights": @[ ],
@"productLength": @{ },
@"productTypes": @[ ],
@"productWeight": @{ @"unit": @"", @"value": @"" },
@"productWidth": @{ },
@"promotionIds": @[ ],
@"salePrice": @{ },
@"salePriceEffectiveDate": @"",
@"sellOnGoogleQuantity": @"",
@"shipping": @[ @{ @"country": @"", @"locationGroupName": @"", @"locationId": @"", @"maxHandlingTime": @"", @"maxTransitTime": @"", @"minHandlingTime": @"", @"minTransitTime": @"", @"postalCode": @"", @"price": @{ }, @"region": @"", @"service": @"" } ],
@"shippingHeight": @{ @"unit": @"", @"value": @"" },
@"shippingLabel": @"",
@"shippingLength": @{ },
@"shippingWeight": @{ @"unit": @"", @"value": @"" },
@"shippingWidth": @{ },
@"shoppingAdsExcludedCountries": @[ ],
@"sizeSystem": @"",
@"sizeType": @"",
@"sizes": @[ ],
@"source": @"",
@"subscriptionCost": @{ @"amount": @{ }, @"period": @"", @"periodLength": @"" },
@"targetCountry": @"",
@"taxCategory": @"",
@"taxes": @[ @{ @"country": @"", @"locationId": @"", @"postalCode": @"", @"rate": @"", @"region": @"", @"taxShip": @NO } ],
@"title": @"",
@"transitTimeLabel": @"",
@"unitPricingBaseMeasure": @{ @"unit": @"", @"value": @"" },
@"unitPricingMeasure": @{ @"unit": @"", @"value": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/products/:productId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/:merchantId/products/:productId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/products/:productId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
]),
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;
}
request('PATCH', '{{baseUrl}}/:merchantId/products/:productId', [
'body' => '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/products/:productId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'additionalImageLinks' => [
],
'additionalSizeType' => '',
'adsGrouping' => '',
'adsLabels' => [
],
'adsRedirect' => '',
'adult' => null,
'ageGroup' => '',
'availability' => '',
'availabilityDate' => '',
'brand' => '',
'canonicalLink' => '',
'channel' => '',
'color' => '',
'condition' => '',
'contentLanguage' => '',
'costOfGoodsSold' => [
'currency' => '',
'value' => ''
],
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'customLabel0' => '',
'customLabel1' => '',
'customLabel2' => '',
'customLabel3' => '',
'customLabel4' => '',
'description' => '',
'displayAdsId' => '',
'displayAdsLink' => '',
'displayAdsSimilarIds' => [
],
'displayAdsTitle' => '',
'displayAdsValue' => '',
'energyEfficiencyClass' => '',
'excludedDestinations' => [
],
'expirationDate' => '',
'externalSellerId' => '',
'feedLabel' => '',
'gender' => '',
'googleProductCategory' => '',
'gtin' => '',
'id' => '',
'identifierExists' => null,
'imageLink' => '',
'includedDestinations' => [
],
'installment' => [
'amount' => [
],
'months' => ''
],
'isBundle' => null,
'itemGroupId' => '',
'kind' => '',
'lifestyleImageLinks' => [
],
'link' => '',
'linkTemplate' => '',
'loyaltyPoints' => [
'name' => '',
'pointsValue' => '',
'ratio' => ''
],
'material' => '',
'maxEnergyEfficiencyClass' => '',
'maxHandlingTime' => '',
'minEnergyEfficiencyClass' => '',
'minHandlingTime' => '',
'mobileLink' => '',
'mobileLinkTemplate' => '',
'mpn' => '',
'multipack' => '',
'offerId' => '',
'pattern' => '',
'pause' => '',
'pickupMethod' => '',
'pickupSla' => '',
'price' => [
],
'productDetails' => [
[
'attributeName' => '',
'attributeValue' => '',
'sectionName' => ''
]
],
'productHeight' => [
'unit' => '',
'value' => ''
],
'productHighlights' => [
],
'productLength' => [
],
'productTypes' => [
],
'productWeight' => [
'unit' => '',
'value' => ''
],
'productWidth' => [
],
'promotionIds' => [
],
'salePrice' => [
],
'salePriceEffectiveDate' => '',
'sellOnGoogleQuantity' => '',
'shipping' => [
[
'country' => '',
'locationGroupName' => '',
'locationId' => '',
'maxHandlingTime' => '',
'maxTransitTime' => '',
'minHandlingTime' => '',
'minTransitTime' => '',
'postalCode' => '',
'price' => [
],
'region' => '',
'service' => ''
]
],
'shippingHeight' => [
'unit' => '',
'value' => ''
],
'shippingLabel' => '',
'shippingLength' => [
],
'shippingWeight' => [
'unit' => '',
'value' => ''
],
'shippingWidth' => [
],
'shoppingAdsExcludedCountries' => [
],
'sizeSystem' => '',
'sizeType' => '',
'sizes' => [
],
'source' => '',
'subscriptionCost' => [
'amount' => [
],
'period' => '',
'periodLength' => ''
],
'targetCountry' => '',
'taxCategory' => '',
'taxes' => [
[
'country' => '',
'locationId' => '',
'postalCode' => '',
'rate' => '',
'region' => '',
'taxShip' => null
]
],
'title' => '',
'transitTimeLabel' => '',
'unitPricingBaseMeasure' => [
'unit' => '',
'value' => ''
],
'unitPricingMeasure' => [
'unit' => '',
'value' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/products/:productId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/products/:productId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/products/:productId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/:merchantId/products/:productId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/products/:productId"
payload = {
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": False,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": False,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": False,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": False
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/products/:productId"
payload <- "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/products/:productId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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.patch('/baseUrl/:merchantId/products/:productId') do |req|
req.body = "{\n \"additionalImageLinks\": [],\n \"additionalSizeType\": \"\",\n \"adsGrouping\": \"\",\n \"adsLabels\": [],\n \"adsRedirect\": \"\",\n \"adult\": false,\n \"ageGroup\": \"\",\n \"availability\": \"\",\n \"availabilityDate\": \"\",\n \"brand\": \"\",\n \"canonicalLink\": \"\",\n \"channel\": \"\",\n \"color\": \"\",\n \"condition\": \"\",\n \"contentLanguage\": \"\",\n \"costOfGoodsSold\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"customLabel0\": \"\",\n \"customLabel1\": \"\",\n \"customLabel2\": \"\",\n \"customLabel3\": \"\",\n \"customLabel4\": \"\",\n \"description\": \"\",\n \"displayAdsId\": \"\",\n \"displayAdsLink\": \"\",\n \"displayAdsSimilarIds\": [],\n \"displayAdsTitle\": \"\",\n \"displayAdsValue\": \"\",\n \"energyEfficiencyClass\": \"\",\n \"excludedDestinations\": [],\n \"expirationDate\": \"\",\n \"externalSellerId\": \"\",\n \"feedLabel\": \"\",\n \"gender\": \"\",\n \"googleProductCategory\": \"\",\n \"gtin\": \"\",\n \"id\": \"\",\n \"identifierExists\": false,\n \"imageLink\": \"\",\n \"includedDestinations\": [],\n \"installment\": {\n \"amount\": {},\n \"months\": \"\"\n },\n \"isBundle\": false,\n \"itemGroupId\": \"\",\n \"kind\": \"\",\n \"lifestyleImageLinks\": [],\n \"link\": \"\",\n \"linkTemplate\": \"\",\n \"loyaltyPoints\": {\n \"name\": \"\",\n \"pointsValue\": \"\",\n \"ratio\": \"\"\n },\n \"material\": \"\",\n \"maxEnergyEfficiencyClass\": \"\",\n \"maxHandlingTime\": \"\",\n \"minEnergyEfficiencyClass\": \"\",\n \"minHandlingTime\": \"\",\n \"mobileLink\": \"\",\n \"mobileLinkTemplate\": \"\",\n \"mpn\": \"\",\n \"multipack\": \"\",\n \"offerId\": \"\",\n \"pattern\": \"\",\n \"pause\": \"\",\n \"pickupMethod\": \"\",\n \"pickupSla\": \"\",\n \"price\": {},\n \"productDetails\": [\n {\n \"attributeName\": \"\",\n \"attributeValue\": \"\",\n \"sectionName\": \"\"\n }\n ],\n \"productHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productHighlights\": [],\n \"productLength\": {},\n \"productTypes\": [],\n \"productWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"productWidth\": {},\n \"promotionIds\": [],\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\",\n \"sellOnGoogleQuantity\": \"\",\n \"shipping\": [\n {\n \"country\": \"\",\n \"locationGroupName\": \"\",\n \"locationId\": \"\",\n \"maxHandlingTime\": \"\",\n \"maxTransitTime\": \"\",\n \"minHandlingTime\": \"\",\n \"minTransitTime\": \"\",\n \"postalCode\": \"\",\n \"price\": {},\n \"region\": \"\",\n \"service\": \"\"\n }\n ],\n \"shippingHeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingLabel\": \"\",\n \"shippingLength\": {},\n \"shippingWeight\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"shippingWidth\": {},\n \"shoppingAdsExcludedCountries\": [],\n \"sizeSystem\": \"\",\n \"sizeType\": \"\",\n \"sizes\": [],\n \"source\": \"\",\n \"subscriptionCost\": {\n \"amount\": {},\n \"period\": \"\",\n \"periodLength\": \"\"\n },\n \"targetCountry\": \"\",\n \"taxCategory\": \"\",\n \"taxes\": [\n {\n \"country\": \"\",\n \"locationId\": \"\",\n \"postalCode\": \"\",\n \"rate\": \"\",\n \"region\": \"\",\n \"taxShip\": false\n }\n ],\n \"title\": \"\",\n \"transitTimeLabel\": \"\",\n \"unitPricingBaseMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n },\n \"unitPricingMeasure\": {\n \"unit\": \"\",\n \"value\": \"\"\n }\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}}/:merchantId/products/:productId";
let payload = json!({
"additionalImageLinks": (),
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": (),
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": json!({
"currency": "",
"value": ""
}),
"customAttributes": (
json!({
"groupValues": (),
"name": "",
"value": ""
})
),
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": (),
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": (),
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": (),
"installment": json!({
"amount": json!({}),
"months": ""
}),
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": (),
"link": "",
"linkTemplate": "",
"loyaltyPoints": json!({
"name": "",
"pointsValue": "",
"ratio": ""
}),
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": json!({}),
"productDetails": (
json!({
"attributeName": "",
"attributeValue": "",
"sectionName": ""
})
),
"productHeight": json!({
"unit": "",
"value": ""
}),
"productHighlights": (),
"productLength": json!({}),
"productTypes": (),
"productWeight": json!({
"unit": "",
"value": ""
}),
"productWidth": json!({}),
"promotionIds": (),
"salePrice": json!({}),
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": (
json!({
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": json!({}),
"region": "",
"service": ""
})
),
"shippingHeight": json!({
"unit": "",
"value": ""
}),
"shippingLabel": "",
"shippingLength": json!({}),
"shippingWeight": json!({
"unit": "",
"value": ""
}),
"shippingWidth": json!({}),
"shoppingAdsExcludedCountries": (),
"sizeSystem": "",
"sizeType": "",
"sizes": (),
"source": "",
"subscriptionCost": json!({
"amount": json!({}),
"period": "",
"periodLength": ""
}),
"targetCountry": "",
"taxCategory": "",
"taxes": (
json!({
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
})
),
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": json!({
"unit": "",
"value": ""
}),
"unitPricingMeasure": json!({
"unit": "",
"value": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/:merchantId/products/:productId \
--header 'content-type: application/json' \
--data '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}'
echo '{
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": {
"currency": "",
"value": ""
},
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": {
"amount": {},
"months": ""
},
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": {
"name": "",
"pointsValue": "",
"ratio": ""
},
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": {},
"productDetails": [
{
"attributeName": "",
"attributeValue": "",
"sectionName": ""
}
],
"productHeight": {
"unit": "",
"value": ""
},
"productHighlights": [],
"productLength": {},
"productTypes": [],
"productWeight": {
"unit": "",
"value": ""
},
"productWidth": {},
"promotionIds": [],
"salePrice": {},
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
{
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": {},
"region": "",
"service": ""
}
],
"shippingHeight": {
"unit": "",
"value": ""
},
"shippingLabel": "",
"shippingLength": {},
"shippingWeight": {
"unit": "",
"value": ""
},
"shippingWidth": {},
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": {
"amount": {},
"period": "",
"periodLength": ""
},
"targetCountry": "",
"taxCategory": "",
"taxes": [
{
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
}
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": {
"unit": "",
"value": ""
},
"unitPricingMeasure": {
"unit": "",
"value": ""
}
}' | \
http PATCH {{baseUrl}}/:merchantId/products/:productId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "additionalImageLinks": [],\n "additionalSizeType": "",\n "adsGrouping": "",\n "adsLabels": [],\n "adsRedirect": "",\n "adult": false,\n "ageGroup": "",\n "availability": "",\n "availabilityDate": "",\n "brand": "",\n "canonicalLink": "",\n "channel": "",\n "color": "",\n "condition": "",\n "contentLanguage": "",\n "costOfGoodsSold": {\n "currency": "",\n "value": ""\n },\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "customLabel0": "",\n "customLabel1": "",\n "customLabel2": "",\n "customLabel3": "",\n "customLabel4": "",\n "description": "",\n "displayAdsId": "",\n "displayAdsLink": "",\n "displayAdsSimilarIds": [],\n "displayAdsTitle": "",\n "displayAdsValue": "",\n "energyEfficiencyClass": "",\n "excludedDestinations": [],\n "expirationDate": "",\n "externalSellerId": "",\n "feedLabel": "",\n "gender": "",\n "googleProductCategory": "",\n "gtin": "",\n "id": "",\n "identifierExists": false,\n "imageLink": "",\n "includedDestinations": [],\n "installment": {\n "amount": {},\n "months": ""\n },\n "isBundle": false,\n "itemGroupId": "",\n "kind": "",\n "lifestyleImageLinks": [],\n "link": "",\n "linkTemplate": "",\n "loyaltyPoints": {\n "name": "",\n "pointsValue": "",\n "ratio": ""\n },\n "material": "",\n "maxEnergyEfficiencyClass": "",\n "maxHandlingTime": "",\n "minEnergyEfficiencyClass": "",\n "minHandlingTime": "",\n "mobileLink": "",\n "mobileLinkTemplate": "",\n "mpn": "",\n "multipack": "",\n "offerId": "",\n "pattern": "",\n "pause": "",\n "pickupMethod": "",\n "pickupSla": "",\n "price": {},\n "productDetails": [\n {\n "attributeName": "",\n "attributeValue": "",\n "sectionName": ""\n }\n ],\n "productHeight": {\n "unit": "",\n "value": ""\n },\n "productHighlights": [],\n "productLength": {},\n "productTypes": [],\n "productWeight": {\n "unit": "",\n "value": ""\n },\n "productWidth": {},\n "promotionIds": [],\n "salePrice": {},\n "salePriceEffectiveDate": "",\n "sellOnGoogleQuantity": "",\n "shipping": [\n {\n "country": "",\n "locationGroupName": "",\n "locationId": "",\n "maxHandlingTime": "",\n "maxTransitTime": "",\n "minHandlingTime": "",\n "minTransitTime": "",\n "postalCode": "",\n "price": {},\n "region": "",\n "service": ""\n }\n ],\n "shippingHeight": {\n "unit": "",\n "value": ""\n },\n "shippingLabel": "",\n "shippingLength": {},\n "shippingWeight": {\n "unit": "",\n "value": ""\n },\n "shippingWidth": {},\n "shoppingAdsExcludedCountries": [],\n "sizeSystem": "",\n "sizeType": "",\n "sizes": [],\n "source": "",\n "subscriptionCost": {\n "amount": {},\n "period": "",\n "periodLength": ""\n },\n "targetCountry": "",\n "taxCategory": "",\n "taxes": [\n {\n "country": "",\n "locationId": "",\n "postalCode": "",\n "rate": "",\n "region": "",\n "taxShip": false\n }\n ],\n "title": "",\n "transitTimeLabel": "",\n "unitPricingBaseMeasure": {\n "unit": "",\n "value": ""\n },\n "unitPricingMeasure": {\n "unit": "",\n "value": ""\n }\n}' \
--output-document \
- {{baseUrl}}/:merchantId/products/:productId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"additionalImageLinks": [],
"additionalSizeType": "",
"adsGrouping": "",
"adsLabels": [],
"adsRedirect": "",
"adult": false,
"ageGroup": "",
"availability": "",
"availabilityDate": "",
"brand": "",
"canonicalLink": "",
"channel": "",
"color": "",
"condition": "",
"contentLanguage": "",
"costOfGoodsSold": [
"currency": "",
"value": ""
],
"customAttributes": [
[
"groupValues": [],
"name": "",
"value": ""
]
],
"customLabel0": "",
"customLabel1": "",
"customLabel2": "",
"customLabel3": "",
"customLabel4": "",
"description": "",
"displayAdsId": "",
"displayAdsLink": "",
"displayAdsSimilarIds": [],
"displayAdsTitle": "",
"displayAdsValue": "",
"energyEfficiencyClass": "",
"excludedDestinations": [],
"expirationDate": "",
"externalSellerId": "",
"feedLabel": "",
"gender": "",
"googleProductCategory": "",
"gtin": "",
"id": "",
"identifierExists": false,
"imageLink": "",
"includedDestinations": [],
"installment": [
"amount": [],
"months": ""
],
"isBundle": false,
"itemGroupId": "",
"kind": "",
"lifestyleImageLinks": [],
"link": "",
"linkTemplate": "",
"loyaltyPoints": [
"name": "",
"pointsValue": "",
"ratio": ""
],
"material": "",
"maxEnergyEfficiencyClass": "",
"maxHandlingTime": "",
"minEnergyEfficiencyClass": "",
"minHandlingTime": "",
"mobileLink": "",
"mobileLinkTemplate": "",
"mpn": "",
"multipack": "",
"offerId": "",
"pattern": "",
"pause": "",
"pickupMethod": "",
"pickupSla": "",
"price": [],
"productDetails": [
[
"attributeName": "",
"attributeValue": "",
"sectionName": ""
]
],
"productHeight": [
"unit": "",
"value": ""
],
"productHighlights": [],
"productLength": [],
"productTypes": [],
"productWeight": [
"unit": "",
"value": ""
],
"productWidth": [],
"promotionIds": [],
"salePrice": [],
"salePriceEffectiveDate": "",
"sellOnGoogleQuantity": "",
"shipping": [
[
"country": "",
"locationGroupName": "",
"locationId": "",
"maxHandlingTime": "",
"maxTransitTime": "",
"minHandlingTime": "",
"minTransitTime": "",
"postalCode": "",
"price": [],
"region": "",
"service": ""
]
],
"shippingHeight": [
"unit": "",
"value": ""
],
"shippingLabel": "",
"shippingLength": [],
"shippingWeight": [
"unit": "",
"value": ""
],
"shippingWidth": [],
"shoppingAdsExcludedCountries": [],
"sizeSystem": "",
"sizeType": "",
"sizes": [],
"source": "",
"subscriptionCost": [
"amount": [],
"period": "",
"periodLength": ""
],
"targetCountry": "",
"taxCategory": "",
"taxes": [
[
"country": "",
"locationId": "",
"postalCode": "",
"rate": "",
"region": "",
"taxShip": false
]
],
"title": "",
"transitTimeLabel": "",
"unitPricingBaseMeasure": [
"unit": "",
"value": ""
],
"unitPricingMeasure": [
"unit": "",
"value": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/products/:productId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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
content.productstatuses.custombatch
{{baseUrl}}/productstatuses/batch
BODY json
{
"entries": [
{
"batchId": 0,
"destinations": [],
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/productstatuses/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/productstatuses/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:destinations []
:includeAttributes false
:merchantId ""
:method ""
:productId ""}]}})
require "http/client"
url = "{{baseUrl}}/productstatuses/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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}}/productstatuses/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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}}/productstatuses/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/productstatuses/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/productstatuses/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 180
{
"entries": [
{
"batchId": 0,
"destinations": [],
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/productstatuses/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/productstatuses/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/productstatuses/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/productstatuses/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
destinations: [],
includeAttributes: false,
merchantId: '',
method: '',
productId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/productstatuses/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/productstatuses/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
destinations: [],
includeAttributes: false,
merchantId: '',
method: '',
productId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/productstatuses/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"destinations":[],"includeAttributes":false,"merchantId":"","method":"","productId":""}]}'
};
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}}/productstatuses/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "destinations": [],\n "includeAttributes": false,\n "merchantId": "",\n "method": "",\n "productId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/productstatuses/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/productstatuses/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
destinations: [],
includeAttributes: false,
merchantId: '',
method: '',
productId: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/productstatuses/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
destinations: [],
includeAttributes: false,
merchantId: '',
method: '',
productId: ''
}
]
},
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}}/productstatuses/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
destinations: [],
includeAttributes: false,
merchantId: '',
method: '',
productId: ''
}
]
});
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}}/productstatuses/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
destinations: [],
includeAttributes: false,
merchantId: '',
method: '',
productId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/productstatuses/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"destinations":[],"includeAttributes":false,"merchantId":"","method":"","productId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"destinations": @[ ], @"includeAttributes": @NO, @"merchantId": @"", @"method": @"", @"productId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/productstatuses/batch"]
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}}/productstatuses/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/productstatuses/batch",
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([
'entries' => [
[
'batchId' => 0,
'destinations' => [
],
'includeAttributes' => null,
'merchantId' => '',
'method' => '',
'productId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/productstatuses/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"destinations": [],
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/productstatuses/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'destinations' => [
],
'includeAttributes' => null,
'merchantId' => '',
'method' => '',
'productId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'destinations' => [
],
'includeAttributes' => null,
'merchantId' => '',
'method' => '',
'productId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/productstatuses/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/productstatuses/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"destinations": [],
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/productstatuses/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"destinations": [],
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/productstatuses/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/productstatuses/batch"
payload = { "entries": [
{
"batchId": 0,
"destinations": [],
"includeAttributes": False,
"merchantId": "",
"method": "",
"productId": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/productstatuses/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/productstatuses/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\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.post('/baseUrl/productstatuses/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"destinations\": [],\n \"includeAttributes\": false,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/productstatuses/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"destinations": (),
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/productstatuses/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"destinations": [],
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"destinations": [],
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
}
]
}' | \
http POST {{baseUrl}}/productstatuses/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "destinations": [],\n "includeAttributes": false,\n "merchantId": "",\n "method": "",\n "productId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/productstatuses/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"destinations": [],
"includeAttributes": false,
"merchantId": "",
"method": "",
"productId": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/productstatuses/batch")! 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()
GET
content.productstatuses.get
{{baseUrl}}/:merchantId/productstatuses/:productId
QUERY PARAMS
merchantId
productId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/productstatuses/:productId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/productstatuses/:productId")
require "http/client"
url = "{{baseUrl}}/:merchantId/productstatuses/:productId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/productstatuses/:productId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/productstatuses/:productId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/productstatuses/:productId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/productstatuses/:productId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/productstatuses/:productId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/productstatuses/:productId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/productstatuses/:productId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/productstatuses/:productId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/productstatuses/:productId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productstatuses/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/productstatuses/:productId';
const options = {method: 'GET'};
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}}/:merchantId/productstatuses/:productId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/productstatuses/:productId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/productstatuses/:productId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productstatuses/:productId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/productstatuses/:productId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productstatuses/:productId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/productstatuses/:productId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/productstatuses/:productId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/productstatuses/:productId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/productstatuses/:productId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/productstatuses/:productId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/productstatuses/:productId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/productstatuses/:productId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/productstatuses/:productId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/productstatuses/:productId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/productstatuses/:productId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/productstatuses/:productId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/productstatuses/:productId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/productstatuses/:productId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/productstatuses/:productId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/productstatuses/:productId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/productstatuses/:productId
http GET {{baseUrl}}/:merchantId/productstatuses/:productId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/productstatuses/:productId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/productstatuses/:productId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.productstatuses.list
{{baseUrl}}/:merchantId/productstatuses
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/productstatuses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/productstatuses")
require "http/client"
url = "{{baseUrl}}/:merchantId/productstatuses"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/productstatuses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/productstatuses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/productstatuses"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/productstatuses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/productstatuses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/productstatuses"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/productstatuses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/productstatuses")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/productstatuses');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/productstatuses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/productstatuses';
const options = {method: 'GET'};
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}}/:merchantId/productstatuses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/productstatuses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/productstatuses',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/productstatuses'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/productstatuses');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/productstatuses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/productstatuses';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/productstatuses"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/productstatuses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/productstatuses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/productstatuses');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/productstatuses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/productstatuses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/productstatuses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/productstatuses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/productstatuses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/productstatuses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/productstatuses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/productstatuses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/productstatuses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/productstatuses";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/productstatuses
http GET {{baseUrl}}/:merchantId/productstatuses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/productstatuses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/productstatuses")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.productstatuses.repricingreports.list
{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports
QUERY PARAMS
merchantId
productId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports")
require "http/client"
url = "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/productstatuses/:productId/repricingreports HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports';
const options = {method: 'GET'};
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}}/:merchantId/productstatuses/:productId/repricingreports',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/productstatuses/:productId/repricingreports',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/productstatuses/:productId/repricingreports" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/productstatuses/:productId/repricingreports")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/productstatuses/:productId/repricingreports') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports
http GET {{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/productstatuses/:productId/repricingreports")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.promotions.create
{{baseUrl}}/:merchantId/promotions
QUERY PARAMS
merchantId
BODY json
{
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": {
"currency": "",
"value": ""
},
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": {},
"longTitle": "",
"minimumPurchaseAmount": {},
"minimumPurchaseQuantity": 0,
"moneyBudget": {},
"moneyOffAmount": {},
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": {
"endTime": "",
"startTime": ""
},
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": {},
"promotionId": "",
"promotionStatus": {
"creationDate": "",
"destinationStatuses": [
{
"destination": "",
"status": ""
}
],
"lastUpdateDate": "",
"promotionIssue": [
{
"code": "",
"detail": ""
}
]
},
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/promotions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/promotions" {:content-type :json
:form-params {:brand []
:brandExclusion []
:contentLanguage ""
:couponValueType ""
:freeGiftDescription ""
:freeGiftItemId ""
:freeGiftValue {:currency ""
:value ""}
:genericRedemptionCode ""
:getThisQuantityDiscounted 0
:id ""
:itemGroupId []
:itemGroupIdExclusion []
:itemId []
:itemIdExclusion []
:limitQuantity 0
:limitValue {}
:longTitle ""
:minimumPurchaseAmount {}
:minimumPurchaseQuantity 0
:moneyBudget {}
:moneyOffAmount {}
:offerType ""
:orderLimit 0
:percentOff 0
:productApplicability ""
:productType []
:productTypeExclusion []
:promotionDestinationIds []
:promotionDisplayDates ""
:promotionDisplayTimePeriod {:endTime ""
:startTime ""}
:promotionEffectiveDates ""
:promotionEffectiveTimePeriod {}
:promotionId ""
:promotionStatus {:creationDate ""
:destinationStatuses [{:destination ""
:status ""}]
:lastUpdateDate ""
:promotionIssue [{:code ""
:detail ""}]}
:promotionUrl ""
:redemptionChannel []
:shippingServiceNames []
:storeApplicability ""
:storeCode []
:storeCodeExclusion []
:targetCountry ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/promotions"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\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}}/:merchantId/promotions"),
Content = new StringContent("{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\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}}/:merchantId/promotions");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/promotions"
payload := strings.NewReader("{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/promotions HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1358
{
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": {
"currency": "",
"value": ""
},
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": {},
"longTitle": "",
"minimumPurchaseAmount": {},
"minimumPurchaseQuantity": 0,
"moneyBudget": {},
"moneyOffAmount": {},
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": {
"endTime": "",
"startTime": ""
},
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": {},
"promotionId": "",
"promotionStatus": {
"creationDate": "",
"destinationStatuses": [
{
"destination": "",
"status": ""
}
],
"lastUpdateDate": "",
"promotionIssue": [
{
"code": "",
"detail": ""
}
]
},
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/promotions")
.setHeader("content-type", "application/json")
.setBody("{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/promotions"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\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 \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/promotions")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/promotions")
.header("content-type", "application/json")
.body("{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}")
.asString();
const data = JSON.stringify({
brand: [],
brandExclusion: [],
contentLanguage: '',
couponValueType: '',
freeGiftDescription: '',
freeGiftItemId: '',
freeGiftValue: {
currency: '',
value: ''
},
genericRedemptionCode: '',
getThisQuantityDiscounted: 0,
id: '',
itemGroupId: [],
itemGroupIdExclusion: [],
itemId: [],
itemIdExclusion: [],
limitQuantity: 0,
limitValue: {},
longTitle: '',
minimumPurchaseAmount: {},
minimumPurchaseQuantity: 0,
moneyBudget: {},
moneyOffAmount: {},
offerType: '',
orderLimit: 0,
percentOff: 0,
productApplicability: '',
productType: [],
productTypeExclusion: [],
promotionDestinationIds: [],
promotionDisplayDates: '',
promotionDisplayTimePeriod: {
endTime: '',
startTime: ''
},
promotionEffectiveDates: '',
promotionEffectiveTimePeriod: {},
promotionId: '',
promotionStatus: {
creationDate: '',
destinationStatuses: [
{
destination: '',
status: ''
}
],
lastUpdateDate: '',
promotionIssue: [
{
code: '',
detail: ''
}
]
},
promotionUrl: '',
redemptionChannel: [],
shippingServiceNames: [],
storeApplicability: '',
storeCode: [],
storeCodeExclusion: [],
targetCountry: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/promotions');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/promotions',
headers: {'content-type': 'application/json'},
data: {
brand: [],
brandExclusion: [],
contentLanguage: '',
couponValueType: '',
freeGiftDescription: '',
freeGiftItemId: '',
freeGiftValue: {currency: '', value: ''},
genericRedemptionCode: '',
getThisQuantityDiscounted: 0,
id: '',
itemGroupId: [],
itemGroupIdExclusion: [],
itemId: [],
itemIdExclusion: [],
limitQuantity: 0,
limitValue: {},
longTitle: '',
minimumPurchaseAmount: {},
minimumPurchaseQuantity: 0,
moneyBudget: {},
moneyOffAmount: {},
offerType: '',
orderLimit: 0,
percentOff: 0,
productApplicability: '',
productType: [],
productTypeExclusion: [],
promotionDestinationIds: [],
promotionDisplayDates: '',
promotionDisplayTimePeriod: {endTime: '', startTime: ''},
promotionEffectiveDates: '',
promotionEffectiveTimePeriod: {},
promotionId: '',
promotionStatus: {
creationDate: '',
destinationStatuses: [{destination: '', status: ''}],
lastUpdateDate: '',
promotionIssue: [{code: '', detail: ''}]
},
promotionUrl: '',
redemptionChannel: [],
shippingServiceNames: [],
storeApplicability: '',
storeCode: [],
storeCodeExclusion: [],
targetCountry: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/promotions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"brand":[],"brandExclusion":[],"contentLanguage":"","couponValueType":"","freeGiftDescription":"","freeGiftItemId":"","freeGiftValue":{"currency":"","value":""},"genericRedemptionCode":"","getThisQuantityDiscounted":0,"id":"","itemGroupId":[],"itemGroupIdExclusion":[],"itemId":[],"itemIdExclusion":[],"limitQuantity":0,"limitValue":{},"longTitle":"","minimumPurchaseAmount":{},"minimumPurchaseQuantity":0,"moneyBudget":{},"moneyOffAmount":{},"offerType":"","orderLimit":0,"percentOff":0,"productApplicability":"","productType":[],"productTypeExclusion":[],"promotionDestinationIds":[],"promotionDisplayDates":"","promotionDisplayTimePeriod":{"endTime":"","startTime":""},"promotionEffectiveDates":"","promotionEffectiveTimePeriod":{},"promotionId":"","promotionStatus":{"creationDate":"","destinationStatuses":[{"destination":"","status":""}],"lastUpdateDate":"","promotionIssue":[{"code":"","detail":""}]},"promotionUrl":"","redemptionChannel":[],"shippingServiceNames":[],"storeApplicability":"","storeCode":[],"storeCodeExclusion":[],"targetCountry":""}'
};
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}}/:merchantId/promotions',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "brand": [],\n "brandExclusion": [],\n "contentLanguage": "",\n "couponValueType": "",\n "freeGiftDescription": "",\n "freeGiftItemId": "",\n "freeGiftValue": {\n "currency": "",\n "value": ""\n },\n "genericRedemptionCode": "",\n "getThisQuantityDiscounted": 0,\n "id": "",\n "itemGroupId": [],\n "itemGroupIdExclusion": [],\n "itemId": [],\n "itemIdExclusion": [],\n "limitQuantity": 0,\n "limitValue": {},\n "longTitle": "",\n "minimumPurchaseAmount": {},\n "minimumPurchaseQuantity": 0,\n "moneyBudget": {},\n "moneyOffAmount": {},\n "offerType": "",\n "orderLimit": 0,\n "percentOff": 0,\n "productApplicability": "",\n "productType": [],\n "productTypeExclusion": [],\n "promotionDestinationIds": [],\n "promotionDisplayDates": "",\n "promotionDisplayTimePeriod": {\n "endTime": "",\n "startTime": ""\n },\n "promotionEffectiveDates": "",\n "promotionEffectiveTimePeriod": {},\n "promotionId": "",\n "promotionStatus": {\n "creationDate": "",\n "destinationStatuses": [\n {\n "destination": "",\n "status": ""\n }\n ],\n "lastUpdateDate": "",\n "promotionIssue": [\n {\n "code": "",\n "detail": ""\n }\n ]\n },\n "promotionUrl": "",\n "redemptionChannel": [],\n "shippingServiceNames": [],\n "storeApplicability": "",\n "storeCode": [],\n "storeCodeExclusion": [],\n "targetCountry": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/promotions")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/promotions',
headers: {
'content-type': 'application/json'
}
};
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({
brand: [],
brandExclusion: [],
contentLanguage: '',
couponValueType: '',
freeGiftDescription: '',
freeGiftItemId: '',
freeGiftValue: {currency: '', value: ''},
genericRedemptionCode: '',
getThisQuantityDiscounted: 0,
id: '',
itemGroupId: [],
itemGroupIdExclusion: [],
itemId: [],
itemIdExclusion: [],
limitQuantity: 0,
limitValue: {},
longTitle: '',
minimumPurchaseAmount: {},
minimumPurchaseQuantity: 0,
moneyBudget: {},
moneyOffAmount: {},
offerType: '',
orderLimit: 0,
percentOff: 0,
productApplicability: '',
productType: [],
productTypeExclusion: [],
promotionDestinationIds: [],
promotionDisplayDates: '',
promotionDisplayTimePeriod: {endTime: '', startTime: ''},
promotionEffectiveDates: '',
promotionEffectiveTimePeriod: {},
promotionId: '',
promotionStatus: {
creationDate: '',
destinationStatuses: [{destination: '', status: ''}],
lastUpdateDate: '',
promotionIssue: [{code: '', detail: ''}]
},
promotionUrl: '',
redemptionChannel: [],
shippingServiceNames: [],
storeApplicability: '',
storeCode: [],
storeCodeExclusion: [],
targetCountry: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/promotions',
headers: {'content-type': 'application/json'},
body: {
brand: [],
brandExclusion: [],
contentLanguage: '',
couponValueType: '',
freeGiftDescription: '',
freeGiftItemId: '',
freeGiftValue: {currency: '', value: ''},
genericRedemptionCode: '',
getThisQuantityDiscounted: 0,
id: '',
itemGroupId: [],
itemGroupIdExclusion: [],
itemId: [],
itemIdExclusion: [],
limitQuantity: 0,
limitValue: {},
longTitle: '',
minimumPurchaseAmount: {},
minimumPurchaseQuantity: 0,
moneyBudget: {},
moneyOffAmount: {},
offerType: '',
orderLimit: 0,
percentOff: 0,
productApplicability: '',
productType: [],
productTypeExclusion: [],
promotionDestinationIds: [],
promotionDisplayDates: '',
promotionDisplayTimePeriod: {endTime: '', startTime: ''},
promotionEffectiveDates: '',
promotionEffectiveTimePeriod: {},
promotionId: '',
promotionStatus: {
creationDate: '',
destinationStatuses: [{destination: '', status: ''}],
lastUpdateDate: '',
promotionIssue: [{code: '', detail: ''}]
},
promotionUrl: '',
redemptionChannel: [],
shippingServiceNames: [],
storeApplicability: '',
storeCode: [],
storeCodeExclusion: [],
targetCountry: ''
},
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}}/:merchantId/promotions');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
brand: [],
brandExclusion: [],
contentLanguage: '',
couponValueType: '',
freeGiftDescription: '',
freeGiftItemId: '',
freeGiftValue: {
currency: '',
value: ''
},
genericRedemptionCode: '',
getThisQuantityDiscounted: 0,
id: '',
itemGroupId: [],
itemGroupIdExclusion: [],
itemId: [],
itemIdExclusion: [],
limitQuantity: 0,
limitValue: {},
longTitle: '',
minimumPurchaseAmount: {},
minimumPurchaseQuantity: 0,
moneyBudget: {},
moneyOffAmount: {},
offerType: '',
orderLimit: 0,
percentOff: 0,
productApplicability: '',
productType: [],
productTypeExclusion: [],
promotionDestinationIds: [],
promotionDisplayDates: '',
promotionDisplayTimePeriod: {
endTime: '',
startTime: ''
},
promotionEffectiveDates: '',
promotionEffectiveTimePeriod: {},
promotionId: '',
promotionStatus: {
creationDate: '',
destinationStatuses: [
{
destination: '',
status: ''
}
],
lastUpdateDate: '',
promotionIssue: [
{
code: '',
detail: ''
}
]
},
promotionUrl: '',
redemptionChannel: [],
shippingServiceNames: [],
storeApplicability: '',
storeCode: [],
storeCodeExclusion: [],
targetCountry: ''
});
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}}/:merchantId/promotions',
headers: {'content-type': 'application/json'},
data: {
brand: [],
brandExclusion: [],
contentLanguage: '',
couponValueType: '',
freeGiftDescription: '',
freeGiftItemId: '',
freeGiftValue: {currency: '', value: ''},
genericRedemptionCode: '',
getThisQuantityDiscounted: 0,
id: '',
itemGroupId: [],
itemGroupIdExclusion: [],
itemId: [],
itemIdExclusion: [],
limitQuantity: 0,
limitValue: {},
longTitle: '',
minimumPurchaseAmount: {},
minimumPurchaseQuantity: 0,
moneyBudget: {},
moneyOffAmount: {},
offerType: '',
orderLimit: 0,
percentOff: 0,
productApplicability: '',
productType: [],
productTypeExclusion: [],
promotionDestinationIds: [],
promotionDisplayDates: '',
promotionDisplayTimePeriod: {endTime: '', startTime: ''},
promotionEffectiveDates: '',
promotionEffectiveTimePeriod: {},
promotionId: '',
promotionStatus: {
creationDate: '',
destinationStatuses: [{destination: '', status: ''}],
lastUpdateDate: '',
promotionIssue: [{code: '', detail: ''}]
},
promotionUrl: '',
redemptionChannel: [],
shippingServiceNames: [],
storeApplicability: '',
storeCode: [],
storeCodeExclusion: [],
targetCountry: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/promotions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"brand":[],"brandExclusion":[],"contentLanguage":"","couponValueType":"","freeGiftDescription":"","freeGiftItemId":"","freeGiftValue":{"currency":"","value":""},"genericRedemptionCode":"","getThisQuantityDiscounted":0,"id":"","itemGroupId":[],"itemGroupIdExclusion":[],"itemId":[],"itemIdExclusion":[],"limitQuantity":0,"limitValue":{},"longTitle":"","minimumPurchaseAmount":{},"minimumPurchaseQuantity":0,"moneyBudget":{},"moneyOffAmount":{},"offerType":"","orderLimit":0,"percentOff":0,"productApplicability":"","productType":[],"productTypeExclusion":[],"promotionDestinationIds":[],"promotionDisplayDates":"","promotionDisplayTimePeriod":{"endTime":"","startTime":""},"promotionEffectiveDates":"","promotionEffectiveTimePeriod":{},"promotionId":"","promotionStatus":{"creationDate":"","destinationStatuses":[{"destination":"","status":""}],"lastUpdateDate":"","promotionIssue":[{"code":"","detail":""}]},"promotionUrl":"","redemptionChannel":[],"shippingServiceNames":[],"storeApplicability":"","storeCode":[],"storeCodeExclusion":[],"targetCountry":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"brand": @[ ],
@"brandExclusion": @[ ],
@"contentLanguage": @"",
@"couponValueType": @"",
@"freeGiftDescription": @"",
@"freeGiftItemId": @"",
@"freeGiftValue": @{ @"currency": @"", @"value": @"" },
@"genericRedemptionCode": @"",
@"getThisQuantityDiscounted": @0,
@"id": @"",
@"itemGroupId": @[ ],
@"itemGroupIdExclusion": @[ ],
@"itemId": @[ ],
@"itemIdExclusion": @[ ],
@"limitQuantity": @0,
@"limitValue": @{ },
@"longTitle": @"",
@"minimumPurchaseAmount": @{ },
@"minimumPurchaseQuantity": @0,
@"moneyBudget": @{ },
@"moneyOffAmount": @{ },
@"offerType": @"",
@"orderLimit": @0,
@"percentOff": @0,
@"productApplicability": @"",
@"productType": @[ ],
@"productTypeExclusion": @[ ],
@"promotionDestinationIds": @[ ],
@"promotionDisplayDates": @"",
@"promotionDisplayTimePeriod": @{ @"endTime": @"", @"startTime": @"" },
@"promotionEffectiveDates": @"",
@"promotionEffectiveTimePeriod": @{ },
@"promotionId": @"",
@"promotionStatus": @{ @"creationDate": @"", @"destinationStatuses": @[ @{ @"destination": @"", @"status": @"" } ], @"lastUpdateDate": @"", @"promotionIssue": @[ @{ @"code": @"", @"detail": @"" } ] },
@"promotionUrl": @"",
@"redemptionChannel": @[ ],
@"shippingServiceNames": @[ ],
@"storeApplicability": @"",
@"storeCode": @[ ],
@"storeCodeExclusion": @[ ],
@"targetCountry": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/promotions"]
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}}/:merchantId/promotions" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/promotions",
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([
'brand' => [
],
'brandExclusion' => [
],
'contentLanguage' => '',
'couponValueType' => '',
'freeGiftDescription' => '',
'freeGiftItemId' => '',
'freeGiftValue' => [
'currency' => '',
'value' => ''
],
'genericRedemptionCode' => '',
'getThisQuantityDiscounted' => 0,
'id' => '',
'itemGroupId' => [
],
'itemGroupIdExclusion' => [
],
'itemId' => [
],
'itemIdExclusion' => [
],
'limitQuantity' => 0,
'limitValue' => [
],
'longTitle' => '',
'minimumPurchaseAmount' => [
],
'minimumPurchaseQuantity' => 0,
'moneyBudget' => [
],
'moneyOffAmount' => [
],
'offerType' => '',
'orderLimit' => 0,
'percentOff' => 0,
'productApplicability' => '',
'productType' => [
],
'productTypeExclusion' => [
],
'promotionDestinationIds' => [
],
'promotionDisplayDates' => '',
'promotionDisplayTimePeriod' => [
'endTime' => '',
'startTime' => ''
],
'promotionEffectiveDates' => '',
'promotionEffectiveTimePeriod' => [
],
'promotionId' => '',
'promotionStatus' => [
'creationDate' => '',
'destinationStatuses' => [
[
'destination' => '',
'status' => ''
]
],
'lastUpdateDate' => '',
'promotionIssue' => [
[
'code' => '',
'detail' => ''
]
]
],
'promotionUrl' => '',
'redemptionChannel' => [
],
'shippingServiceNames' => [
],
'storeApplicability' => '',
'storeCode' => [
],
'storeCodeExclusion' => [
],
'targetCountry' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/promotions', [
'body' => '{
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": {
"currency": "",
"value": ""
},
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": {},
"longTitle": "",
"minimumPurchaseAmount": {},
"minimumPurchaseQuantity": 0,
"moneyBudget": {},
"moneyOffAmount": {},
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": {
"endTime": "",
"startTime": ""
},
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": {},
"promotionId": "",
"promotionStatus": {
"creationDate": "",
"destinationStatuses": [
{
"destination": "",
"status": ""
}
],
"lastUpdateDate": "",
"promotionIssue": [
{
"code": "",
"detail": ""
}
]
},
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/promotions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'brand' => [
],
'brandExclusion' => [
],
'contentLanguage' => '',
'couponValueType' => '',
'freeGiftDescription' => '',
'freeGiftItemId' => '',
'freeGiftValue' => [
'currency' => '',
'value' => ''
],
'genericRedemptionCode' => '',
'getThisQuantityDiscounted' => 0,
'id' => '',
'itemGroupId' => [
],
'itemGroupIdExclusion' => [
],
'itemId' => [
],
'itemIdExclusion' => [
],
'limitQuantity' => 0,
'limitValue' => [
],
'longTitle' => '',
'minimumPurchaseAmount' => [
],
'minimumPurchaseQuantity' => 0,
'moneyBudget' => [
],
'moneyOffAmount' => [
],
'offerType' => '',
'orderLimit' => 0,
'percentOff' => 0,
'productApplicability' => '',
'productType' => [
],
'productTypeExclusion' => [
],
'promotionDestinationIds' => [
],
'promotionDisplayDates' => '',
'promotionDisplayTimePeriod' => [
'endTime' => '',
'startTime' => ''
],
'promotionEffectiveDates' => '',
'promotionEffectiveTimePeriod' => [
],
'promotionId' => '',
'promotionStatus' => [
'creationDate' => '',
'destinationStatuses' => [
[
'destination' => '',
'status' => ''
]
],
'lastUpdateDate' => '',
'promotionIssue' => [
[
'code' => '',
'detail' => ''
]
]
],
'promotionUrl' => '',
'redemptionChannel' => [
],
'shippingServiceNames' => [
],
'storeApplicability' => '',
'storeCode' => [
],
'storeCodeExclusion' => [
],
'targetCountry' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'brand' => [
],
'brandExclusion' => [
],
'contentLanguage' => '',
'couponValueType' => '',
'freeGiftDescription' => '',
'freeGiftItemId' => '',
'freeGiftValue' => [
'currency' => '',
'value' => ''
],
'genericRedemptionCode' => '',
'getThisQuantityDiscounted' => 0,
'id' => '',
'itemGroupId' => [
],
'itemGroupIdExclusion' => [
],
'itemId' => [
],
'itemIdExclusion' => [
],
'limitQuantity' => 0,
'limitValue' => [
],
'longTitle' => '',
'minimumPurchaseAmount' => [
],
'minimumPurchaseQuantity' => 0,
'moneyBudget' => [
],
'moneyOffAmount' => [
],
'offerType' => '',
'orderLimit' => 0,
'percentOff' => 0,
'productApplicability' => '',
'productType' => [
],
'productTypeExclusion' => [
],
'promotionDestinationIds' => [
],
'promotionDisplayDates' => '',
'promotionDisplayTimePeriod' => [
'endTime' => '',
'startTime' => ''
],
'promotionEffectiveDates' => '',
'promotionEffectiveTimePeriod' => [
],
'promotionId' => '',
'promotionStatus' => [
'creationDate' => '',
'destinationStatuses' => [
[
'destination' => '',
'status' => ''
]
],
'lastUpdateDate' => '',
'promotionIssue' => [
[
'code' => '',
'detail' => ''
]
]
],
'promotionUrl' => '',
'redemptionChannel' => [
],
'shippingServiceNames' => [
],
'storeApplicability' => '',
'storeCode' => [
],
'storeCodeExclusion' => [
],
'targetCountry' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/promotions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/promotions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": {
"currency": "",
"value": ""
},
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": {},
"longTitle": "",
"minimumPurchaseAmount": {},
"minimumPurchaseQuantity": 0,
"moneyBudget": {},
"moneyOffAmount": {},
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": {
"endTime": "",
"startTime": ""
},
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": {},
"promotionId": "",
"promotionStatus": {
"creationDate": "",
"destinationStatuses": [
{
"destination": "",
"status": ""
}
],
"lastUpdateDate": "",
"promotionIssue": [
{
"code": "",
"detail": ""
}
]
},
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/promotions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": {
"currency": "",
"value": ""
},
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": {},
"longTitle": "",
"minimumPurchaseAmount": {},
"minimumPurchaseQuantity": 0,
"moneyBudget": {},
"moneyOffAmount": {},
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": {
"endTime": "",
"startTime": ""
},
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": {},
"promotionId": "",
"promotionStatus": {
"creationDate": "",
"destinationStatuses": [
{
"destination": "",
"status": ""
}
],
"lastUpdateDate": "",
"promotionIssue": [
{
"code": "",
"detail": ""
}
]
},
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/promotions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/promotions"
payload = {
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": {
"currency": "",
"value": ""
},
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": {},
"longTitle": "",
"minimumPurchaseAmount": {},
"minimumPurchaseQuantity": 0,
"moneyBudget": {},
"moneyOffAmount": {},
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": {
"endTime": "",
"startTime": ""
},
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": {},
"promotionId": "",
"promotionStatus": {
"creationDate": "",
"destinationStatuses": [
{
"destination": "",
"status": ""
}
],
"lastUpdateDate": "",
"promotionIssue": [
{
"code": "",
"detail": ""
}
]
},
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/promotions"
payload <- "{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/promotions")
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 \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\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.post('/baseUrl/:merchantId/promotions') do |req|
req.body = "{\n \"brand\": [],\n \"brandExclusion\": [],\n \"contentLanguage\": \"\",\n \"couponValueType\": \"\",\n \"freeGiftDescription\": \"\",\n \"freeGiftItemId\": \"\",\n \"freeGiftValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"genericRedemptionCode\": \"\",\n \"getThisQuantityDiscounted\": 0,\n \"id\": \"\",\n \"itemGroupId\": [],\n \"itemGroupIdExclusion\": [],\n \"itemId\": [],\n \"itemIdExclusion\": [],\n \"limitQuantity\": 0,\n \"limitValue\": {},\n \"longTitle\": \"\",\n \"minimumPurchaseAmount\": {},\n \"minimumPurchaseQuantity\": 0,\n \"moneyBudget\": {},\n \"moneyOffAmount\": {},\n \"offerType\": \"\",\n \"orderLimit\": 0,\n \"percentOff\": 0,\n \"productApplicability\": \"\",\n \"productType\": [],\n \"productTypeExclusion\": [],\n \"promotionDestinationIds\": [],\n \"promotionDisplayDates\": \"\",\n \"promotionDisplayTimePeriod\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"promotionEffectiveDates\": \"\",\n \"promotionEffectiveTimePeriod\": {},\n \"promotionId\": \"\",\n \"promotionStatus\": {\n \"creationDate\": \"\",\n \"destinationStatuses\": [\n {\n \"destination\": \"\",\n \"status\": \"\"\n }\n ],\n \"lastUpdateDate\": \"\",\n \"promotionIssue\": [\n {\n \"code\": \"\",\n \"detail\": \"\"\n }\n ]\n },\n \"promotionUrl\": \"\",\n \"redemptionChannel\": [],\n \"shippingServiceNames\": [],\n \"storeApplicability\": \"\",\n \"storeCode\": [],\n \"storeCodeExclusion\": [],\n \"targetCountry\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/promotions";
let payload = json!({
"brand": (),
"brandExclusion": (),
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": json!({
"currency": "",
"value": ""
}),
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": (),
"itemGroupIdExclusion": (),
"itemId": (),
"itemIdExclusion": (),
"limitQuantity": 0,
"limitValue": json!({}),
"longTitle": "",
"minimumPurchaseAmount": json!({}),
"minimumPurchaseQuantity": 0,
"moneyBudget": json!({}),
"moneyOffAmount": json!({}),
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": (),
"productTypeExclusion": (),
"promotionDestinationIds": (),
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": json!({
"endTime": "",
"startTime": ""
}),
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": json!({}),
"promotionId": "",
"promotionStatus": json!({
"creationDate": "",
"destinationStatuses": (
json!({
"destination": "",
"status": ""
})
),
"lastUpdateDate": "",
"promotionIssue": (
json!({
"code": "",
"detail": ""
})
)
}),
"promotionUrl": "",
"redemptionChannel": (),
"shippingServiceNames": (),
"storeApplicability": "",
"storeCode": (),
"storeCodeExclusion": (),
"targetCountry": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/promotions \
--header 'content-type: application/json' \
--data '{
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": {
"currency": "",
"value": ""
},
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": {},
"longTitle": "",
"minimumPurchaseAmount": {},
"minimumPurchaseQuantity": 0,
"moneyBudget": {},
"moneyOffAmount": {},
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": {
"endTime": "",
"startTime": ""
},
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": {},
"promotionId": "",
"promotionStatus": {
"creationDate": "",
"destinationStatuses": [
{
"destination": "",
"status": ""
}
],
"lastUpdateDate": "",
"promotionIssue": [
{
"code": "",
"detail": ""
}
]
},
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
}'
echo '{
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": {
"currency": "",
"value": ""
},
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": {},
"longTitle": "",
"minimumPurchaseAmount": {},
"minimumPurchaseQuantity": 0,
"moneyBudget": {},
"moneyOffAmount": {},
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": {
"endTime": "",
"startTime": ""
},
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": {},
"promotionId": "",
"promotionStatus": {
"creationDate": "",
"destinationStatuses": [
{
"destination": "",
"status": ""
}
],
"lastUpdateDate": "",
"promotionIssue": [
{
"code": "",
"detail": ""
}
]
},
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
}' | \
http POST {{baseUrl}}/:merchantId/promotions \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "brand": [],\n "brandExclusion": [],\n "contentLanguage": "",\n "couponValueType": "",\n "freeGiftDescription": "",\n "freeGiftItemId": "",\n "freeGiftValue": {\n "currency": "",\n "value": ""\n },\n "genericRedemptionCode": "",\n "getThisQuantityDiscounted": 0,\n "id": "",\n "itemGroupId": [],\n "itemGroupIdExclusion": [],\n "itemId": [],\n "itemIdExclusion": [],\n "limitQuantity": 0,\n "limitValue": {},\n "longTitle": "",\n "minimumPurchaseAmount": {},\n "minimumPurchaseQuantity": 0,\n "moneyBudget": {},\n "moneyOffAmount": {},\n "offerType": "",\n "orderLimit": 0,\n "percentOff": 0,\n "productApplicability": "",\n "productType": [],\n "productTypeExclusion": [],\n "promotionDestinationIds": [],\n "promotionDisplayDates": "",\n "promotionDisplayTimePeriod": {\n "endTime": "",\n "startTime": ""\n },\n "promotionEffectiveDates": "",\n "promotionEffectiveTimePeriod": {},\n "promotionId": "",\n "promotionStatus": {\n "creationDate": "",\n "destinationStatuses": [\n {\n "destination": "",\n "status": ""\n }\n ],\n "lastUpdateDate": "",\n "promotionIssue": [\n {\n "code": "",\n "detail": ""\n }\n ]\n },\n "promotionUrl": "",\n "redemptionChannel": [],\n "shippingServiceNames": [],\n "storeApplicability": "",\n "storeCode": [],\n "storeCodeExclusion": [],\n "targetCountry": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/promotions
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"brand": [],
"brandExclusion": [],
"contentLanguage": "",
"couponValueType": "",
"freeGiftDescription": "",
"freeGiftItemId": "",
"freeGiftValue": [
"currency": "",
"value": ""
],
"genericRedemptionCode": "",
"getThisQuantityDiscounted": 0,
"id": "",
"itemGroupId": [],
"itemGroupIdExclusion": [],
"itemId": [],
"itemIdExclusion": [],
"limitQuantity": 0,
"limitValue": [],
"longTitle": "",
"minimumPurchaseAmount": [],
"minimumPurchaseQuantity": 0,
"moneyBudget": [],
"moneyOffAmount": [],
"offerType": "",
"orderLimit": 0,
"percentOff": 0,
"productApplicability": "",
"productType": [],
"productTypeExclusion": [],
"promotionDestinationIds": [],
"promotionDisplayDates": "",
"promotionDisplayTimePeriod": [
"endTime": "",
"startTime": ""
],
"promotionEffectiveDates": "",
"promotionEffectiveTimePeriod": [],
"promotionId": "",
"promotionStatus": [
"creationDate": "",
"destinationStatuses": [
[
"destination": "",
"status": ""
]
],
"lastUpdateDate": "",
"promotionIssue": [
[
"code": "",
"detail": ""
]
]
],
"promotionUrl": "",
"redemptionChannel": [],
"shippingServiceNames": [],
"storeApplicability": "",
"storeCode": [],
"storeCodeExclusion": [],
"targetCountry": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/promotions")! 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()
GET
content.promotions.get
{{baseUrl}}/:merchantId/promotions/:id
QUERY PARAMS
merchantId
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/promotions/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/promotions/:id")
require "http/client"
url = "{{baseUrl}}/:merchantId/promotions/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/promotions/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/promotions/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/promotions/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/promotions/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/promotions/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/promotions/:id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/promotions/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/promotions/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/promotions/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/promotions/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/promotions/:id';
const options = {method: 'GET'};
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}}/:merchantId/promotions/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/promotions/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/promotions/:id',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/promotions/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/promotions/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/promotions/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/promotions/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/promotions/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/promotions/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/promotions/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/promotions/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/promotions/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/promotions/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/promotions/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/promotions/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/promotions/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/promotions/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/promotions/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/promotions/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/promotions/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/promotions/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/promotions/:id
http GET {{baseUrl}}/:merchantId/promotions/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/promotions/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/promotions/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.pubsubnotificationsettings.get
{{baseUrl}}/:merchantId/pubsubnotificationsettings
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/pubsubnotificationsettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/pubsubnotificationsettings")
require "http/client"
url = "{{baseUrl}}/:merchantId/pubsubnotificationsettings"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/pubsubnotificationsettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/pubsubnotificationsettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/pubsubnotificationsettings"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/pubsubnotificationsettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/pubsubnotificationsettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/pubsubnotificationsettings"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/pubsubnotificationsettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/pubsubnotificationsettings")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/pubsubnotificationsettings');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pubsubnotificationsettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/pubsubnotificationsettings';
const options = {method: 'GET'};
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}}/:merchantId/pubsubnotificationsettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/pubsubnotificationsettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/pubsubnotificationsettings',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pubsubnotificationsettings'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/pubsubnotificationsettings');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/pubsubnotificationsettings'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/pubsubnotificationsettings';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/pubsubnotificationsettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/pubsubnotificationsettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/pubsubnotificationsettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/pubsubnotificationsettings');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/pubsubnotificationsettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/pubsubnotificationsettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/pubsubnotificationsettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/pubsubnotificationsettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/pubsubnotificationsettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/pubsubnotificationsettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/pubsubnotificationsettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/pubsubnotificationsettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/pubsubnotificationsettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/pubsubnotificationsettings";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/pubsubnotificationsettings
http GET {{baseUrl}}/:merchantId/pubsubnotificationsettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/pubsubnotificationsettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/pubsubnotificationsettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PUT
content.pubsubnotificationsettings.update
{{baseUrl}}/:merchantId/pubsubnotificationsettings
QUERY PARAMS
merchantId
BODY json
{
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/pubsubnotificationsettings");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/:merchantId/pubsubnotificationsettings" {:content-type :json
:form-params {:cloudTopicName ""
:kind ""
:registeredEvents []}})
require "http/client"
url = "{{baseUrl}}/:merchantId/pubsubnotificationsettings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\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}}/:merchantId/pubsubnotificationsettings"),
Content = new StringContent("{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\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}}/:merchantId/pubsubnotificationsettings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/pubsubnotificationsettings"
payload := strings.NewReader("{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}")
req, _ := http.NewRequest("PUT", 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(res)
fmt.Println(string(body))
}
PUT /baseUrl/:merchantId/pubsubnotificationsettings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 66
{
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/:merchantId/pubsubnotificationsettings")
.setHeader("content-type", "application/json")
.setBody("{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/pubsubnotificationsettings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\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 \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/pubsubnotificationsettings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/:merchantId/pubsubnotificationsettings")
.header("content-type", "application/json")
.body("{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}")
.asString();
const data = JSON.stringify({
cloudTopicName: '',
kind: '',
registeredEvents: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/:merchantId/pubsubnotificationsettings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/pubsubnotificationsettings',
headers: {'content-type': 'application/json'},
data: {cloudTopicName: '', kind: '', registeredEvents: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/pubsubnotificationsettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"cloudTopicName":"","kind":"","registeredEvents":[]}'
};
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}}/:merchantId/pubsubnotificationsettings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cloudTopicName": "",\n "kind": "",\n "registeredEvents": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/pubsubnotificationsettings")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/pubsubnotificationsettings',
headers: {
'content-type': 'application/json'
}
};
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({cloudTopicName: '', kind: '', registeredEvents: []}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/pubsubnotificationsettings',
headers: {'content-type': 'application/json'},
body: {cloudTopicName: '', kind: '', registeredEvents: []},
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}}/:merchantId/pubsubnotificationsettings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cloudTopicName: '',
kind: '',
registeredEvents: []
});
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}}/:merchantId/pubsubnotificationsettings',
headers: {'content-type': 'application/json'},
data: {cloudTopicName: '', kind: '', registeredEvents: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/pubsubnotificationsettings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"cloudTopicName":"","kind":"","registeredEvents":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"cloudTopicName": @"",
@"kind": @"",
@"registeredEvents": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/pubsubnotificationsettings"]
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}}/:merchantId/pubsubnotificationsettings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/pubsubnotificationsettings",
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([
'cloudTopicName' => '',
'kind' => '',
'registeredEvents' => [
]
]),
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;
}
request('PUT', '{{baseUrl}}/:merchantId/pubsubnotificationsettings', [
'body' => '{
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/pubsubnotificationsettings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cloudTopicName' => '',
'kind' => '',
'registeredEvents' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cloudTopicName' => '',
'kind' => '',
'registeredEvents' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/pubsubnotificationsettings');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/pubsubnotificationsettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/pubsubnotificationsettings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/:merchantId/pubsubnotificationsettings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/pubsubnotificationsettings"
payload = {
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/pubsubnotificationsettings"
payload <- "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/pubsubnotificationsettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\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/:merchantId/pubsubnotificationsettings') do |req|
req.body = "{\n \"cloudTopicName\": \"\",\n \"kind\": \"\",\n \"registeredEvents\": []\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}}/:merchantId/pubsubnotificationsettings";
let payload = json!({
"cloudTopicName": "",
"kind": "",
"registeredEvents": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".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}}/:merchantId/pubsubnotificationsettings \
--header 'content-type: application/json' \
--data '{
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
}'
echo '{
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
}' | \
http PUT {{baseUrl}}/:merchantId/pubsubnotificationsettings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "cloudTopicName": "",\n "kind": "",\n "registeredEvents": []\n}' \
--output-document \
- {{baseUrl}}/:merchantId/pubsubnotificationsettings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cloudTopicName": "",
"kind": "",
"registeredEvents": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/pubsubnotificationsettings")! 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()
GET
content.quotas.list
{{baseUrl}}/:merchantId/quotas
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/quotas");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/quotas")
require "http/client"
url = "{{baseUrl}}/:merchantId/quotas"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/quotas"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/quotas");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/quotas"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/quotas HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/quotas")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/quotas"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/quotas")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/quotas")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/quotas');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/quotas'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/quotas';
const options = {method: 'GET'};
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}}/:merchantId/quotas',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/quotas")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/quotas',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/quotas'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/quotas');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/quotas'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/quotas';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/quotas"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/quotas" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/quotas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/quotas');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/quotas');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/quotas');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/quotas' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/quotas' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/quotas")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/quotas"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/quotas"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/quotas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/quotas') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/quotas";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/quotas
http GET {{baseUrl}}/:merchantId/quotas
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/quotas
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/quotas")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.recommendations.generate
{{baseUrl}}/:merchantId/recommendations/generate
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/recommendations/generate");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/recommendations/generate")
require "http/client"
url = "{{baseUrl}}/:merchantId/recommendations/generate"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/recommendations/generate"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/recommendations/generate");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/recommendations/generate"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/recommendations/generate HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/recommendations/generate")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/recommendations/generate"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/recommendations/generate")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/recommendations/generate")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/recommendations/generate');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/recommendations/generate'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/recommendations/generate';
const options = {method: 'GET'};
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}}/:merchantId/recommendations/generate',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/recommendations/generate")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/recommendations/generate',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/recommendations/generate'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/recommendations/generate');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/recommendations/generate'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/recommendations/generate';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/recommendations/generate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/recommendations/generate" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/recommendations/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/recommendations/generate');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/recommendations/generate');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/recommendations/generate');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/recommendations/generate' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/recommendations/generate' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/recommendations/generate")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/recommendations/generate"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/recommendations/generate"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/recommendations/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/recommendations/generate') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/recommendations/generate";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/recommendations/generate
http GET {{baseUrl}}/:merchantId/recommendations/generate
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/recommendations/generate
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/recommendations/generate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.recommendations.reportInteraction
{{baseUrl}}/:merchantId/recommendations/reportInteraction
QUERY PARAMS
merchantId
BODY json
{
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/recommendations/reportInteraction");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/recommendations/reportInteraction" {:content-type :json
:form-params {:interactionType ""
:responseToken ""
:subtype ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/recommendations/reportInteraction"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\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}}/:merchantId/recommendations/reportInteraction"),
Content = new StringContent("{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\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}}/:merchantId/recommendations/reportInteraction");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/recommendations/reportInteraction"
payload := strings.NewReader("{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/recommendations/reportInteraction HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 81
{
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/recommendations/reportInteraction")
.setHeader("content-type", "application/json")
.setBody("{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/recommendations/reportInteraction"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\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 \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/recommendations/reportInteraction")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/recommendations/reportInteraction")
.header("content-type", "application/json")
.body("{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
interactionType: '',
responseToken: '',
subtype: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/recommendations/reportInteraction');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/recommendations/reportInteraction',
headers: {'content-type': 'application/json'},
data: {interactionType: '', responseToken: '', subtype: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/recommendations/reportInteraction';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"interactionType":"","responseToken":"","subtype":"","type":""}'
};
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}}/:merchantId/recommendations/reportInteraction',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "interactionType": "",\n "responseToken": "",\n "subtype": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/recommendations/reportInteraction")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/recommendations/reportInteraction',
headers: {
'content-type': 'application/json'
}
};
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({interactionType: '', responseToken: '', subtype: '', type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/recommendations/reportInteraction',
headers: {'content-type': 'application/json'},
body: {interactionType: '', responseToken: '', subtype: '', type: ''},
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}}/:merchantId/recommendations/reportInteraction');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
interactionType: '',
responseToken: '',
subtype: '',
type: ''
});
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}}/:merchantId/recommendations/reportInteraction',
headers: {'content-type': 'application/json'},
data: {interactionType: '', responseToken: '', subtype: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/recommendations/reportInteraction';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"interactionType":"","responseToken":"","subtype":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"interactionType": @"",
@"responseToken": @"",
@"subtype": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/recommendations/reportInteraction"]
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}}/:merchantId/recommendations/reportInteraction" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/recommendations/reportInteraction",
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([
'interactionType' => '',
'responseToken' => '',
'subtype' => '',
'type' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/recommendations/reportInteraction', [
'body' => '{
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/recommendations/reportInteraction');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'interactionType' => '',
'responseToken' => '',
'subtype' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'interactionType' => '',
'responseToken' => '',
'subtype' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/recommendations/reportInteraction');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/recommendations/reportInteraction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/recommendations/reportInteraction' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/recommendations/reportInteraction", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/recommendations/reportInteraction"
payload = {
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/recommendations/reportInteraction"
payload <- "{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/recommendations/reportInteraction")
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 \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\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.post('/baseUrl/:merchantId/recommendations/reportInteraction') do |req|
req.body = "{\n \"interactionType\": \"\",\n \"responseToken\": \"\",\n \"subtype\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/recommendations/reportInteraction";
let payload = json!({
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/recommendations/reportInteraction \
--header 'content-type: application/json' \
--data '{
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
}'
echo '{
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
}' | \
http POST {{baseUrl}}/:merchantId/recommendations/reportInteraction \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "interactionType": "",\n "responseToken": "",\n "subtype": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/recommendations/reportInteraction
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"interactionType": "",
"responseToken": "",
"subtype": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/recommendations/reportInteraction")! 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()
POST
content.regionalinventory.custombatch
{{baseUrl}}/regionalinventory/batch
BODY json
{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/regionalinventory/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/regionalinventory/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:merchantId ""
:method ""
:productId ""
:regionalInventory {:availability ""
:customAttributes [{:groupValues []
:name ""
:value ""}]
:kind ""
:price {:currency ""
:value ""}
:regionId ""
:salePrice {}
:salePriceEffectiveDate ""}}]}})
require "http/client"
url = "{{baseUrl}}/regionalinventory/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\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}}/regionalinventory/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\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}}/regionalinventory/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/regionalinventory/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/regionalinventory/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 514
{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/regionalinventory/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/regionalinventory/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/regionalinventory/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/regionalinventory/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
productId: '',
regionalInventory: {
availability: '',
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
kind: '',
price: {
currency: '',
value: ''
},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/regionalinventory/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/regionalinventory/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
productId: '',
regionalInventory: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
kind: '',
price: {currency: '', value: ''},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/regionalinventory/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"merchantId":"","method":"","productId":"","regionalInventory":{"availability":"","customAttributes":[{"groupValues":[],"name":"","value":""}],"kind":"","price":{"currency":"","value":""},"regionId":"","salePrice":{},"salePriceEffectiveDate":""}}]}'
};
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}}/regionalinventory/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "merchantId": "",\n "method": "",\n "productId": "",\n "regionalInventory": {\n "availability": "",\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "kind": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "regionId": "",\n "salePrice": {},\n "salePriceEffectiveDate": ""\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/regionalinventory/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/regionalinventory/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
productId: '',
regionalInventory: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
kind: '',
price: {currency: '', value: ''},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/regionalinventory/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
productId: '',
regionalInventory: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
kind: '',
price: {currency: '', value: ''},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}
}
]
},
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}}/regionalinventory/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
productId: '',
regionalInventory: {
availability: '',
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
kind: '',
price: {
currency: '',
value: ''
},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}
}
]
});
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}}/regionalinventory/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
productId: '',
regionalInventory: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
kind: '',
price: {currency: '', value: ''},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/regionalinventory/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"merchantId":"","method":"","productId":"","regionalInventory":{"availability":"","customAttributes":[{"groupValues":[],"name":"","value":""}],"kind":"","price":{"currency":"","value":""},"regionId":"","salePrice":{},"salePriceEffectiveDate":""}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"merchantId": @"", @"method": @"", @"productId": @"", @"regionalInventory": @{ @"availability": @"", @"customAttributes": @[ @{ @"groupValues": @[ ], @"name": @"", @"value": @"" } ], @"kind": @"", @"price": @{ @"currency": @"", @"value": @"" }, @"regionId": @"", @"salePrice": @{ }, @"salePriceEffectiveDate": @"" } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/regionalinventory/batch"]
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}}/regionalinventory/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/regionalinventory/batch",
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([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'productId' => '',
'regionalInventory' => [
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'regionId' => '',
'salePrice' => [
],
'salePriceEffectiveDate' => ''
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/regionalinventory/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/regionalinventory/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'productId' => '',
'regionalInventory' => [
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'regionId' => '',
'salePrice' => [
],
'salePriceEffectiveDate' => ''
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'productId' => '',
'regionalInventory' => [
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'regionId' => '',
'salePrice' => [
],
'salePriceEffectiveDate' => ''
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/regionalinventory/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/regionalinventory/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/regionalinventory/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/regionalinventory/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/regionalinventory/batch"
payload = { "entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/regionalinventory/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/regionalinventory/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\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.post('/baseUrl/regionalinventory/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"productId\": \"\",\n \"regionalInventory\": {\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n }\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/regionalinventory/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": json!({
"availability": "",
"customAttributes": (
json!({
"groupValues": (),
"name": "",
"value": ""
})
),
"kind": "",
"price": json!({
"currency": "",
"value": ""
}),
"regionId": "",
"salePrice": json!({}),
"salePriceEffectiveDate": ""
})
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/regionalinventory/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
}
]
}' | \
http POST {{baseUrl}}/regionalinventory/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "merchantId": "",\n "method": "",\n "productId": "",\n "regionalInventory": {\n "availability": "",\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "kind": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "regionId": "",\n "salePrice": {},\n "salePriceEffectiveDate": ""\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/regionalinventory/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"merchantId": "",
"method": "",
"productId": "",
"regionalInventory": [
"availability": "",
"customAttributes": [
[
"groupValues": [],
"name": "",
"value": ""
]
],
"kind": "",
"price": [
"currency": "",
"value": ""
],
"regionId": "",
"salePrice": [],
"salePriceEffectiveDate": ""
]
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/regionalinventory/batch")! 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()
POST
content.regionalinventory.insert
{{baseUrl}}/:merchantId/products/:productId/regionalinventory
QUERY PARAMS
merchantId
productId
BODY json
{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/products/:productId/regionalinventory");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/products/:productId/regionalinventory" {:content-type :json
:form-params {:availability ""
:customAttributes [{:groupValues []
:name ""
:value ""}]
:kind ""
:price {:currency ""
:value ""}
:regionId ""
:salePrice {}
:salePriceEffectiveDate ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/products/:productId/regionalinventory"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\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}}/:merchantId/products/:productId/regionalinventory"),
Content = new StringContent("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\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}}/:merchantId/products/:productId/regionalinventory");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/products/:productId/regionalinventory"
payload := strings.NewReader("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/products/:productId/regionalinventory HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 263
{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/products/:productId/regionalinventory")
.setHeader("content-type", "application/json")
.setBody("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/products/:productId/regionalinventory"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\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 \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId/regionalinventory")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/products/:productId/regionalinventory")
.header("content-type", "application/json")
.body("{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}")
.asString();
const data = JSON.stringify({
availability: '',
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
kind: '',
price: {
currency: '',
value: ''
},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/products/:productId/regionalinventory');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/products/:productId/regionalinventory',
headers: {'content-type': 'application/json'},
data: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
kind: '',
price: {currency: '', value: ''},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/products/:productId/regionalinventory';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"availability":"","customAttributes":[{"groupValues":[],"name":"","value":""}],"kind":"","price":{"currency":"","value":""},"regionId":"","salePrice":{},"salePriceEffectiveDate":""}'
};
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}}/:merchantId/products/:productId/regionalinventory',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "availability": "",\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "kind": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "regionId": "",\n "salePrice": {},\n "salePriceEffectiveDate": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/products/:productId/regionalinventory")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/products/:productId/regionalinventory',
headers: {
'content-type': 'application/json'
}
};
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({
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
kind: '',
price: {currency: '', value: ''},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/products/:productId/regionalinventory',
headers: {'content-type': 'application/json'},
body: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
kind: '',
price: {currency: '', value: ''},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
},
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}}/:merchantId/products/:productId/regionalinventory');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
availability: '',
customAttributes: [
{
groupValues: [],
name: '',
value: ''
}
],
kind: '',
price: {
currency: '',
value: ''
},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
});
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}}/:merchantId/products/:productId/regionalinventory',
headers: {'content-type': 'application/json'},
data: {
availability: '',
customAttributes: [{groupValues: [], name: '', value: ''}],
kind: '',
price: {currency: '', value: ''},
regionId: '',
salePrice: {},
salePriceEffectiveDate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/products/:productId/regionalinventory';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"availability":"","customAttributes":[{"groupValues":[],"name":"","value":""}],"kind":"","price":{"currency":"","value":""},"regionId":"","salePrice":{},"salePriceEffectiveDate":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"availability": @"",
@"customAttributes": @[ @{ @"groupValues": @[ ], @"name": @"", @"value": @"" } ],
@"kind": @"",
@"price": @{ @"currency": @"", @"value": @"" },
@"regionId": @"",
@"salePrice": @{ },
@"salePriceEffectiveDate": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/products/:productId/regionalinventory"]
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}}/:merchantId/products/:productId/regionalinventory" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/products/:productId/regionalinventory",
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([
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'regionId' => '',
'salePrice' => [
],
'salePriceEffectiveDate' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/products/:productId/regionalinventory', [
'body' => '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/products/:productId/regionalinventory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'regionId' => '',
'salePrice' => [
],
'salePriceEffectiveDate' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'availability' => '',
'customAttributes' => [
[
'groupValues' => [
],
'name' => '',
'value' => ''
]
],
'kind' => '',
'price' => [
'currency' => '',
'value' => ''
],
'regionId' => '',
'salePrice' => [
],
'salePriceEffectiveDate' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/products/:productId/regionalinventory');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/products/:productId/regionalinventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/products/:productId/regionalinventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/products/:productId/regionalinventory", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/products/:productId/regionalinventory"
payload = {
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/products/:productId/regionalinventory"
payload <- "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/products/:productId/regionalinventory")
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 \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\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.post('/baseUrl/:merchantId/products/:productId/regionalinventory') do |req|
req.body = "{\n \"availability\": \"\",\n \"customAttributes\": [\n {\n \"groupValues\": [],\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"kind\": \"\",\n \"price\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"regionId\": \"\",\n \"salePrice\": {},\n \"salePriceEffectiveDate\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/products/:productId/regionalinventory";
let payload = json!({
"availability": "",
"customAttributes": (
json!({
"groupValues": (),
"name": "",
"value": ""
})
),
"kind": "",
"price": json!({
"currency": "",
"value": ""
}),
"regionId": "",
"salePrice": json!({}),
"salePriceEffectiveDate": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/products/:productId/regionalinventory \
--header 'content-type: application/json' \
--data '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}'
echo '{
"availability": "",
"customAttributes": [
{
"groupValues": [],
"name": "",
"value": ""
}
],
"kind": "",
"price": {
"currency": "",
"value": ""
},
"regionId": "",
"salePrice": {},
"salePriceEffectiveDate": ""
}' | \
http POST {{baseUrl}}/:merchantId/products/:productId/regionalinventory \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "availability": "",\n "customAttributes": [\n {\n "groupValues": [],\n "name": "",\n "value": ""\n }\n ],\n "kind": "",\n "price": {\n "currency": "",\n "value": ""\n },\n "regionId": "",\n "salePrice": {},\n "salePriceEffectiveDate": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/products/:productId/regionalinventory
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"availability": "",
"customAttributes": [
[
"groupValues": [],
"name": "",
"value": ""
]
],
"kind": "",
"price": [
"currency": "",
"value": ""
],
"regionId": "",
"salePrice": [],
"salePriceEffectiveDate": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/products/:productId/regionalinventory")! 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()
POST
content.regions.create
{{baseUrl}}/:merchantId/regions
QUERY PARAMS
merchantId
BODY json
{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/regions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/regions" {:content-type :json
:form-params {:displayName ""
:geotargetArea {:geotargetCriteriaIds []}
:merchantId ""
:postalCodeArea {:postalCodes [{:begin ""
:end ""}]
:regionCode ""}
:regionId ""
:regionalInventoryEligible false
:shippingEligible false}})
require "http/client"
url = "{{baseUrl}}/:merchantId/regions"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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}}/:merchantId/regions"),
Content = new StringContent("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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}}/:merchantId/regions");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/regions"
payload := strings.NewReader("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/regions HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 316
{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/regions")
.setHeader("content-type", "application/json")
.setBody("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/regions"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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 \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/regions")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/regions")
.header("content-type", "application/json")
.body("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}")
.asString();
const data = JSON.stringify({
displayName: '',
geotargetArea: {
geotargetCriteriaIds: []
},
merchantId: '',
postalCodeArea: {
postalCodes: [
{
begin: '',
end: ''
}
],
regionCode: ''
},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/regions');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/regions',
headers: {'content-type': 'application/json'},
data: {
displayName: '',
geotargetArea: {geotargetCriteriaIds: []},
merchantId: '',
postalCodeArea: {postalCodes: [{begin: '', end: ''}], regionCode: ''},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/regions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"displayName":"","geotargetArea":{"geotargetCriteriaIds":[]},"merchantId":"","postalCodeArea":{"postalCodes":[{"begin":"","end":""}],"regionCode":""},"regionId":"","regionalInventoryEligible":false,"shippingEligible":false}'
};
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}}/:merchantId/regions',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "displayName": "",\n "geotargetArea": {\n "geotargetCriteriaIds": []\n },\n "merchantId": "",\n "postalCodeArea": {\n "postalCodes": [\n {\n "begin": "",\n "end": ""\n }\n ],\n "regionCode": ""\n },\n "regionId": "",\n "regionalInventoryEligible": false,\n "shippingEligible": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/regions")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/regions',
headers: {
'content-type': 'application/json'
}
};
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({
displayName: '',
geotargetArea: {geotargetCriteriaIds: []},
merchantId: '',
postalCodeArea: {postalCodes: [{begin: '', end: ''}], regionCode: ''},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/regions',
headers: {'content-type': 'application/json'},
body: {
displayName: '',
geotargetArea: {geotargetCriteriaIds: []},
merchantId: '',
postalCodeArea: {postalCodes: [{begin: '', end: ''}], regionCode: ''},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
},
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}}/:merchantId/regions');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
displayName: '',
geotargetArea: {
geotargetCriteriaIds: []
},
merchantId: '',
postalCodeArea: {
postalCodes: [
{
begin: '',
end: ''
}
],
regionCode: ''
},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
});
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}}/:merchantId/regions',
headers: {'content-type': 'application/json'},
data: {
displayName: '',
geotargetArea: {geotargetCriteriaIds: []},
merchantId: '',
postalCodeArea: {postalCodes: [{begin: '', end: ''}], regionCode: ''},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/regions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"displayName":"","geotargetArea":{"geotargetCriteriaIds":[]},"merchantId":"","postalCodeArea":{"postalCodes":[{"begin":"","end":""}],"regionCode":""},"regionId":"","regionalInventoryEligible":false,"shippingEligible":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"displayName": @"",
@"geotargetArea": @{ @"geotargetCriteriaIds": @[ ] },
@"merchantId": @"",
@"postalCodeArea": @{ @"postalCodes": @[ @{ @"begin": @"", @"end": @"" } ], @"regionCode": @"" },
@"regionId": @"",
@"regionalInventoryEligible": @NO,
@"shippingEligible": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/regions"]
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}}/:merchantId/regions" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/regions",
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([
'displayName' => '',
'geotargetArea' => [
'geotargetCriteriaIds' => [
]
],
'merchantId' => '',
'postalCodeArea' => [
'postalCodes' => [
[
'begin' => '',
'end' => ''
]
],
'regionCode' => ''
],
'regionId' => '',
'regionalInventoryEligible' => null,
'shippingEligible' => null
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/regions', [
'body' => '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/regions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'displayName' => '',
'geotargetArea' => [
'geotargetCriteriaIds' => [
]
],
'merchantId' => '',
'postalCodeArea' => [
'postalCodes' => [
[
'begin' => '',
'end' => ''
]
],
'regionCode' => ''
],
'regionId' => '',
'regionalInventoryEligible' => null,
'shippingEligible' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'displayName' => '',
'geotargetArea' => [
'geotargetCriteriaIds' => [
]
],
'merchantId' => '',
'postalCodeArea' => [
'postalCodes' => [
[
'begin' => '',
'end' => ''
]
],
'regionCode' => ''
],
'regionId' => '',
'regionalInventoryEligible' => null,
'shippingEligible' => null
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/regions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/regions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/regions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/regions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/regions"
payload = {
"displayName": "",
"geotargetArea": { "geotargetCriteriaIds": [] },
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": False,
"shippingEligible": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/regions"
payload <- "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/regions")
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 \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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.post('/baseUrl/:merchantId/regions') do |req|
req.body = "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/regions";
let payload = json!({
"displayName": "",
"geotargetArea": json!({"geotargetCriteriaIds": ()}),
"merchantId": "",
"postalCodeArea": json!({
"postalCodes": (
json!({
"begin": "",
"end": ""
})
),
"regionCode": ""
}),
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/regions \
--header 'content-type: application/json' \
--data '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}'
echo '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}' | \
http POST {{baseUrl}}/:merchantId/regions \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "displayName": "",\n "geotargetArea": {\n "geotargetCriteriaIds": []\n },\n "merchantId": "",\n "postalCodeArea": {\n "postalCodes": [\n {\n "begin": "",\n "end": ""\n }\n ],\n "regionCode": ""\n },\n "regionId": "",\n "regionalInventoryEligible": false,\n "shippingEligible": false\n}' \
--output-document \
- {{baseUrl}}/:merchantId/regions
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"displayName": "",
"geotargetArea": ["geotargetCriteriaIds": []],
"merchantId": "",
"postalCodeArea": [
"postalCodes": [
[
"begin": "",
"end": ""
]
],
"regionCode": ""
],
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/regions")! 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()
DELETE
content.regions.delete
{{baseUrl}}/:merchantId/regions/:regionId
QUERY PARAMS
merchantId
regionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/regions/:regionId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/regions/:regionId")
require "http/client"
url = "{{baseUrl}}/:merchantId/regions/:regionId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/regions/:regionId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/regions/:regionId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/regions/:regionId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/regions/:regionId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/regions/:regionId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/regions/:regionId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/regions/:regionId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/regions/:regionId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/regions/:regionId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/regions/:regionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/regions/:regionId';
const options = {method: 'DELETE'};
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}}/:merchantId/regions/:regionId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/regions/:regionId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/regions/:regionId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/regions/:regionId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/regions/:regionId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/regions/:regionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/regions/:regionId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/regions/:regionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/regions/:regionId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/regions/:regionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/regions/:regionId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/regions/:regionId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/regions/:regionId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/regions/:regionId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/regions/:regionId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/regions/:regionId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/regions/:regionId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/regions/:regionId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/regions/:regionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/regions/:regionId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/regions/:regionId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/regions/:regionId
http DELETE {{baseUrl}}/:merchantId/regions/:regionId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/regions/:regionId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/regions/:regionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.regions.get
{{baseUrl}}/:merchantId/regions/:regionId
QUERY PARAMS
merchantId
regionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/regions/:regionId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/regions/:regionId")
require "http/client"
url = "{{baseUrl}}/:merchantId/regions/:regionId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/regions/:regionId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/regions/:regionId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/regions/:regionId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/regions/:regionId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/regions/:regionId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/regions/:regionId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/regions/:regionId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/regions/:regionId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/regions/:regionId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/regions/:regionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/regions/:regionId';
const options = {method: 'GET'};
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}}/:merchantId/regions/:regionId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/regions/:regionId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/regions/:regionId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/regions/:regionId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/regions/:regionId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/regions/:regionId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/regions/:regionId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/regions/:regionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/regions/:regionId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/regions/:regionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/regions/:regionId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/regions/:regionId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/regions/:regionId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/regions/:regionId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/regions/:regionId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/regions/:regionId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/regions/:regionId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/regions/:regionId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/regions/:regionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/regions/:regionId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/regions/:regionId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/regions/:regionId
http GET {{baseUrl}}/:merchantId/regions/:regionId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/regions/:regionId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/regions/:regionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.regions.list
{{baseUrl}}/:merchantId/regions
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/regions");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/regions")
require "http/client"
url = "{{baseUrl}}/:merchantId/regions"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/regions"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/regions");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/regions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/regions HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/regions")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/regions"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/regions")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/regions")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/regions');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/regions'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/regions';
const options = {method: 'GET'};
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}}/:merchantId/regions',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/regions")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/regions',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/regions'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/regions');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/regions'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/regions';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/regions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/regions" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/regions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/regions');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/regions');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/regions');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/regions' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/regions' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/regions")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/regions"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/regions"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/regions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/regions') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/regions";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/regions
http GET {{baseUrl}}/:merchantId/regions
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/regions
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/regions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PATCH
content.regions.patch
{{baseUrl}}/:merchantId/regions/:regionId
QUERY PARAMS
merchantId
regionId
BODY json
{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/regions/:regionId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/:merchantId/regions/:regionId" {:content-type :json
:form-params {:displayName ""
:geotargetArea {:geotargetCriteriaIds []}
:merchantId ""
:postalCodeArea {:postalCodes [{:begin ""
:end ""}]
:regionCode ""}
:regionId ""
:regionalInventoryEligible false
:shippingEligible false}})
require "http/client"
url = "{{baseUrl}}/:merchantId/regions/:regionId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/:merchantId/regions/:regionId"),
Content = new StringContent("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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}}/:merchantId/regions/:regionId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/regions/:regionId"
payload := strings.NewReader("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}")
req, _ := http.NewRequest("PATCH", 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(res)
fmt.Println(string(body))
}
PATCH /baseUrl/:merchantId/regions/:regionId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 316
{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/:merchantId/regions/:regionId")
.setHeader("content-type", "application/json")
.setBody("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/regions/:regionId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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 \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/regions/:regionId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/:merchantId/regions/:regionId")
.header("content-type", "application/json")
.body("{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}")
.asString();
const data = JSON.stringify({
displayName: '',
geotargetArea: {
geotargetCriteriaIds: []
},
merchantId: '',
postalCodeArea: {
postalCodes: [
{
begin: '',
end: ''
}
],
regionCode: ''
},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/:merchantId/regions/:regionId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/regions/:regionId',
headers: {'content-type': 'application/json'},
data: {
displayName: '',
geotargetArea: {geotargetCriteriaIds: []},
merchantId: '',
postalCodeArea: {postalCodes: [{begin: '', end: ''}], regionCode: ''},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/regions/:regionId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"displayName":"","geotargetArea":{"geotargetCriteriaIds":[]},"merchantId":"","postalCodeArea":{"postalCodes":[{"begin":"","end":""}],"regionCode":""},"regionId":"","regionalInventoryEligible":false,"shippingEligible":false}'
};
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}}/:merchantId/regions/:regionId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "displayName": "",\n "geotargetArea": {\n "geotargetCriteriaIds": []\n },\n "merchantId": "",\n "postalCodeArea": {\n "postalCodes": [\n {\n "begin": "",\n "end": ""\n }\n ],\n "regionCode": ""\n },\n "regionId": "",\n "regionalInventoryEligible": false,\n "shippingEligible": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/regions/:regionId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/regions/:regionId',
headers: {
'content-type': 'application/json'
}
};
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({
displayName: '',
geotargetArea: {geotargetCriteriaIds: []},
merchantId: '',
postalCodeArea: {postalCodes: [{begin: '', end: ''}], regionCode: ''},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/regions/:regionId',
headers: {'content-type': 'application/json'},
body: {
displayName: '',
geotargetArea: {geotargetCriteriaIds: []},
merchantId: '',
postalCodeArea: {postalCodes: [{begin: '', end: ''}], regionCode: ''},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/:merchantId/regions/:regionId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
displayName: '',
geotargetArea: {
geotargetCriteriaIds: []
},
merchantId: '',
postalCodeArea: {
postalCodes: [
{
begin: '',
end: ''
}
],
regionCode: ''
},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/regions/:regionId',
headers: {'content-type': 'application/json'},
data: {
displayName: '',
geotargetArea: {geotargetCriteriaIds: []},
merchantId: '',
postalCodeArea: {postalCodes: [{begin: '', end: ''}], regionCode: ''},
regionId: '',
regionalInventoryEligible: false,
shippingEligible: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/regions/:regionId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"displayName":"","geotargetArea":{"geotargetCriteriaIds":[]},"merchantId":"","postalCodeArea":{"postalCodes":[{"begin":"","end":""}],"regionCode":""},"regionId":"","regionalInventoryEligible":false,"shippingEligible":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"displayName": @"",
@"geotargetArea": @{ @"geotargetCriteriaIds": @[ ] },
@"merchantId": @"",
@"postalCodeArea": @{ @"postalCodes": @[ @{ @"begin": @"", @"end": @"" } ], @"regionCode": @"" },
@"regionId": @"",
@"regionalInventoryEligible": @NO,
@"shippingEligible": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/regions/:regionId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/:merchantId/regions/:regionId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/regions/:regionId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'displayName' => '',
'geotargetArea' => [
'geotargetCriteriaIds' => [
]
],
'merchantId' => '',
'postalCodeArea' => [
'postalCodes' => [
[
'begin' => '',
'end' => ''
]
],
'regionCode' => ''
],
'regionId' => '',
'regionalInventoryEligible' => null,
'shippingEligible' => null
]),
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;
}
request('PATCH', '{{baseUrl}}/:merchantId/regions/:regionId', [
'body' => '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/regions/:regionId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'displayName' => '',
'geotargetArea' => [
'geotargetCriteriaIds' => [
]
],
'merchantId' => '',
'postalCodeArea' => [
'postalCodes' => [
[
'begin' => '',
'end' => ''
]
],
'regionCode' => ''
],
'regionId' => '',
'regionalInventoryEligible' => null,
'shippingEligible' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'displayName' => '',
'geotargetArea' => [
'geotargetCriteriaIds' => [
]
],
'merchantId' => '',
'postalCodeArea' => [
'postalCodes' => [
[
'begin' => '',
'end' => ''
]
],
'regionCode' => ''
],
'regionId' => '',
'regionalInventoryEligible' => null,
'shippingEligible' => null
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/regions/:regionId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/regions/:regionId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/regions/:regionId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/:merchantId/regions/:regionId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/regions/:regionId"
payload = {
"displayName": "",
"geotargetArea": { "geotargetCriteriaIds": [] },
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": False,
"shippingEligible": False
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/regions/:regionId"
payload <- "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/regions/:regionId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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.patch('/baseUrl/:merchantId/regions/:regionId') do |req|
req.body = "{\n \"displayName\": \"\",\n \"geotargetArea\": {\n \"geotargetCriteriaIds\": []\n },\n \"merchantId\": \"\",\n \"postalCodeArea\": {\n \"postalCodes\": [\n {\n \"begin\": \"\",\n \"end\": \"\"\n }\n ],\n \"regionCode\": \"\"\n },\n \"regionId\": \"\",\n \"regionalInventoryEligible\": false,\n \"shippingEligible\": false\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}}/:merchantId/regions/:regionId";
let payload = json!({
"displayName": "",
"geotargetArea": json!({"geotargetCriteriaIds": ()}),
"merchantId": "",
"postalCodeArea": json!({
"postalCodes": (
json!({
"begin": "",
"end": ""
})
),
"regionCode": ""
}),
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/:merchantId/regions/:regionId \
--header 'content-type: application/json' \
--data '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}'
echo '{
"displayName": "",
"geotargetArea": {
"geotargetCriteriaIds": []
},
"merchantId": "",
"postalCodeArea": {
"postalCodes": [
{
"begin": "",
"end": ""
}
],
"regionCode": ""
},
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
}' | \
http PATCH {{baseUrl}}/:merchantId/regions/:regionId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "displayName": "",\n "geotargetArea": {\n "geotargetCriteriaIds": []\n },\n "merchantId": "",\n "postalCodeArea": {\n "postalCodes": [\n {\n "begin": "",\n "end": ""\n }\n ],\n "regionCode": ""\n },\n "regionId": "",\n "regionalInventoryEligible": false,\n "shippingEligible": false\n}' \
--output-document \
- {{baseUrl}}/:merchantId/regions/:regionId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"displayName": "",
"geotargetArea": ["geotargetCriteriaIds": []],
"merchantId": "",
"postalCodeArea": [
"postalCodes": [
[
"begin": "",
"end": ""
]
],
"regionCode": ""
],
"regionId": "",
"regionalInventoryEligible": false,
"shippingEligible": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/regions/:regionId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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
content.reports.search
{{baseUrl}}/:merchantId/reports/search
QUERY PARAMS
merchantId
BODY json
{
"pageSize": 0,
"pageToken": "",
"query": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/reports/search");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/reports/search" {:content-type :json
:form-params {:pageSize 0
:pageToken ""
:query ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/reports/search"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\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}}/:merchantId/reports/search"),
Content = new StringContent("{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\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}}/:merchantId/reports/search");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/reports/search"
payload := strings.NewReader("{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/reports/search HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 53
{
"pageSize": 0,
"pageToken": "",
"query": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/reports/search")
.setHeader("content-type", "application/json")
.setBody("{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/reports/search"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\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 \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/reports/search")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/reports/search")
.header("content-type", "application/json")
.body("{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}")
.asString();
const data = JSON.stringify({
pageSize: 0,
pageToken: '',
query: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/reports/search');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/reports/search',
headers: {'content-type': 'application/json'},
data: {pageSize: 0, pageToken: '', query: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/reports/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"pageSize":0,"pageToken":"","query":""}'
};
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}}/:merchantId/reports/search',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "pageSize": 0,\n "pageToken": "",\n "query": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/reports/search")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/reports/search',
headers: {
'content-type': 'application/json'
}
};
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({pageSize: 0, pageToken: '', query: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/reports/search',
headers: {'content-type': 'application/json'},
body: {pageSize: 0, pageToken: '', query: ''},
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}}/:merchantId/reports/search');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
pageSize: 0,
pageToken: '',
query: ''
});
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}}/:merchantId/reports/search',
headers: {'content-type': 'application/json'},
data: {pageSize: 0, pageToken: '', query: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/reports/search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"pageSize":0,"pageToken":"","query":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"pageSize": @0,
@"pageToken": @"",
@"query": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/reports/search"]
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}}/:merchantId/reports/search" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/reports/search",
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([
'pageSize' => 0,
'pageToken' => '',
'query' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/reports/search', [
'body' => '{
"pageSize": 0,
"pageToken": "",
"query": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/reports/search');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'pageSize' => 0,
'pageToken' => '',
'query' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'pageSize' => 0,
'pageToken' => '',
'query' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/reports/search');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/reports/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"pageSize": 0,
"pageToken": "",
"query": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/reports/search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"pageSize": 0,
"pageToken": "",
"query": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/reports/search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/reports/search"
payload = {
"pageSize": 0,
"pageToken": "",
"query": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/reports/search"
payload <- "{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/reports/search")
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 \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\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.post('/baseUrl/:merchantId/reports/search') do |req|
req.body = "{\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"query\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/reports/search";
let payload = json!({
"pageSize": 0,
"pageToken": "",
"query": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/reports/search \
--header 'content-type: application/json' \
--data '{
"pageSize": 0,
"pageToken": "",
"query": ""
}'
echo '{
"pageSize": 0,
"pageToken": "",
"query": ""
}' | \
http POST {{baseUrl}}/:merchantId/reports/search \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "pageSize": 0,\n "pageToken": "",\n "query": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/reports/search
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"pageSize": 0,
"pageToken": "",
"query": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/reports/search")! 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()
POST
content.repricingrules.create
{{baseUrl}}/:merchantId/repricingrules
QUERY PARAMS
merchantId
BODY json
{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/repricingrules");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/repricingrules" {:content-type :json
:form-params {:cogsBasedRule {:percentageDelta 0
:priceDelta ""}
:countryCode ""
:effectiveTimePeriod {:fixedTimePeriods [{:endTime ""
:startTime ""}]}
:eligibleOfferMatcher {:brandMatcher {:strAttributes []}
:itemGroupIdMatcher {}
:matcherOption ""
:offerIdMatcher {}
:skipWhenOnPromotion false}
:languageCode ""
:merchantId ""
:paused false
:restriction {:floor {:percentageDelta 0
:priceDelta ""}
:useAutoPricingMinPrice false}
:ruleId ""
:statsBasedRule {:percentageDelta 0
:priceDelta ""}
:title ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/repricingrules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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}}/:merchantId/repricingrules"),
Content = new StringContent("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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}}/:merchantId/repricingrules");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/repricingrules"
payload := strings.NewReader("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/repricingrules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 738
{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/repricingrules")
.setHeader("content-type", "application/json")
.setBody("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/repricingrules"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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 \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/repricingrules")
.header("content-type", "application/json")
.body("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
cogsBasedRule: {
percentageDelta: 0,
priceDelta: ''
},
countryCode: '',
effectiveTimePeriod: {
fixedTimePeriods: [
{
endTime: '',
startTime: ''
}
]
},
eligibleOfferMatcher: {
brandMatcher: {
strAttributes: []
},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {
floor: {
percentageDelta: 0,
priceDelta: ''
},
useAutoPricingMinPrice: false
},
ruleId: '',
statsBasedRule: {
percentageDelta: 0,
priceDelta: ''
},
title: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/repricingrules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/repricingrules',
headers: {'content-type': 'application/json'},
data: {
cogsBasedRule: {percentageDelta: 0, priceDelta: ''},
countryCode: '',
effectiveTimePeriod: {fixedTimePeriods: [{endTime: '', startTime: ''}]},
eligibleOfferMatcher: {
brandMatcher: {strAttributes: []},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {floor: {percentageDelta: 0, priceDelta: ''}, useAutoPricingMinPrice: false},
ruleId: '',
statsBasedRule: {percentageDelta: 0, priceDelta: ''},
title: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/repricingrules';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"cogsBasedRule":{"percentageDelta":0,"priceDelta":""},"countryCode":"","effectiveTimePeriod":{"fixedTimePeriods":[{"endTime":"","startTime":""}]},"eligibleOfferMatcher":{"brandMatcher":{"strAttributes":[]},"itemGroupIdMatcher":{},"matcherOption":"","offerIdMatcher":{},"skipWhenOnPromotion":false},"languageCode":"","merchantId":"","paused":false,"restriction":{"floor":{"percentageDelta":0,"priceDelta":""},"useAutoPricingMinPrice":false},"ruleId":"","statsBasedRule":{"percentageDelta":0,"priceDelta":""},"title":"","type":""}'
};
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}}/:merchantId/repricingrules',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cogsBasedRule": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "countryCode": "",\n "effectiveTimePeriod": {\n "fixedTimePeriods": [\n {\n "endTime": "",\n "startTime": ""\n }\n ]\n },\n "eligibleOfferMatcher": {\n "brandMatcher": {\n "strAttributes": []\n },\n "itemGroupIdMatcher": {},\n "matcherOption": "",\n "offerIdMatcher": {},\n "skipWhenOnPromotion": false\n },\n "languageCode": "",\n "merchantId": "",\n "paused": false,\n "restriction": {\n "floor": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "useAutoPricingMinPrice": false\n },\n "ruleId": "",\n "statsBasedRule": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "title": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/repricingrules',
headers: {
'content-type': 'application/json'
}
};
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({
cogsBasedRule: {percentageDelta: 0, priceDelta: ''},
countryCode: '',
effectiveTimePeriod: {fixedTimePeriods: [{endTime: '', startTime: ''}]},
eligibleOfferMatcher: {
brandMatcher: {strAttributes: []},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {floor: {percentageDelta: 0, priceDelta: ''}, useAutoPricingMinPrice: false},
ruleId: '',
statsBasedRule: {percentageDelta: 0, priceDelta: ''},
title: '',
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/repricingrules',
headers: {'content-type': 'application/json'},
body: {
cogsBasedRule: {percentageDelta: 0, priceDelta: ''},
countryCode: '',
effectiveTimePeriod: {fixedTimePeriods: [{endTime: '', startTime: ''}]},
eligibleOfferMatcher: {
brandMatcher: {strAttributes: []},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {floor: {percentageDelta: 0, priceDelta: ''}, useAutoPricingMinPrice: false},
ruleId: '',
statsBasedRule: {percentageDelta: 0, priceDelta: ''},
title: '',
type: ''
},
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}}/:merchantId/repricingrules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cogsBasedRule: {
percentageDelta: 0,
priceDelta: ''
},
countryCode: '',
effectiveTimePeriod: {
fixedTimePeriods: [
{
endTime: '',
startTime: ''
}
]
},
eligibleOfferMatcher: {
brandMatcher: {
strAttributes: []
},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {
floor: {
percentageDelta: 0,
priceDelta: ''
},
useAutoPricingMinPrice: false
},
ruleId: '',
statsBasedRule: {
percentageDelta: 0,
priceDelta: ''
},
title: '',
type: ''
});
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}}/:merchantId/repricingrules',
headers: {'content-type': 'application/json'},
data: {
cogsBasedRule: {percentageDelta: 0, priceDelta: ''},
countryCode: '',
effectiveTimePeriod: {fixedTimePeriods: [{endTime: '', startTime: ''}]},
eligibleOfferMatcher: {
brandMatcher: {strAttributes: []},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {floor: {percentageDelta: 0, priceDelta: ''}, useAutoPricingMinPrice: false},
ruleId: '',
statsBasedRule: {percentageDelta: 0, priceDelta: ''},
title: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/repricingrules';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"cogsBasedRule":{"percentageDelta":0,"priceDelta":""},"countryCode":"","effectiveTimePeriod":{"fixedTimePeriods":[{"endTime":"","startTime":""}]},"eligibleOfferMatcher":{"brandMatcher":{"strAttributes":[]},"itemGroupIdMatcher":{},"matcherOption":"","offerIdMatcher":{},"skipWhenOnPromotion":false},"languageCode":"","merchantId":"","paused":false,"restriction":{"floor":{"percentageDelta":0,"priceDelta":""},"useAutoPricingMinPrice":false},"ruleId":"","statsBasedRule":{"percentageDelta":0,"priceDelta":""},"title":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"cogsBasedRule": @{ @"percentageDelta": @0, @"priceDelta": @"" },
@"countryCode": @"",
@"effectiveTimePeriod": @{ @"fixedTimePeriods": @[ @{ @"endTime": @"", @"startTime": @"" } ] },
@"eligibleOfferMatcher": @{ @"brandMatcher": @{ @"strAttributes": @[ ] }, @"itemGroupIdMatcher": @{ }, @"matcherOption": @"", @"offerIdMatcher": @{ }, @"skipWhenOnPromotion": @NO },
@"languageCode": @"",
@"merchantId": @"",
@"paused": @NO,
@"restriction": @{ @"floor": @{ @"percentageDelta": @0, @"priceDelta": @"" }, @"useAutoPricingMinPrice": @NO },
@"ruleId": @"",
@"statsBasedRule": @{ @"percentageDelta": @0, @"priceDelta": @"" },
@"title": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/repricingrules"]
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}}/:merchantId/repricingrules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/repricingrules",
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([
'cogsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'countryCode' => '',
'effectiveTimePeriod' => [
'fixedTimePeriods' => [
[
'endTime' => '',
'startTime' => ''
]
]
],
'eligibleOfferMatcher' => [
'brandMatcher' => [
'strAttributes' => [
]
],
'itemGroupIdMatcher' => [
],
'matcherOption' => '',
'offerIdMatcher' => [
],
'skipWhenOnPromotion' => null
],
'languageCode' => '',
'merchantId' => '',
'paused' => null,
'restriction' => [
'floor' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'useAutoPricingMinPrice' => null
],
'ruleId' => '',
'statsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'title' => '',
'type' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/repricingrules', [
'body' => '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/repricingrules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cogsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'countryCode' => '',
'effectiveTimePeriod' => [
'fixedTimePeriods' => [
[
'endTime' => '',
'startTime' => ''
]
]
],
'eligibleOfferMatcher' => [
'brandMatcher' => [
'strAttributes' => [
]
],
'itemGroupIdMatcher' => [
],
'matcherOption' => '',
'offerIdMatcher' => [
],
'skipWhenOnPromotion' => null
],
'languageCode' => '',
'merchantId' => '',
'paused' => null,
'restriction' => [
'floor' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'useAutoPricingMinPrice' => null
],
'ruleId' => '',
'statsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'title' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cogsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'countryCode' => '',
'effectiveTimePeriod' => [
'fixedTimePeriods' => [
[
'endTime' => '',
'startTime' => ''
]
]
],
'eligibleOfferMatcher' => [
'brandMatcher' => [
'strAttributes' => [
]
],
'itemGroupIdMatcher' => [
],
'matcherOption' => '',
'offerIdMatcher' => [
],
'skipWhenOnPromotion' => null
],
'languageCode' => '',
'merchantId' => '',
'paused' => null,
'restriction' => [
'floor' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'useAutoPricingMinPrice' => null
],
'ruleId' => '',
'statsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'title' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/repricingrules');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/repricingrules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/repricingrules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/repricingrules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/repricingrules"
payload = {
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": { "fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
] },
"eligibleOfferMatcher": {
"brandMatcher": { "strAttributes": [] },
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": False
},
"languageCode": "",
"merchantId": "",
"paused": False,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": False
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/repricingrules"
payload <- "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/repricingrules")
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 \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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.post('/baseUrl/:merchantId/repricingrules') do |req|
req.body = "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/repricingrules";
let payload = json!({
"cogsBasedRule": json!({
"percentageDelta": 0,
"priceDelta": ""
}),
"countryCode": "",
"effectiveTimePeriod": json!({"fixedTimePeriods": (
json!({
"endTime": "",
"startTime": ""
})
)}),
"eligibleOfferMatcher": json!({
"brandMatcher": json!({"strAttributes": ()}),
"itemGroupIdMatcher": json!({}),
"matcherOption": "",
"offerIdMatcher": json!({}),
"skipWhenOnPromotion": false
}),
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": json!({
"floor": json!({
"percentageDelta": 0,
"priceDelta": ""
}),
"useAutoPricingMinPrice": false
}),
"ruleId": "",
"statsBasedRule": json!({
"percentageDelta": 0,
"priceDelta": ""
}),
"title": "",
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/repricingrules \
--header 'content-type: application/json' \
--data '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}'
echo '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}' | \
http POST {{baseUrl}}/:merchantId/repricingrules \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "cogsBasedRule": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "countryCode": "",\n "effectiveTimePeriod": {\n "fixedTimePeriods": [\n {\n "endTime": "",\n "startTime": ""\n }\n ]\n },\n "eligibleOfferMatcher": {\n "brandMatcher": {\n "strAttributes": []\n },\n "itemGroupIdMatcher": {},\n "matcherOption": "",\n "offerIdMatcher": {},\n "skipWhenOnPromotion": false\n },\n "languageCode": "",\n "merchantId": "",\n "paused": false,\n "restriction": {\n "floor": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "useAutoPricingMinPrice": false\n },\n "ruleId": "",\n "statsBasedRule": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "title": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/repricingrules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cogsBasedRule": [
"percentageDelta": 0,
"priceDelta": ""
],
"countryCode": "",
"effectiveTimePeriod": ["fixedTimePeriods": [
[
"endTime": "",
"startTime": ""
]
]],
"eligibleOfferMatcher": [
"brandMatcher": ["strAttributes": []],
"itemGroupIdMatcher": [],
"matcherOption": "",
"offerIdMatcher": [],
"skipWhenOnPromotion": false
],
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": [
"floor": [
"percentageDelta": 0,
"priceDelta": ""
],
"useAutoPricingMinPrice": false
],
"ruleId": "",
"statsBasedRule": [
"percentageDelta": 0,
"priceDelta": ""
],
"title": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/repricingrules")! 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()
DELETE
content.repricingrules.delete
{{baseUrl}}/:merchantId/repricingrules/:ruleId
QUERY PARAMS
merchantId
ruleId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/repricingrules/:ruleId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/repricingrules/:ruleId")
require "http/client"
url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/repricingrules/:ruleId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/repricingrules/:ruleId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/repricingrules/:ruleId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/repricingrules/:ruleId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/repricingrules/:ruleId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/repricingrules/:ruleId';
const options = {method: 'DELETE'};
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}}/:merchantId/repricingrules/:ruleId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/repricingrules/:ruleId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/repricingrules/:ruleId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/repricingrules/:ruleId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/repricingrules/:ruleId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/repricingrules/:ruleId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/repricingrules/:ruleId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/repricingrules/:ruleId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/repricingrules/:ruleId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/repricingrules/:ruleId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/repricingrules/:ruleId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/repricingrules/:ruleId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/repricingrules/:ruleId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/repricingrules/:ruleId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/repricingrules/:ruleId
http DELETE {{baseUrl}}/:merchantId/repricingrules/:ruleId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/repricingrules/:ruleId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/repricingrules/:ruleId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.repricingrules.get
{{baseUrl}}/:merchantId/repricingrules/:ruleId
QUERY PARAMS
merchantId
ruleId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/repricingrules/:ruleId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/repricingrules/:ruleId")
require "http/client"
url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/repricingrules/:ruleId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/repricingrules/:ruleId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/repricingrules/:ruleId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/repricingrules/:ruleId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/repricingrules/:ruleId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/repricingrules/:ruleId';
const options = {method: 'GET'};
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}}/:merchantId/repricingrules/:ruleId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/repricingrules/:ruleId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/repricingrules/:ruleId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/repricingrules/:ruleId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/repricingrules/:ruleId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/repricingrules/:ruleId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/repricingrules/:ruleId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/repricingrules/:ruleId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/repricingrules/:ruleId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/repricingrules/:ruleId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/repricingrules/:ruleId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/repricingrules/:ruleId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/repricingrules/:ruleId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/repricingrules/:ruleId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/repricingrules/:ruleId
http GET {{baseUrl}}/:merchantId/repricingrules/:ruleId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/repricingrules/:ruleId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/repricingrules/:ruleId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.repricingrules.list
{{baseUrl}}/:merchantId/repricingrules
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/repricingrules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/repricingrules")
require "http/client"
url = "{{baseUrl}}/:merchantId/repricingrules"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/repricingrules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/repricingrules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/repricingrules"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/repricingrules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/repricingrules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/repricingrules"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/repricingrules")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/repricingrules');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/repricingrules'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/repricingrules';
const options = {method: 'GET'};
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}}/:merchantId/repricingrules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/repricingrules',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/repricingrules'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/repricingrules');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/repricingrules'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/repricingrules';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/repricingrules"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/repricingrules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/repricingrules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/repricingrules');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/repricingrules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/repricingrules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/repricingrules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/repricingrules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/repricingrules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/repricingrules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/repricingrules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/repricingrules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/repricingrules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/repricingrules";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/repricingrules
http GET {{baseUrl}}/:merchantId/repricingrules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/repricingrules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/repricingrules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PATCH
content.repricingrules.patch
{{baseUrl}}/:merchantId/repricingrules/:ruleId
QUERY PARAMS
merchantId
ruleId
BODY json
{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/repricingrules/:ruleId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/:merchantId/repricingrules/:ruleId" {:content-type :json
:form-params {:cogsBasedRule {:percentageDelta 0
:priceDelta ""}
:countryCode ""
:effectiveTimePeriod {:fixedTimePeriods [{:endTime ""
:startTime ""}]}
:eligibleOfferMatcher {:brandMatcher {:strAttributes []}
:itemGroupIdMatcher {}
:matcherOption ""
:offerIdMatcher {}
:skipWhenOnPromotion false}
:languageCode ""
:merchantId ""
:paused false
:restriction {:floor {:percentageDelta 0
:priceDelta ""}
:useAutoPricingMinPrice false}
:ruleId ""
:statsBasedRule {:percentageDelta 0
:priceDelta ""}
:title ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/:merchantId/repricingrules/:ruleId"),
Content = new StringContent("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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}}/:merchantId/repricingrules/:ruleId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
payload := strings.NewReader("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}")
req, _ := http.NewRequest("PATCH", 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(res)
fmt.Println(string(body))
}
PATCH /baseUrl/:merchantId/repricingrules/:ruleId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 738
{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.setHeader("content-type", "application/json")
.setBody("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/repricingrules/:ruleId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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 \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.header("content-type", "application/json")
.body("{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
cogsBasedRule: {
percentageDelta: 0,
priceDelta: ''
},
countryCode: '',
effectiveTimePeriod: {
fixedTimePeriods: [
{
endTime: '',
startTime: ''
}
]
},
eligibleOfferMatcher: {
brandMatcher: {
strAttributes: []
},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {
floor: {
percentageDelta: 0,
priceDelta: ''
},
useAutoPricingMinPrice: false
},
ruleId: '',
statsBasedRule: {
percentageDelta: 0,
priceDelta: ''
},
title: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/:merchantId/repricingrules/:ruleId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId',
headers: {'content-type': 'application/json'},
data: {
cogsBasedRule: {percentageDelta: 0, priceDelta: ''},
countryCode: '',
effectiveTimePeriod: {fixedTimePeriods: [{endTime: '', startTime: ''}]},
eligibleOfferMatcher: {
brandMatcher: {strAttributes: []},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {floor: {percentageDelta: 0, priceDelta: ''}, useAutoPricingMinPrice: false},
ruleId: '',
statsBasedRule: {percentageDelta: 0, priceDelta: ''},
title: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/repricingrules/:ruleId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"cogsBasedRule":{"percentageDelta":0,"priceDelta":""},"countryCode":"","effectiveTimePeriod":{"fixedTimePeriods":[{"endTime":"","startTime":""}]},"eligibleOfferMatcher":{"brandMatcher":{"strAttributes":[]},"itemGroupIdMatcher":{},"matcherOption":"","offerIdMatcher":{},"skipWhenOnPromotion":false},"languageCode":"","merchantId":"","paused":false,"restriction":{"floor":{"percentageDelta":0,"priceDelta":""},"useAutoPricingMinPrice":false},"ruleId":"","statsBasedRule":{"percentageDelta":0,"priceDelta":""},"title":"","type":""}'
};
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}}/:merchantId/repricingrules/:ruleId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cogsBasedRule": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "countryCode": "",\n "effectiveTimePeriod": {\n "fixedTimePeriods": [\n {\n "endTime": "",\n "startTime": ""\n }\n ]\n },\n "eligibleOfferMatcher": {\n "brandMatcher": {\n "strAttributes": []\n },\n "itemGroupIdMatcher": {},\n "matcherOption": "",\n "offerIdMatcher": {},\n "skipWhenOnPromotion": false\n },\n "languageCode": "",\n "merchantId": "",\n "paused": false,\n "restriction": {\n "floor": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "useAutoPricingMinPrice": false\n },\n "ruleId": "",\n "statsBasedRule": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "title": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/repricingrules/:ruleId',
headers: {
'content-type': 'application/json'
}
};
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({
cogsBasedRule: {percentageDelta: 0, priceDelta: ''},
countryCode: '',
effectiveTimePeriod: {fixedTimePeriods: [{endTime: '', startTime: ''}]},
eligibleOfferMatcher: {
brandMatcher: {strAttributes: []},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {floor: {percentageDelta: 0, priceDelta: ''}, useAutoPricingMinPrice: false},
ruleId: '',
statsBasedRule: {percentageDelta: 0, priceDelta: ''},
title: '',
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId',
headers: {'content-type': 'application/json'},
body: {
cogsBasedRule: {percentageDelta: 0, priceDelta: ''},
countryCode: '',
effectiveTimePeriod: {fixedTimePeriods: [{endTime: '', startTime: ''}]},
eligibleOfferMatcher: {
brandMatcher: {strAttributes: []},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {floor: {percentageDelta: 0, priceDelta: ''}, useAutoPricingMinPrice: false},
ruleId: '',
statsBasedRule: {percentageDelta: 0, priceDelta: ''},
title: '',
type: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/:merchantId/repricingrules/:ruleId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cogsBasedRule: {
percentageDelta: 0,
priceDelta: ''
},
countryCode: '',
effectiveTimePeriod: {
fixedTimePeriods: [
{
endTime: '',
startTime: ''
}
]
},
eligibleOfferMatcher: {
brandMatcher: {
strAttributes: []
},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {
floor: {
percentageDelta: 0,
priceDelta: ''
},
useAutoPricingMinPrice: false
},
ruleId: '',
statsBasedRule: {
percentageDelta: 0,
priceDelta: ''
},
title: '',
type: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId',
headers: {'content-type': 'application/json'},
data: {
cogsBasedRule: {percentageDelta: 0, priceDelta: ''},
countryCode: '',
effectiveTimePeriod: {fixedTimePeriods: [{endTime: '', startTime: ''}]},
eligibleOfferMatcher: {
brandMatcher: {strAttributes: []},
itemGroupIdMatcher: {},
matcherOption: '',
offerIdMatcher: {},
skipWhenOnPromotion: false
},
languageCode: '',
merchantId: '',
paused: false,
restriction: {floor: {percentageDelta: 0, priceDelta: ''}, useAutoPricingMinPrice: false},
ruleId: '',
statsBasedRule: {percentageDelta: 0, priceDelta: ''},
title: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/repricingrules/:ruleId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"cogsBasedRule":{"percentageDelta":0,"priceDelta":""},"countryCode":"","effectiveTimePeriod":{"fixedTimePeriods":[{"endTime":"","startTime":""}]},"eligibleOfferMatcher":{"brandMatcher":{"strAttributes":[]},"itemGroupIdMatcher":{},"matcherOption":"","offerIdMatcher":{},"skipWhenOnPromotion":false},"languageCode":"","merchantId":"","paused":false,"restriction":{"floor":{"percentageDelta":0,"priceDelta":""},"useAutoPricingMinPrice":false},"ruleId":"","statsBasedRule":{"percentageDelta":0,"priceDelta":""},"title":"","type":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"cogsBasedRule": @{ @"percentageDelta": @0, @"priceDelta": @"" },
@"countryCode": @"",
@"effectiveTimePeriod": @{ @"fixedTimePeriods": @[ @{ @"endTime": @"", @"startTime": @"" } ] },
@"eligibleOfferMatcher": @{ @"brandMatcher": @{ @"strAttributes": @[ ] }, @"itemGroupIdMatcher": @{ }, @"matcherOption": @"", @"offerIdMatcher": @{ }, @"skipWhenOnPromotion": @NO },
@"languageCode": @"",
@"merchantId": @"",
@"paused": @NO,
@"restriction": @{ @"floor": @{ @"percentageDelta": @0, @"priceDelta": @"" }, @"useAutoPricingMinPrice": @NO },
@"ruleId": @"",
@"statsBasedRule": @{ @"percentageDelta": @0, @"priceDelta": @"" },
@"title": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/repricingrules/:ruleId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/:merchantId/repricingrules/:ruleId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/repricingrules/:ruleId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cogsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'countryCode' => '',
'effectiveTimePeriod' => [
'fixedTimePeriods' => [
[
'endTime' => '',
'startTime' => ''
]
]
],
'eligibleOfferMatcher' => [
'brandMatcher' => [
'strAttributes' => [
]
],
'itemGroupIdMatcher' => [
],
'matcherOption' => '',
'offerIdMatcher' => [
],
'skipWhenOnPromotion' => null
],
'languageCode' => '',
'merchantId' => '',
'paused' => null,
'restriction' => [
'floor' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'useAutoPricingMinPrice' => null
],
'ruleId' => '',
'statsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'title' => '',
'type' => ''
]),
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;
}
request('PATCH', '{{baseUrl}}/:merchantId/repricingrules/:ruleId', [
'body' => '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/repricingrules/:ruleId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cogsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'countryCode' => '',
'effectiveTimePeriod' => [
'fixedTimePeriods' => [
[
'endTime' => '',
'startTime' => ''
]
]
],
'eligibleOfferMatcher' => [
'brandMatcher' => [
'strAttributes' => [
]
],
'itemGroupIdMatcher' => [
],
'matcherOption' => '',
'offerIdMatcher' => [
],
'skipWhenOnPromotion' => null
],
'languageCode' => '',
'merchantId' => '',
'paused' => null,
'restriction' => [
'floor' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'useAutoPricingMinPrice' => null
],
'ruleId' => '',
'statsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'title' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cogsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'countryCode' => '',
'effectiveTimePeriod' => [
'fixedTimePeriods' => [
[
'endTime' => '',
'startTime' => ''
]
]
],
'eligibleOfferMatcher' => [
'brandMatcher' => [
'strAttributes' => [
]
],
'itemGroupIdMatcher' => [
],
'matcherOption' => '',
'offerIdMatcher' => [
],
'skipWhenOnPromotion' => null
],
'languageCode' => '',
'merchantId' => '',
'paused' => null,
'restriction' => [
'floor' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'useAutoPricingMinPrice' => null
],
'ruleId' => '',
'statsBasedRule' => [
'percentageDelta' => 0,
'priceDelta' => ''
],
'title' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/repricingrules/:ruleId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/repricingrules/:ruleId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/repricingrules/:ruleId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/:merchantId/repricingrules/:ruleId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
payload = {
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": { "fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
] },
"eligibleOfferMatcher": {
"brandMatcher": { "strAttributes": [] },
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": False
},
"languageCode": "",
"merchantId": "",
"paused": False,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": False
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/repricingrules/:ruleId"
payload <- "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/repricingrules/:ruleId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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.patch('/baseUrl/:merchantId/repricingrules/:ruleId') do |req|
req.body = "{\n \"cogsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"countryCode\": \"\",\n \"effectiveTimePeriod\": {\n \"fixedTimePeriods\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ]\n },\n \"eligibleOfferMatcher\": {\n \"brandMatcher\": {\n \"strAttributes\": []\n },\n \"itemGroupIdMatcher\": {},\n \"matcherOption\": \"\",\n \"offerIdMatcher\": {},\n \"skipWhenOnPromotion\": false\n },\n \"languageCode\": \"\",\n \"merchantId\": \"\",\n \"paused\": false,\n \"restriction\": {\n \"floor\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"useAutoPricingMinPrice\": false\n },\n \"ruleId\": \"\",\n \"statsBasedRule\": {\n \"percentageDelta\": 0,\n \"priceDelta\": \"\"\n },\n \"title\": \"\",\n \"type\": \"\"\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}}/:merchantId/repricingrules/:ruleId";
let payload = json!({
"cogsBasedRule": json!({
"percentageDelta": 0,
"priceDelta": ""
}),
"countryCode": "",
"effectiveTimePeriod": json!({"fixedTimePeriods": (
json!({
"endTime": "",
"startTime": ""
})
)}),
"eligibleOfferMatcher": json!({
"brandMatcher": json!({"strAttributes": ()}),
"itemGroupIdMatcher": json!({}),
"matcherOption": "",
"offerIdMatcher": json!({}),
"skipWhenOnPromotion": false
}),
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": json!({
"floor": json!({
"percentageDelta": 0,
"priceDelta": ""
}),
"useAutoPricingMinPrice": false
}),
"ruleId": "",
"statsBasedRule": json!({
"percentageDelta": 0,
"priceDelta": ""
}),
"title": "",
"type": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/:merchantId/repricingrules/:ruleId \
--header 'content-type: application/json' \
--data '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}'
echo '{
"cogsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"countryCode": "",
"effectiveTimePeriod": {
"fixedTimePeriods": [
{
"endTime": "",
"startTime": ""
}
]
},
"eligibleOfferMatcher": {
"brandMatcher": {
"strAttributes": []
},
"itemGroupIdMatcher": {},
"matcherOption": "",
"offerIdMatcher": {},
"skipWhenOnPromotion": false
},
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": {
"floor": {
"percentageDelta": 0,
"priceDelta": ""
},
"useAutoPricingMinPrice": false
},
"ruleId": "",
"statsBasedRule": {
"percentageDelta": 0,
"priceDelta": ""
},
"title": "",
"type": ""
}' | \
http PATCH {{baseUrl}}/:merchantId/repricingrules/:ruleId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "cogsBasedRule": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "countryCode": "",\n "effectiveTimePeriod": {\n "fixedTimePeriods": [\n {\n "endTime": "",\n "startTime": ""\n }\n ]\n },\n "eligibleOfferMatcher": {\n "brandMatcher": {\n "strAttributes": []\n },\n "itemGroupIdMatcher": {},\n "matcherOption": "",\n "offerIdMatcher": {},\n "skipWhenOnPromotion": false\n },\n "languageCode": "",\n "merchantId": "",\n "paused": false,\n "restriction": {\n "floor": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "useAutoPricingMinPrice": false\n },\n "ruleId": "",\n "statsBasedRule": {\n "percentageDelta": 0,\n "priceDelta": ""\n },\n "title": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/repricingrules/:ruleId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cogsBasedRule": [
"percentageDelta": 0,
"priceDelta": ""
],
"countryCode": "",
"effectiveTimePeriod": ["fixedTimePeriods": [
[
"endTime": "",
"startTime": ""
]
]],
"eligibleOfferMatcher": [
"brandMatcher": ["strAttributes": []],
"itemGroupIdMatcher": [],
"matcherOption": "",
"offerIdMatcher": [],
"skipWhenOnPromotion": false
],
"languageCode": "",
"merchantId": "",
"paused": false,
"restriction": [
"floor": [
"percentageDelta": 0,
"priceDelta": ""
],
"useAutoPricingMinPrice": false
],
"ruleId": "",
"statsBasedRule": [
"percentageDelta": 0,
"priceDelta": ""
],
"title": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/repricingrules/:ruleId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
GET
content.repricingrules.repricingreports.list
{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports
QUERY PARAMS
merchantId
ruleId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports")
require "http/client"
url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/repricingrules/:ruleId/repricingreports HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports';
const options = {method: 'GET'};
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}}/:merchantId/repricingrules/:ruleId/repricingreports',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/repricingrules/:ruleId/repricingreports',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/repricingrules/:ruleId/repricingreports" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/repricingrules/:ruleId/repricingreports")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/repricingrules/:ruleId/repricingreports') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports
http GET {{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/repricingrules/:ruleId/repricingreports")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.returnaddress.custombatch
{{baseUrl}}/returnaddress/batch
BODY json
{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
},
"returnAddressId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/returnaddress/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/returnaddress/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:merchantId ""
:method ""
:returnAddress {:address {:country ""
:locality ""
:postalCode ""
:recipientName ""
:region ""
:streetAddress []}
:country ""
:kind ""
:label ""
:phoneNumber ""
:returnAddressId ""}
:returnAddressId ""}]}})
require "http/client"
url = "{{baseUrl}}/returnaddress/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\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}}/returnaddress/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\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}}/returnaddress/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/returnaddress/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/returnaddress/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 477
{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
},
"returnAddressId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/returnaddress/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/returnaddress/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/returnaddress/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/returnaddress/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnAddress: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
},
returnAddressId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/returnaddress/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/returnaddress/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnAddress: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
},
returnAddressId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/returnaddress/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"merchantId":"","method":"","returnAddress":{"address":{"country":"","locality":"","postalCode":"","recipientName":"","region":"","streetAddress":[]},"country":"","kind":"","label":"","phoneNumber":"","returnAddressId":""},"returnAddressId":""}]}'
};
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}}/returnaddress/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "merchantId": "",\n "method": "",\n "returnAddress": {\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "recipientName": "",\n "region": "",\n "streetAddress": []\n },\n "country": "",\n "kind": "",\n "label": "",\n "phoneNumber": "",\n "returnAddressId": ""\n },\n "returnAddressId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/returnaddress/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/returnaddress/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnAddress: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
},
returnAddressId: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/returnaddress/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnAddress: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
},
returnAddressId: ''
}
]
},
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}}/returnaddress/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnAddress: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
},
returnAddressId: ''
}
]
});
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}}/returnaddress/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnAddress: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
},
returnAddressId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/returnaddress/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"merchantId":"","method":"","returnAddress":{"address":{"country":"","locality":"","postalCode":"","recipientName":"","region":"","streetAddress":[]},"country":"","kind":"","label":"","phoneNumber":"","returnAddressId":""},"returnAddressId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"merchantId": @"", @"method": @"", @"returnAddress": @{ @"address": @{ @"country": @"", @"locality": @"", @"postalCode": @"", @"recipientName": @"", @"region": @"", @"streetAddress": @[ ] }, @"country": @"", @"kind": @"", @"label": @"", @"phoneNumber": @"", @"returnAddressId": @"" }, @"returnAddressId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/returnaddress/batch"]
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}}/returnaddress/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/returnaddress/batch",
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([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'returnAddress' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'country' => '',
'kind' => '',
'label' => '',
'phoneNumber' => '',
'returnAddressId' => ''
],
'returnAddressId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/returnaddress/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
},
"returnAddressId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/returnaddress/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'returnAddress' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'country' => '',
'kind' => '',
'label' => '',
'phoneNumber' => '',
'returnAddressId' => ''
],
'returnAddressId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'returnAddress' => [
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'country' => '',
'kind' => '',
'label' => '',
'phoneNumber' => '',
'returnAddressId' => ''
],
'returnAddressId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/returnaddress/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/returnaddress/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
},
"returnAddressId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/returnaddress/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
},
"returnAddressId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/returnaddress/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/returnaddress/batch"
payload = { "entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
},
"returnAddressId": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/returnaddress/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/returnaddress/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\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.post('/baseUrl/returnaddress/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnAddress\": {\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n },\n \"returnAddressId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/returnaddress/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": json!({
"address": json!({
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": ()
}),
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}),
"returnAddressId": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/returnaddress/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
},
"returnAddressId": ""
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
},
"returnAddressId": ""
}
]
}' | \
http POST {{baseUrl}}/returnaddress/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "merchantId": "",\n "method": "",\n "returnAddress": {\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "recipientName": "",\n "region": "",\n "streetAddress": []\n },\n "country": "",\n "kind": "",\n "label": "",\n "phoneNumber": "",\n "returnAddressId": ""\n },\n "returnAddressId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/returnaddress/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"merchantId": "",
"method": "",
"returnAddress": [
"address": [
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
],
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
],
"returnAddressId": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/returnaddress/batch")! 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()
DELETE
content.returnaddress.delete
{{baseUrl}}/:merchantId/returnaddress/:returnAddressId
QUERY PARAMS
merchantId
returnAddressId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/returnaddress/:returnAddressId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId';
const options = {method: 'DELETE'};
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}}/:merchantId/returnaddress/:returnAddressId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnaddress/:returnAddressId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/returnaddress/:returnAddressId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnaddress/:returnAddressId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/returnaddress/:returnAddressId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/returnaddress/:returnAddressId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/returnaddress/:returnAddressId
http DELETE {{baseUrl}}/:merchantId/returnaddress/:returnAddressId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/returnaddress/:returnAddressId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.returnaddress.get
{{baseUrl}}/:merchantId/returnaddress/:returnAddressId
QUERY PARAMS
merchantId
returnAddressId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/returnaddress/:returnAddressId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId';
const options = {method: 'GET'};
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}}/:merchantId/returnaddress/:returnAddressId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnaddress/:returnAddressId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/returnaddress/:returnAddressId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnaddress/:returnAddressId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnaddress/:returnAddressId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnaddress/:returnAddressId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/returnaddress/:returnAddressId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/returnaddress/:returnAddressId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/returnaddress/:returnAddressId
http GET {{baseUrl}}/:merchantId/returnaddress/:returnAddressId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/returnaddress/:returnAddressId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnaddress/:returnAddressId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.returnaddress.insert
{{baseUrl}}/:merchantId/returnaddress
QUERY PARAMS
merchantId
BODY json
{
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnaddress");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/returnaddress" {:content-type :json
:form-params {:address {:country ""
:locality ""
:postalCode ""
:recipientName ""
:region ""
:streetAddress []}
:country ""
:kind ""
:label ""
:phoneNumber ""
:returnAddressId ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/returnaddress"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\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}}/:merchantId/returnaddress"),
Content = new StringContent("{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\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}}/:merchantId/returnaddress");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnaddress"
payload := strings.NewReader("{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/returnaddress HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 242
{
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/returnaddress")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnaddress"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\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 \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnaddress")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/returnaddress")
.header("content-type", "application/json")
.body("{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/returnaddress');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/returnaddress',
headers: {'content-type': 'application/json'},
data: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnaddress';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"address":{"country":"","locality":"","postalCode":"","recipientName":"","region":"","streetAddress":[]},"country":"","kind":"","label":"","phoneNumber":"","returnAddressId":""}'
};
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}}/:merchantId/returnaddress',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "recipientName": "",\n "region": "",\n "streetAddress": []\n },\n "country": "",\n "kind": "",\n "label": "",\n "phoneNumber": "",\n "returnAddressId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnaddress")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnaddress',
headers: {
'content-type': 'application/json'
}
};
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({
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/returnaddress',
headers: {'content-type': 'application/json'},
body: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
},
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}}/:merchantId/returnaddress');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
});
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}}/:merchantId/returnaddress',
headers: {'content-type': 'application/json'},
data: {
address: {
country: '',
locality: '',
postalCode: '',
recipientName: '',
region: '',
streetAddress: []
},
country: '',
kind: '',
label: '',
phoneNumber: '',
returnAddressId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnaddress';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"address":{"country":"","locality":"","postalCode":"","recipientName":"","region":"","streetAddress":[]},"country":"","kind":"","label":"","phoneNumber":"","returnAddressId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @{ @"country": @"", @"locality": @"", @"postalCode": @"", @"recipientName": @"", @"region": @"", @"streetAddress": @[ ] },
@"country": @"",
@"kind": @"",
@"label": @"",
@"phoneNumber": @"",
@"returnAddressId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnaddress"]
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}}/:merchantId/returnaddress" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnaddress",
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([
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'country' => '',
'kind' => '',
'label' => '',
'phoneNumber' => '',
'returnAddressId' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/returnaddress', [
'body' => '{
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnaddress');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'country' => '',
'kind' => '',
'label' => '',
'phoneNumber' => '',
'returnAddressId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => [
'country' => '',
'locality' => '',
'postalCode' => '',
'recipientName' => '',
'region' => '',
'streetAddress' => [
]
],
'country' => '',
'kind' => '',
'label' => '',
'phoneNumber' => '',
'returnAddressId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/returnaddress');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnaddress' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnaddress' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/returnaddress", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnaddress"
payload = {
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnaddress"
payload <- "{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnaddress")
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 \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\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.post('/baseUrl/:merchantId/returnaddress') do |req|
req.body = "{\n \"address\": {\n \"country\": \"\",\n \"locality\": \"\",\n \"postalCode\": \"\",\n \"recipientName\": \"\",\n \"region\": \"\",\n \"streetAddress\": []\n },\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"phoneNumber\": \"\",\n \"returnAddressId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnaddress";
let payload = json!({
"address": json!({
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": ()
}),
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/returnaddress \
--header 'content-type: application/json' \
--data '{
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}'
echo '{
"address": {
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
},
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
}' | \
http POST {{baseUrl}}/:merchantId/returnaddress \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "address": {\n "country": "",\n "locality": "",\n "postalCode": "",\n "recipientName": "",\n "region": "",\n "streetAddress": []\n },\n "country": "",\n "kind": "",\n "label": "",\n "phoneNumber": "",\n "returnAddressId": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/returnaddress
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"address": [
"country": "",
"locality": "",
"postalCode": "",
"recipientName": "",
"region": "",
"streetAddress": []
],
"country": "",
"kind": "",
"label": "",
"phoneNumber": "",
"returnAddressId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnaddress")! 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()
GET
content.returnaddress.list
{{baseUrl}}/:merchantId/returnaddress
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnaddress");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/returnaddress")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnaddress"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnaddress"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnaddress");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnaddress"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/returnaddress HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/returnaddress")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnaddress"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnaddress")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/returnaddress")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/returnaddress');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/returnaddress'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnaddress';
const options = {method: 'GET'};
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}}/:merchantId/returnaddress',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnaddress")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnaddress',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/returnaddress'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/returnaddress');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/returnaddress'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnaddress';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnaddress"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/returnaddress" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnaddress",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/returnaddress');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnaddress');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnaddress');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnaddress' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnaddress' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/returnaddress")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnaddress"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnaddress"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnaddress")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/returnaddress') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnaddress";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/returnaddress
http GET {{baseUrl}}/:merchantId/returnaddress
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/returnaddress
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnaddress")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.returnpolicy.custombatch
{{baseUrl}}/returnpolicy/batch
BODY json
{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
},
"returnPolicyId": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/returnpolicy/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/returnpolicy/batch" {:content-type :json
:form-params {:entries [{:batchId 0
:merchantId ""
:method ""
:returnPolicy {:country ""
:kind ""
:label ""
:name ""
:nonFreeReturnReasons []
:policy {:lastReturnDate ""
:numberOfDays ""
:type ""}
:returnPolicyId ""
:returnShippingFee {:currency ""
:value ""}
:seasonalOverrides [{:endDate ""
:name ""
:policy {}
:startDate ""}]}
:returnPolicyId ""}]}})
require "http/client"
url = "{{baseUrl}}/returnpolicy/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\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}}/returnpolicy/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\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}}/returnpolicy/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/returnpolicy/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/returnpolicy/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 682
{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
},
"returnPolicyId": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/returnpolicy/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/returnpolicy/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\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 \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/returnpolicy/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/returnpolicy/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnPolicy: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {
lastReturnDate: '',
numberOfDays: '',
type: ''
},
returnPolicyId: '',
returnShippingFee: {
currency: '',
value: ''
},
seasonalOverrides: [
{
endDate: '',
name: '',
policy: {},
startDate: ''
}
]
},
returnPolicyId: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/returnpolicy/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/returnpolicy/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnPolicy: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {lastReturnDate: '', numberOfDays: '', type: ''},
returnPolicyId: '',
returnShippingFee: {currency: '', value: ''},
seasonalOverrides: [{endDate: '', name: '', policy: {}, startDate: ''}]
},
returnPolicyId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/returnpolicy/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"merchantId":"","method":"","returnPolicy":{"country":"","kind":"","label":"","name":"","nonFreeReturnReasons":[],"policy":{"lastReturnDate":"","numberOfDays":"","type":""},"returnPolicyId":"","returnShippingFee":{"currency":"","value":""},"seasonalOverrides":[{"endDate":"","name":"","policy":{},"startDate":""}]},"returnPolicyId":""}]}'
};
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}}/returnpolicy/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "batchId": 0,\n "merchantId": "",\n "method": "",\n "returnPolicy": {\n "country": "",\n "kind": "",\n "label": "",\n "name": "",\n "nonFreeReturnReasons": [],\n "policy": {\n "lastReturnDate": "",\n "numberOfDays": "",\n "type": ""\n },\n "returnPolicyId": "",\n "returnShippingFee": {\n "currency": "",\n "value": ""\n },\n "seasonalOverrides": [\n {\n "endDate": "",\n "name": "",\n "policy": {},\n "startDate": ""\n }\n ]\n },\n "returnPolicyId": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/returnpolicy/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/returnpolicy/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnPolicy: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {lastReturnDate: '', numberOfDays: '', type: ''},
returnPolicyId: '',
returnShippingFee: {currency: '', value: ''},
seasonalOverrides: [{endDate: '', name: '', policy: {}, startDate: ''}]
},
returnPolicyId: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/returnpolicy/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnPolicy: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {lastReturnDate: '', numberOfDays: '', type: ''},
returnPolicyId: '',
returnShippingFee: {currency: '', value: ''},
seasonalOverrides: [{endDate: '', name: '', policy: {}, startDate: ''}]
},
returnPolicyId: ''
}
]
},
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}}/returnpolicy/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnPolicy: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {
lastReturnDate: '',
numberOfDays: '',
type: ''
},
returnPolicyId: '',
returnShippingFee: {
currency: '',
value: ''
},
seasonalOverrides: [
{
endDate: '',
name: '',
policy: {},
startDate: ''
}
]
},
returnPolicyId: ''
}
]
});
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}}/returnpolicy/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
batchId: 0,
merchantId: '',
method: '',
returnPolicy: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {lastReturnDate: '', numberOfDays: '', type: ''},
returnPolicyId: '',
returnShippingFee: {currency: '', value: ''},
seasonalOverrides: [{endDate: '', name: '', policy: {}, startDate: ''}]
},
returnPolicyId: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/returnpolicy/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"batchId":0,"merchantId":"","method":"","returnPolicy":{"country":"","kind":"","label":"","name":"","nonFreeReturnReasons":[],"policy":{"lastReturnDate":"","numberOfDays":"","type":""},"returnPolicyId":"","returnShippingFee":{"currency":"","value":""},"seasonalOverrides":[{"endDate":"","name":"","policy":{},"startDate":""}]},"returnPolicyId":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"batchId": @0, @"merchantId": @"", @"method": @"", @"returnPolicy": @{ @"country": @"", @"kind": @"", @"label": @"", @"name": @"", @"nonFreeReturnReasons": @[ ], @"policy": @{ @"lastReturnDate": @"", @"numberOfDays": @"", @"type": @"" }, @"returnPolicyId": @"", @"returnShippingFee": @{ @"currency": @"", @"value": @"" }, @"seasonalOverrides": @[ @{ @"endDate": @"", @"name": @"", @"policy": @{ }, @"startDate": @"" } ] }, @"returnPolicyId": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/returnpolicy/batch"]
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}}/returnpolicy/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/returnpolicy/batch",
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([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'returnPolicy' => [
'country' => '',
'kind' => '',
'label' => '',
'name' => '',
'nonFreeReturnReasons' => [
],
'policy' => [
'lastReturnDate' => '',
'numberOfDays' => '',
'type' => ''
],
'returnPolicyId' => '',
'returnShippingFee' => [
'currency' => '',
'value' => ''
],
'seasonalOverrides' => [
[
'endDate' => '',
'name' => '',
'policy' => [
],
'startDate' => ''
]
]
],
'returnPolicyId' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/returnpolicy/batch', [
'body' => '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
},
"returnPolicyId": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/returnpolicy/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'returnPolicy' => [
'country' => '',
'kind' => '',
'label' => '',
'name' => '',
'nonFreeReturnReasons' => [
],
'policy' => [
'lastReturnDate' => '',
'numberOfDays' => '',
'type' => ''
],
'returnPolicyId' => '',
'returnShippingFee' => [
'currency' => '',
'value' => ''
],
'seasonalOverrides' => [
[
'endDate' => '',
'name' => '',
'policy' => [
],
'startDate' => ''
]
]
],
'returnPolicyId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'batchId' => 0,
'merchantId' => '',
'method' => '',
'returnPolicy' => [
'country' => '',
'kind' => '',
'label' => '',
'name' => '',
'nonFreeReturnReasons' => [
],
'policy' => [
'lastReturnDate' => '',
'numberOfDays' => '',
'type' => ''
],
'returnPolicyId' => '',
'returnShippingFee' => [
'currency' => '',
'value' => ''
],
'seasonalOverrides' => [
[
'endDate' => '',
'name' => '',
'policy' => [
],
'startDate' => ''
]
]
],
'returnPolicyId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/returnpolicy/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/returnpolicy/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
},
"returnPolicyId": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/returnpolicy/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
},
"returnPolicyId": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/returnpolicy/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/returnpolicy/batch"
payload = { "entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
},
"returnPolicyId": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/returnpolicy/batch"
payload <- "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/returnpolicy/batch")
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 \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\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.post('/baseUrl/returnpolicy/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"returnPolicy\": {\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n },\n \"returnPolicyId\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/returnpolicy/batch";
let payload = json!({"entries": (
json!({
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": json!({
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": (),
"policy": json!({
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
}),
"returnPolicyId": "",
"returnShippingFee": json!({
"currency": "",
"value": ""
}),
"seasonalOverrides": (
json!({
"endDate": "",
"name": "",
"policy": json!({}),
"startDate": ""
})
)
}),
"returnPolicyId": ""
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/returnpolicy/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
},
"returnPolicyId": ""
}
]
}'
echo '{
"entries": [
{
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
},
"returnPolicyId": ""
}
]
}' | \
http POST {{baseUrl}}/returnpolicy/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "batchId": 0,\n "merchantId": "",\n "method": "",\n "returnPolicy": {\n "country": "",\n "kind": "",\n "label": "",\n "name": "",\n "nonFreeReturnReasons": [],\n "policy": {\n "lastReturnDate": "",\n "numberOfDays": "",\n "type": ""\n },\n "returnPolicyId": "",\n "returnShippingFee": {\n "currency": "",\n "value": ""\n },\n "seasonalOverrides": [\n {\n "endDate": "",\n "name": "",\n "policy": {},\n "startDate": ""\n }\n ]\n },\n "returnPolicyId": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/returnpolicy/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"batchId": 0,
"merchantId": "",
"method": "",
"returnPolicy": [
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": [
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
],
"returnPolicyId": "",
"returnShippingFee": [
"currency": "",
"value": ""
],
"seasonalOverrides": [
[
"endDate": "",
"name": "",
"policy": [],
"startDate": ""
]
]
],
"returnPolicyId": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/returnpolicy/batch")! 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()
DELETE
content.returnpolicy.delete
{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId
QUERY PARAMS
merchantId
returnPolicyId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/returnpolicy/:returnPolicyId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId';
const options = {method: 'DELETE'};
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}}/:merchantId/returnpolicy/:returnPolicyId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicy/:returnPolicyId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/returnpolicy/:returnPolicyId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/returnpolicy/:returnPolicyId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/returnpolicy/:returnPolicyId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId
http DELETE {{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.returnpolicy.get
{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId
QUERY PARAMS
merchantId
returnPolicyId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/returnpolicy/:returnPolicyId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId';
const options = {method: 'GET'};
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}}/:merchantId/returnpolicy/:returnPolicyId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicy/:returnPolicyId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/returnpolicy/:returnPolicyId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/returnpolicy/:returnPolicyId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/returnpolicy/:returnPolicyId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId
http GET {{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicy/:returnPolicyId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.returnpolicy.insert
{{baseUrl}}/:merchantId/returnpolicy
QUERY PARAMS
merchantId
BODY json
{
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/returnpolicy" {:content-type :json
:form-params {:country ""
:kind ""
:label ""
:name ""
:nonFreeReturnReasons []
:policy {:lastReturnDate ""
:numberOfDays ""
:type ""}
:returnPolicyId ""
:returnShippingFee {:currency ""
:value ""}
:seasonalOverrides [{:endDate ""
:name ""
:policy {}
:startDate ""}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\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}}/:merchantId/returnpolicy"),
Content = new StringContent("{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\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}}/:merchantId/returnpolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicy"
payload := strings.NewReader("{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/returnpolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 389
{
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/returnpolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\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 \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/returnpolicy")
.header("content-type", "application/json")
.body("{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {
lastReturnDate: '',
numberOfDays: '',
type: ''
},
returnPolicyId: '',
returnShippingFee: {
currency: '',
value: ''
},
seasonalOverrides: [
{
endDate: '',
name: '',
policy: {},
startDate: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/returnpolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/returnpolicy',
headers: {'content-type': 'application/json'},
data: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {lastReturnDate: '', numberOfDays: '', type: ''},
returnPolicyId: '',
returnShippingFee: {currency: '', value: ''},
seasonalOverrides: [{endDate: '', name: '', policy: {}, startDate: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"country":"","kind":"","label":"","name":"","nonFreeReturnReasons":[],"policy":{"lastReturnDate":"","numberOfDays":"","type":""},"returnPolicyId":"","returnShippingFee":{"currency":"","value":""},"seasonalOverrides":[{"endDate":"","name":"","policy":{},"startDate":""}]}'
};
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}}/:merchantId/returnpolicy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "country": "",\n "kind": "",\n "label": "",\n "name": "",\n "nonFreeReturnReasons": [],\n "policy": {\n "lastReturnDate": "",\n "numberOfDays": "",\n "type": ""\n },\n "returnPolicyId": "",\n "returnShippingFee": {\n "currency": "",\n "value": ""\n },\n "seasonalOverrides": [\n {\n "endDate": "",\n "name": "",\n "policy": {},\n "startDate": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicy")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicy',
headers: {
'content-type': 'application/json'
}
};
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({
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {lastReturnDate: '', numberOfDays: '', type: ''},
returnPolicyId: '',
returnShippingFee: {currency: '', value: ''},
seasonalOverrides: [{endDate: '', name: '', policy: {}, startDate: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/returnpolicy',
headers: {'content-type': 'application/json'},
body: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {lastReturnDate: '', numberOfDays: '', type: ''},
returnPolicyId: '',
returnShippingFee: {currency: '', value: ''},
seasonalOverrides: [{endDate: '', name: '', policy: {}, startDate: ''}]
},
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}}/:merchantId/returnpolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {
lastReturnDate: '',
numberOfDays: '',
type: ''
},
returnPolicyId: '',
returnShippingFee: {
currency: '',
value: ''
},
seasonalOverrides: [
{
endDate: '',
name: '',
policy: {},
startDate: ''
}
]
});
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}}/:merchantId/returnpolicy',
headers: {'content-type': 'application/json'},
data: {
country: '',
kind: '',
label: '',
name: '',
nonFreeReturnReasons: [],
policy: {lastReturnDate: '', numberOfDays: '', type: ''},
returnPolicyId: '',
returnShippingFee: {currency: '', value: ''},
seasonalOverrides: [{endDate: '', name: '', policy: {}, startDate: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"country":"","kind":"","label":"","name":"","nonFreeReturnReasons":[],"policy":{"lastReturnDate":"","numberOfDays":"","type":""},"returnPolicyId":"","returnShippingFee":{"currency":"","value":""},"seasonalOverrides":[{"endDate":"","name":"","policy":{},"startDate":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"country": @"",
@"kind": @"",
@"label": @"",
@"name": @"",
@"nonFreeReturnReasons": @[ ],
@"policy": @{ @"lastReturnDate": @"", @"numberOfDays": @"", @"type": @"" },
@"returnPolicyId": @"",
@"returnShippingFee": @{ @"currency": @"", @"value": @"" },
@"seasonalOverrides": @[ @{ @"endDate": @"", @"name": @"", @"policy": @{ }, @"startDate": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicy"]
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}}/:merchantId/returnpolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicy",
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([
'country' => '',
'kind' => '',
'label' => '',
'name' => '',
'nonFreeReturnReasons' => [
],
'policy' => [
'lastReturnDate' => '',
'numberOfDays' => '',
'type' => ''
],
'returnPolicyId' => '',
'returnShippingFee' => [
'currency' => '',
'value' => ''
],
'seasonalOverrides' => [
[
'endDate' => '',
'name' => '',
'policy' => [
],
'startDate' => ''
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/returnpolicy', [
'body' => '{
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'country' => '',
'kind' => '',
'label' => '',
'name' => '',
'nonFreeReturnReasons' => [
],
'policy' => [
'lastReturnDate' => '',
'numberOfDays' => '',
'type' => ''
],
'returnPolicyId' => '',
'returnShippingFee' => [
'currency' => '',
'value' => ''
],
'seasonalOverrides' => [
[
'endDate' => '',
'name' => '',
'policy' => [
],
'startDate' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'country' => '',
'kind' => '',
'label' => '',
'name' => '',
'nonFreeReturnReasons' => [
],
'policy' => [
'lastReturnDate' => '',
'numberOfDays' => '',
'type' => ''
],
'returnPolicyId' => '',
'returnShippingFee' => [
'currency' => '',
'value' => ''
],
'seasonalOverrides' => [
[
'endDate' => '',
'name' => '',
'policy' => [
],
'startDate' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/returnpolicy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/returnpolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicy"
payload = {
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicy"
payload <- "{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicy")
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 \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\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.post('/baseUrl/:merchantId/returnpolicy') do |req|
req.body = "{\n \"country\": \"\",\n \"kind\": \"\",\n \"label\": \"\",\n \"name\": \"\",\n \"nonFreeReturnReasons\": [],\n \"policy\": {\n \"lastReturnDate\": \"\",\n \"numberOfDays\": \"\",\n \"type\": \"\"\n },\n \"returnPolicyId\": \"\",\n \"returnShippingFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"seasonalOverrides\": [\n {\n \"endDate\": \"\",\n \"name\": \"\",\n \"policy\": {},\n \"startDate\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnpolicy";
let payload = json!({
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": (),
"policy": json!({
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
}),
"returnPolicyId": "",
"returnShippingFee": json!({
"currency": "",
"value": ""
}),
"seasonalOverrides": (
json!({
"endDate": "",
"name": "",
"policy": json!({}),
"startDate": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/returnpolicy \
--header 'content-type: application/json' \
--data '{
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
}'
echo '{
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": {
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
},
"returnPolicyId": "",
"returnShippingFee": {
"currency": "",
"value": ""
},
"seasonalOverrides": [
{
"endDate": "",
"name": "",
"policy": {},
"startDate": ""
}
]
}' | \
http POST {{baseUrl}}/:merchantId/returnpolicy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "country": "",\n "kind": "",\n "label": "",\n "name": "",\n "nonFreeReturnReasons": [],\n "policy": {\n "lastReturnDate": "",\n "numberOfDays": "",\n "type": ""\n },\n "returnPolicyId": "",\n "returnShippingFee": {\n "currency": "",\n "value": ""\n },\n "seasonalOverrides": [\n {\n "endDate": "",\n "name": "",\n "policy": {},\n "startDate": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"country": "",
"kind": "",
"label": "",
"name": "",
"nonFreeReturnReasons": [],
"policy": [
"lastReturnDate": "",
"numberOfDays": "",
"type": ""
],
"returnPolicyId": "",
"returnShippingFee": [
"currency": "",
"value": ""
],
"seasonalOverrides": [
[
"endDate": "",
"name": "",
"policy": [],
"startDate": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicy")! 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()
GET
content.returnpolicy.list
{{baseUrl}}/:merchantId/returnpolicy
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicy");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/returnpolicy")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicy"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnpolicy"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnpolicy");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicy"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/returnpolicy HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/returnpolicy")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicy"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicy")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/returnpolicy")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/returnpolicy');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/returnpolicy'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicy';
const options = {method: 'GET'};
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}}/:merchantId/returnpolicy',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicy")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicy',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/returnpolicy'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/returnpolicy');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/returnpolicy'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicy';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/returnpolicy" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/returnpolicy');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicy');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnpolicy');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicy' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicy' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/returnpolicy")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicy"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicy"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/returnpolicy') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnpolicy";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/returnpolicy
http GET {{baseUrl}}/:merchantId/returnpolicy
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicy
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.returnpolicyonline.create
{{baseUrl}}/:merchantId/returnpolicyonline
QUERY PARAMS
merchantId
BODY json
{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicyonline");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/returnpolicyonline" {:content-type :json
:form-params {:countries []
:itemConditions []
:label ""
:name ""
:policy {:days ""
:type ""}
:restockingFee {:fixedFee {:currency ""
:value ""}
:microPercent 0}
:returnMethods []
:returnPolicyId ""
:returnPolicyUri ""
:returnReasonCategoryInfo [{:returnLabelSource ""
:returnReasonCategory ""
:returnShippingFee {:fixedFee {}
:type ""}}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicyonline"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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}}/:merchantId/returnpolicyonline"),
Content = new StringContent("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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}}/:merchantId/returnpolicyonline");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicyonline"
payload := strings.NewReader("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/returnpolicyonline HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 503
{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/returnpolicyonline")
.setHeader("content-type", "application/json")
.setBody("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicyonline"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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 \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/returnpolicyonline")
.header("content-type", "application/json")
.body("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {
days: '',
type: ''
},
restockingFee: {
fixedFee: {
currency: '',
value: ''
},
microPercent: 0
},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {
fixedFee: {},
type: ''
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/returnpolicyonline');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/returnpolicyonline',
headers: {'content-type': 'application/json'},
data: {
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {days: '', type: ''},
restockingFee: {fixedFee: {currency: '', value: ''}, microPercent: 0},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {fixedFee: {}, type: ''}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicyonline';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"countries":[],"itemConditions":[],"label":"","name":"","policy":{"days":"","type":""},"restockingFee":{"fixedFee":{"currency":"","value":""},"microPercent":0},"returnMethods":[],"returnPolicyId":"","returnPolicyUri":"","returnReasonCategoryInfo":[{"returnLabelSource":"","returnReasonCategory":"","returnShippingFee":{"fixedFee":{},"type":""}}]}'
};
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}}/:merchantId/returnpolicyonline',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "countries": [],\n "itemConditions": [],\n "label": "",\n "name": "",\n "policy": {\n "days": "",\n "type": ""\n },\n "restockingFee": {\n "fixedFee": {\n "currency": "",\n "value": ""\n },\n "microPercent": 0\n },\n "returnMethods": [],\n "returnPolicyId": "",\n "returnPolicyUri": "",\n "returnReasonCategoryInfo": [\n {\n "returnLabelSource": "",\n "returnReasonCategory": "",\n "returnShippingFee": {\n "fixedFee": {},\n "type": ""\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicyonline',
headers: {
'content-type': 'application/json'
}
};
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({
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {days: '', type: ''},
restockingFee: {fixedFee: {currency: '', value: ''}, microPercent: 0},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {fixedFee: {}, type: ''}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/returnpolicyonline',
headers: {'content-type': 'application/json'},
body: {
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {days: '', type: ''},
restockingFee: {fixedFee: {currency: '', value: ''}, microPercent: 0},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {fixedFee: {}, type: ''}
}
]
},
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}}/:merchantId/returnpolicyonline');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {
days: '',
type: ''
},
restockingFee: {
fixedFee: {
currency: '',
value: ''
},
microPercent: 0
},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {
fixedFee: {},
type: ''
}
}
]
});
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}}/:merchantId/returnpolicyonline',
headers: {'content-type': 'application/json'},
data: {
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {days: '', type: ''},
restockingFee: {fixedFee: {currency: '', value: ''}, microPercent: 0},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {fixedFee: {}, type: ''}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicyonline';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"countries":[],"itemConditions":[],"label":"","name":"","policy":{"days":"","type":""},"restockingFee":{"fixedFee":{"currency":"","value":""},"microPercent":0},"returnMethods":[],"returnPolicyId":"","returnPolicyUri":"","returnReasonCategoryInfo":[{"returnLabelSource":"","returnReasonCategory":"","returnShippingFee":{"fixedFee":{},"type":""}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"countries": @[ ],
@"itemConditions": @[ ],
@"label": @"",
@"name": @"",
@"policy": @{ @"days": @"", @"type": @"" },
@"restockingFee": @{ @"fixedFee": @{ @"currency": @"", @"value": @"" }, @"microPercent": @0 },
@"returnMethods": @[ ],
@"returnPolicyId": @"",
@"returnPolicyUri": @"",
@"returnReasonCategoryInfo": @[ @{ @"returnLabelSource": @"", @"returnReasonCategory": @"", @"returnShippingFee": @{ @"fixedFee": @{ }, @"type": @"" } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicyonline"]
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}}/:merchantId/returnpolicyonline" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicyonline",
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([
'countries' => [
],
'itemConditions' => [
],
'label' => '',
'name' => '',
'policy' => [
'days' => '',
'type' => ''
],
'restockingFee' => [
'fixedFee' => [
'currency' => '',
'value' => ''
],
'microPercent' => 0
],
'returnMethods' => [
],
'returnPolicyId' => '',
'returnPolicyUri' => '',
'returnReasonCategoryInfo' => [
[
'returnLabelSource' => '',
'returnReasonCategory' => '',
'returnShippingFee' => [
'fixedFee' => [
],
'type' => ''
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/returnpolicyonline', [
'body' => '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicyonline');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'countries' => [
],
'itemConditions' => [
],
'label' => '',
'name' => '',
'policy' => [
'days' => '',
'type' => ''
],
'restockingFee' => [
'fixedFee' => [
'currency' => '',
'value' => ''
],
'microPercent' => 0
],
'returnMethods' => [
],
'returnPolicyId' => '',
'returnPolicyUri' => '',
'returnReasonCategoryInfo' => [
[
'returnLabelSource' => '',
'returnReasonCategory' => '',
'returnShippingFee' => [
'fixedFee' => [
],
'type' => ''
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'countries' => [
],
'itemConditions' => [
],
'label' => '',
'name' => '',
'policy' => [
'days' => '',
'type' => ''
],
'restockingFee' => [
'fixedFee' => [
'currency' => '',
'value' => ''
],
'microPercent' => 0
],
'returnMethods' => [
],
'returnPolicyId' => '',
'returnPolicyUri' => '',
'returnReasonCategoryInfo' => [
[
'returnLabelSource' => '',
'returnReasonCategory' => '',
'returnShippingFee' => [
'fixedFee' => [
],
'type' => ''
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/returnpolicyonline');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicyonline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicyonline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/returnpolicyonline", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicyonline"
payload = {
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicyonline"
payload <- "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicyonline")
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 \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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.post('/baseUrl/:merchantId/returnpolicyonline') do |req|
req.body = "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnpolicyonline";
let payload = json!({
"countries": (),
"itemConditions": (),
"label": "",
"name": "",
"policy": json!({
"days": "",
"type": ""
}),
"restockingFee": json!({
"fixedFee": json!({
"currency": "",
"value": ""
}),
"microPercent": 0
}),
"returnMethods": (),
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": (
json!({
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": json!({
"fixedFee": json!({}),
"type": ""
})
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/returnpolicyonline \
--header 'content-type: application/json' \
--data '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}'
echo '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}' | \
http POST {{baseUrl}}/:merchantId/returnpolicyonline \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "countries": [],\n "itemConditions": [],\n "label": "",\n "name": "",\n "policy": {\n "days": "",\n "type": ""\n },\n "restockingFee": {\n "fixedFee": {\n "currency": "",\n "value": ""\n },\n "microPercent": 0\n },\n "returnMethods": [],\n "returnPolicyId": "",\n "returnPolicyUri": "",\n "returnReasonCategoryInfo": [\n {\n "returnLabelSource": "",\n "returnReasonCategory": "",\n "returnShippingFee": {\n "fixedFee": {},\n "type": ""\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicyonline
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": [
"days": "",
"type": ""
],
"restockingFee": [
"fixedFee": [
"currency": "",
"value": ""
],
"microPercent": 0
],
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
[
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": [
"fixedFee": [],
"type": ""
]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicyonline")! 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()
DELETE
content.returnpolicyonline.delete
{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
QUERY PARAMS
merchantId
returnPolicyId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/:merchantId/returnpolicyonline/:returnPolicyId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId';
const options = {method: 'DELETE'};
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}}/:merchantId/returnpolicyonline/:returnPolicyId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
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}}/:merchantId/returnpolicyonline/:returnPolicyId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
http DELETE {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
GET
content.returnpolicyonline.get
{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
QUERY PARAMS
merchantId
returnPolicyId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/returnpolicyonline/:returnPolicyId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId';
const options = {method: 'GET'};
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}}/:merchantId/returnpolicyonline/:returnPolicyId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/returnpolicyonline/:returnPolicyId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
http GET {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.returnpolicyonline.list
{{baseUrl}}/:merchantId/returnpolicyonline
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicyonline");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/returnpolicyonline")
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicyonline"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnpolicyonline"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/returnpolicyonline");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicyonline"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/returnpolicyonline HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/returnpolicyonline")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicyonline"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/returnpolicyonline")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/returnpolicyonline');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicyonline'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicyonline';
const options = {method: 'GET'};
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}}/:merchantId/returnpolicyonline',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicyonline',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicyonline'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/returnpolicyonline');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/returnpolicyonline'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicyonline';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicyonline"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/returnpolicyonline" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicyonline",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/returnpolicyonline');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicyonline');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/returnpolicyonline');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicyonline' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicyonline' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/returnpolicyonline")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicyonline"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicyonline"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicyonline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/returnpolicyonline') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/returnpolicyonline";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/returnpolicyonline
http GET {{baseUrl}}/:merchantId/returnpolicyonline
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicyonline
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicyonline")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PATCH
content.returnpolicyonline.patch
{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
QUERY PARAMS
merchantId
returnPolicyId
BODY json
{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId" {:content-type :json
:form-params {:countries []
:itemConditions []
:label ""
:name ""
:policy {:days ""
:type ""}
:restockingFee {:fixedFee {:currency ""
:value ""}
:microPercent 0}
:returnMethods []
:returnPolicyId ""
:returnPolicyUri ""
:returnReasonCategoryInfo [{:returnLabelSource ""
:returnReasonCategory ""
:returnShippingFee {:fixedFee {}
:type ""}}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"),
Content = new StringContent("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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}}/:merchantId/returnpolicyonline/:returnPolicyId");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
payload := strings.NewReader("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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(res)
fmt.Println(string(body))
}
PATCH /baseUrl/:merchantId/returnpolicyonline/:returnPolicyId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 503
{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.setHeader("content-type", "application/json")
.setBody("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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 \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.header("content-type", "application/json")
.body("{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {
days: '',
type: ''
},
restockingFee: {
fixedFee: {
currency: '',
value: ''
},
microPercent: 0
},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {
fixedFee: {},
type: ''
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId',
headers: {'content-type': 'application/json'},
data: {
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {days: '', type: ''},
restockingFee: {fixedFee: {currency: '', value: ''}, microPercent: 0},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {fixedFee: {}, type: ''}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"countries":[],"itemConditions":[],"label":"","name":"","policy":{"days":"","type":""},"restockingFee":{"fixedFee":{"currency":"","value":""},"microPercent":0},"returnMethods":[],"returnPolicyId":"","returnPolicyUri":"","returnReasonCategoryInfo":[{"returnLabelSource":"","returnReasonCategory":"","returnShippingFee":{"fixedFee":{},"type":""}}]}'
};
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}}/:merchantId/returnpolicyonline/:returnPolicyId',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "countries": [],\n "itemConditions": [],\n "label": "",\n "name": "",\n "policy": {\n "days": "",\n "type": ""\n },\n "restockingFee": {\n "fixedFee": {\n "currency": "",\n "value": ""\n },\n "microPercent": 0\n },\n "returnMethods": [],\n "returnPolicyId": "",\n "returnPolicyUri": "",\n "returnReasonCategoryInfo": [\n {\n "returnLabelSource": "",\n "returnReasonCategory": "",\n "returnShippingFee": {\n "fixedFee": {},\n "type": ""\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId',
headers: {
'content-type': 'application/json'
}
};
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({
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {days: '', type: ''},
restockingFee: {fixedFee: {currency: '', value: ''}, microPercent: 0},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {fixedFee: {}, type: ''}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId',
headers: {'content-type': 'application/json'},
body: {
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {days: '', type: ''},
restockingFee: {fixedFee: {currency: '', value: ''}, microPercent: 0},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {fixedFee: {}, type: ''}
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {
days: '',
type: ''
},
restockingFee: {
fixedFee: {
currency: '',
value: ''
},
microPercent: 0
},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {
fixedFee: {},
type: ''
}
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId',
headers: {'content-type': 'application/json'},
data: {
countries: [],
itemConditions: [],
label: '',
name: '',
policy: {days: '', type: ''},
restockingFee: {fixedFee: {currency: '', value: ''}, microPercent: 0},
returnMethods: [],
returnPolicyId: '',
returnPolicyUri: '',
returnReasonCategoryInfo: [
{
returnLabelSource: '',
returnReasonCategory: '',
returnShippingFee: {fixedFee: {}, type: ''}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"countries":[],"itemConditions":[],"label":"","name":"","policy":{"days":"","type":""},"restockingFee":{"fixedFee":{"currency":"","value":""},"microPercent":0},"returnMethods":[],"returnPolicyId":"","returnPolicyUri":"","returnReasonCategoryInfo":[{"returnLabelSource":"","returnReasonCategory":"","returnShippingFee":{"fixedFee":{},"type":""}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"countries": @[ ],
@"itemConditions": @[ ],
@"label": @"",
@"name": @"",
@"policy": @{ @"days": @"", @"type": @"" },
@"restockingFee": @{ @"fixedFee": @{ @"currency": @"", @"value": @"" }, @"microPercent": @0 },
@"returnMethods": @[ ],
@"returnPolicyId": @"",
@"returnPolicyUri": @"",
@"returnReasonCategoryInfo": @[ @{ @"returnLabelSource": @"", @"returnReasonCategory": @"", @"returnShippingFee": @{ @"fixedFee": @{ }, @"type": @"" } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/:merchantId/returnpolicyonline/:returnPolicyId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'countries' => [
],
'itemConditions' => [
],
'label' => '',
'name' => '',
'policy' => [
'days' => '',
'type' => ''
],
'restockingFee' => [
'fixedFee' => [
'currency' => '',
'value' => ''
],
'microPercent' => 0
],
'returnMethods' => [
],
'returnPolicyId' => '',
'returnPolicyUri' => '',
'returnReasonCategoryInfo' => [
[
'returnLabelSource' => '',
'returnReasonCategory' => '',
'returnShippingFee' => [
'fixedFee' => [
],
'type' => ''
]
]
]
]),
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;
}
request('PATCH', '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId', [
'body' => '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'countries' => [
],
'itemConditions' => [
],
'label' => '',
'name' => '',
'policy' => [
'days' => '',
'type' => ''
],
'restockingFee' => [
'fixedFee' => [
'currency' => '',
'value' => ''
],
'microPercent' => 0
],
'returnMethods' => [
],
'returnPolicyId' => '',
'returnPolicyUri' => '',
'returnReasonCategoryInfo' => [
[
'returnLabelSource' => '',
'returnReasonCategory' => '',
'returnShippingFee' => [
'fixedFee' => [
],
'type' => ''
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'countries' => [
],
'itemConditions' => [
],
'label' => '',
'name' => '',
'policy' => [
'days' => '',
'type' => ''
],
'restockingFee' => [
'fixedFee' => [
'currency' => '',
'value' => ''
],
'microPercent' => 0
],
'returnMethods' => [
],
'returnPolicyId' => '',
'returnPolicyUri' => '',
'returnReasonCategoryInfo' => [
[
'returnLabelSource' => '',
'returnReasonCategory' => '',
'returnShippingFee' => [
'fixedFee' => [
],
'type' => ''
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
payload = {
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId"
payload <- "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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.patch('/baseUrl/:merchantId/returnpolicyonline/:returnPolicyId') do |req|
req.body = "{\n \"countries\": [],\n \"itemConditions\": [],\n \"label\": \"\",\n \"name\": \"\",\n \"policy\": {\n \"days\": \"\",\n \"type\": \"\"\n },\n \"restockingFee\": {\n \"fixedFee\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"microPercent\": 0\n },\n \"returnMethods\": [],\n \"returnPolicyId\": \"\",\n \"returnPolicyUri\": \"\",\n \"returnReasonCategoryInfo\": [\n {\n \"returnLabelSource\": \"\",\n \"returnReasonCategory\": \"\",\n \"returnShippingFee\": {\n \"fixedFee\": {},\n \"type\": \"\"\n }\n }\n ]\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}}/:merchantId/returnpolicyonline/:returnPolicyId";
let payload = json!({
"countries": (),
"itemConditions": (),
"label": "",
"name": "",
"policy": json!({
"days": "",
"type": ""
}),
"restockingFee": json!({
"fixedFee": json!({
"currency": "",
"value": ""
}),
"microPercent": 0
}),
"returnMethods": (),
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": (
json!({
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": json!({
"fixedFee": json!({}),
"type": ""
})
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId \
--header 'content-type: application/json' \
--data '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}'
echo '{
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": {
"days": "",
"type": ""
},
"restockingFee": {
"fixedFee": {
"currency": "",
"value": ""
},
"microPercent": 0
},
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
{
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": {
"fixedFee": {},
"type": ""
}
}
]
}' | \
http PATCH {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "countries": [],\n "itemConditions": [],\n "label": "",\n "name": "",\n "policy": {\n "days": "",\n "type": ""\n },\n "restockingFee": {\n "fixedFee": {\n "currency": "",\n "value": ""\n },\n "microPercent": 0\n },\n "returnMethods": [],\n "returnPolicyId": "",\n "returnPolicyUri": "",\n "returnReasonCategoryInfo": [\n {\n "returnLabelSource": "",\n "returnReasonCategory": "",\n "returnShippingFee": {\n "fixedFee": {},\n "type": ""\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"countries": [],
"itemConditions": [],
"label": "",
"name": "",
"policy": [
"days": "",
"type": ""
],
"restockingFee": [
"fixedFee": [
"currency": "",
"value": ""
],
"microPercent": 0
],
"returnMethods": [],
"returnPolicyId": "",
"returnPolicyUri": "",
"returnReasonCategoryInfo": [
[
"returnLabelSource": "",
"returnReasonCategory": "",
"returnShippingFee": [
"fixedFee": [],
"type": ""
]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/returnpolicyonline/:returnPolicyId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
GET
content.settlementreports.get
{{baseUrl}}/:merchantId/settlementreports/:settlementId
QUERY PARAMS
merchantId
settlementId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/settlementreports/:settlementId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/settlementreports/:settlementId")
require "http/client"
url = "{{baseUrl}}/:merchantId/settlementreports/:settlementId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/settlementreports/:settlementId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/settlementreports/:settlementId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/settlementreports/:settlementId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/settlementreports/:settlementId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/settlementreports/:settlementId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/settlementreports/:settlementId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/settlementreports/:settlementId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/settlementreports/:settlementId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/settlementreports/:settlementId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports/:settlementId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/settlementreports/:settlementId';
const options = {method: 'GET'};
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}}/:merchantId/settlementreports/:settlementId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/settlementreports/:settlementId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/settlementreports/:settlementId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports/:settlementId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/settlementreports/:settlementId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports/:settlementId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/settlementreports/:settlementId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/settlementreports/:settlementId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/settlementreports/:settlementId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/settlementreports/:settlementId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/settlementreports/:settlementId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/settlementreports/:settlementId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/settlementreports/:settlementId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/settlementreports/:settlementId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/settlementreports/:settlementId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/settlementreports/:settlementId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/settlementreports/:settlementId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/settlementreports/:settlementId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/settlementreports/:settlementId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/settlementreports/:settlementId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/settlementreports/:settlementId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/settlementreports/:settlementId
http GET {{baseUrl}}/:merchantId/settlementreports/:settlementId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/settlementreports/:settlementId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/settlementreports/:settlementId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.settlementreports.list
{{baseUrl}}/:merchantId/settlementreports
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/settlementreports");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/settlementreports")
require "http/client"
url = "{{baseUrl}}/:merchantId/settlementreports"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/settlementreports"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/settlementreports");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/settlementreports"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/settlementreports HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/settlementreports")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/settlementreports"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/settlementreports")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/settlementreports")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/settlementreports');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/settlementreports';
const options = {method: 'GET'};
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}}/:merchantId/settlementreports',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/settlementreports")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/settlementreports',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/settlementreports');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/settlementreports';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/settlementreports"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/settlementreports" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/settlementreports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/settlementreports');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/settlementreports');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/settlementreports');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/settlementreports' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/settlementreports' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/settlementreports")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/settlementreports"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/settlementreports"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/settlementreports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/settlementreports') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/settlementreports";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/settlementreports
http GET {{baseUrl}}/:merchantId/settlementreports
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/settlementreports
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/settlementreports")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.settlementtransactions.list
{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions
QUERY PARAMS
merchantId
settlementId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions")
require "http/client"
url = "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/settlementreports/:settlementId/transactions HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions';
const options = {method: 'GET'};
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}}/:merchantId/settlementreports/:settlementId/transactions',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/settlementreports/:settlementId/transactions',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/settlementreports/:settlementId/transactions" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/settlementreports/:settlementId/transactions")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/settlementreports/:settlementId/transactions') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions
http GET {{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/settlementreports/:settlementId/transactions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.shippingsettings.custombatch
{{baseUrl}}/shippingsettings/batch
BODY json
{
"entries": [
{
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/shippingsettings/batch");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/shippingsettings/batch" {:content-type :json
:form-params {:entries [{:accountId ""
:batchId 0
:merchantId ""
:method ""
:shippingSettings {:accountId ""
:postalCodeGroups [{:country ""
:name ""
:postalCodeRanges [{:postalCodeRangeBegin ""
:postalCodeRangeEnd ""}]}]
:services [{:active false
:currency ""
:deliveryCountry ""
:deliveryTime {:cutoffTime {:hour 0
:minute 0
:timezone ""}
:handlingBusinessDayConfig {:businessDays []}
:holidayCutoffs [{:deadlineDate ""
:deadlineHour 0
:deadlineTimezone ""
:holidayId ""
:visibleFromDate ""}]
:maxHandlingTimeInDays 0
:maxTransitTimeInDays 0
:minHandlingTimeInDays 0
:minTransitTimeInDays 0
:transitBusinessDayConfig {}
:transitTimeTable {:postalCodeGroupNames []
:rows [{:values [{:maxTransitTimeInDays 0
:minTransitTimeInDays 0}]}]
:transitTimeLabels []}
:warehouseBasedDeliveryTimes [{:carrier ""
:carrierService ""
:originAdministrativeArea ""
:originCity ""
:originCountry ""
:originPostalCode ""
:originStreetAddress ""
:warehouseName ""}]}
:eligibility ""
:minimumOrderValue {:currency ""
:value ""}
:minimumOrderValueTable {:storeCodeSetWithMovs [{:storeCodes []
:value {}}]}
:name ""
:pickupService {:carrierName ""
:serviceName ""}
:rateGroups [{:applicableShippingLabels []
:carrierRates [{:carrierName ""
:carrierService ""
:flatAdjustment {}
:name ""
:originPostalCode ""
:percentageAdjustment ""}]
:mainTable {:columnHeaders {:locations [{:locationIds []}]
:numberOfItems []
:postalCodeGroupNames []
:prices [{}]
:weights [{:unit ""
:value ""}]}
:name ""
:rowHeaders {}
:rows [{:cells [{:carrierRateName ""
:flatRate {}
:noShipping false
:pricePercentage ""
:subtableName ""}]}]}
:name ""
:singleValue {}
:subtables [{}]}]
:shipmentType ""}]
:warehouses [{:businessDayConfig {}
:cutoffTime {:hour 0
:minute 0}
:handlingDays ""
:name ""
:shippingAddress {:administrativeArea ""
:city ""
:country ""
:postalCode ""
:streetAddress ""}}]}}]}})
require "http/client"
url = "{{baseUrl}}/shippingsettings/batch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\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}}/shippingsettings/batch"),
Content = new StringContent("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\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}}/shippingsettings/batch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/shippingsettings/batch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\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(res)
fmt.Println(string(body))
}
POST /baseUrl/shippingsettings/batch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 4889
{
"entries": [
{
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/shippingsettings/batch")
.setHeader("content-type", "application/json")
.setBody("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/shippingsettings/batch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\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 \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/shippingsettings/batch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/shippingsettings/batch")
.header("content-type", "application/json")
.body("{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
entries: [
{
accountId: '',
batchId: 0,
merchantId: '',
method: '',
shippingSettings: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [
{
postalCodeRangeBegin: '',
postalCodeRangeEnd: ''
}
]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {
hour: 0,
minute: 0,
timezone: ''
},
handlingBusinessDayConfig: {
businessDays: []
},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [
{
values: [
{
maxTransitTimeInDays: 0,
minTransitTimeInDays: 0
}
]
}
],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {
currency: '',
value: ''
},
minimumOrderValueTable: {
storeCodeSetWithMovs: [
{
storeCodes: [],
value: {}
}
]
},
name: '',
pickupService: {
carrierName: '',
serviceName: ''
},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [
{
locationIds: []
}
],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [
{}
],
weights: [
{
unit: '',
value: ''
}
]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [
{}
]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {
hour: 0,
minute: 0
},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/shippingsettings/batch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/shippingsettings/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
accountId: '',
batchId: 0,
merchantId: '',
method: '',
shippingSettings: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [{postalCodeRangeBegin: '', postalCodeRangeEnd: ''}]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {hour: 0, minute: 0, timezone: ''},
handlingBusinessDayConfig: {businessDays: []},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [{values: [{maxTransitTimeInDays: 0, minTransitTimeInDays: 0}]}],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {currency: '', value: ''},
minimumOrderValueTable: {storeCodeSetWithMovs: [{storeCodes: [], value: {}}]},
name: '',
pickupService: {carrierName: '', serviceName: ''},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [{locationIds: []}],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [{}],
weights: [{unit: '', value: ''}]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [{}]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {hour: 0, minute: 0},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/shippingsettings/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"accountId":"","batchId":0,"merchantId":"","method":"","shippingSettings":{"accountId":"","postalCodeGroups":[{"country":"","name":"","postalCodeRanges":[{"postalCodeRangeBegin":"","postalCodeRangeEnd":""}]}],"services":[{"active":false,"currency":"","deliveryCountry":"","deliveryTime":{"cutoffTime":{"hour":0,"minute":0,"timezone":""},"handlingBusinessDayConfig":{"businessDays":[]},"holidayCutoffs":[{"deadlineDate":"","deadlineHour":0,"deadlineTimezone":"","holidayId":"","visibleFromDate":""}],"maxHandlingTimeInDays":0,"maxTransitTimeInDays":0,"minHandlingTimeInDays":0,"minTransitTimeInDays":0,"transitBusinessDayConfig":{},"transitTimeTable":{"postalCodeGroupNames":[],"rows":[{"values":[{"maxTransitTimeInDays":0,"minTransitTimeInDays":0}]}],"transitTimeLabels":[]},"warehouseBasedDeliveryTimes":[{"carrier":"","carrierService":"","originAdministrativeArea":"","originCity":"","originCountry":"","originPostalCode":"","originStreetAddress":"","warehouseName":""}]},"eligibility":"","minimumOrderValue":{"currency":"","value":""},"minimumOrderValueTable":{"storeCodeSetWithMovs":[{"storeCodes":[],"value":{}}]},"name":"","pickupService":{"carrierName":"","serviceName":""},"rateGroups":[{"applicableShippingLabels":[],"carrierRates":[{"carrierName":"","carrierService":"","flatAdjustment":{},"name":"","originPostalCode":"","percentageAdjustment":""}],"mainTable":{"columnHeaders":{"locations":[{"locationIds":[]}],"numberOfItems":[],"postalCodeGroupNames":[],"prices":[{}],"weights":[{"unit":"","value":""}]},"name":"","rowHeaders":{},"rows":[{"cells":[{"carrierRateName":"","flatRate":{},"noShipping":false,"pricePercentage":"","subtableName":""}]}]},"name":"","singleValue":{},"subtables":[{}]}],"shipmentType":""}],"warehouses":[{"businessDayConfig":{},"cutoffTime":{"hour":0,"minute":0},"handlingDays":"","name":"","shippingAddress":{"administrativeArea":"","city":"","country":"","postalCode":"","streetAddress":""}}]}}]}'
};
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}}/shippingsettings/batch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "entries": [\n {\n "accountId": "",\n "batchId": 0,\n "merchantId": "",\n "method": "",\n "shippingSettings": {\n "accountId": "",\n "postalCodeGroups": [\n {\n "country": "",\n "name": "",\n "postalCodeRanges": [\n {\n "postalCodeRangeBegin": "",\n "postalCodeRangeEnd": ""\n }\n ]\n }\n ],\n "services": [\n {\n "active": false,\n "currency": "",\n "deliveryCountry": "",\n "deliveryTime": {\n "cutoffTime": {\n "hour": 0,\n "minute": 0,\n "timezone": ""\n },\n "handlingBusinessDayConfig": {\n "businessDays": []\n },\n "holidayCutoffs": [\n {\n "deadlineDate": "",\n "deadlineHour": 0,\n "deadlineTimezone": "",\n "holidayId": "",\n "visibleFromDate": ""\n }\n ],\n "maxHandlingTimeInDays": 0,\n "maxTransitTimeInDays": 0,\n "minHandlingTimeInDays": 0,\n "minTransitTimeInDays": 0,\n "transitBusinessDayConfig": {},\n "transitTimeTable": {\n "postalCodeGroupNames": [],\n "rows": [\n {\n "values": [\n {\n "maxTransitTimeInDays": 0,\n "minTransitTimeInDays": 0\n }\n ]\n }\n ],\n "transitTimeLabels": []\n },\n "warehouseBasedDeliveryTimes": [\n {\n "carrier": "",\n "carrierService": "",\n "originAdministrativeArea": "",\n "originCity": "",\n "originCountry": "",\n "originPostalCode": "",\n "originStreetAddress": "",\n "warehouseName": ""\n }\n ]\n },\n "eligibility": "",\n "minimumOrderValue": {\n "currency": "",\n "value": ""\n },\n "minimumOrderValueTable": {\n "storeCodeSetWithMovs": [\n {\n "storeCodes": [],\n "value": {}\n }\n ]\n },\n "name": "",\n "pickupService": {\n "carrierName": "",\n "serviceName": ""\n },\n "rateGroups": [\n {\n "applicableShippingLabels": [],\n "carrierRates": [\n {\n "carrierName": "",\n "carrierService": "",\n "flatAdjustment": {},\n "name": "",\n "originPostalCode": "",\n "percentageAdjustment": ""\n }\n ],\n "mainTable": {\n "columnHeaders": {\n "locations": [\n {\n "locationIds": []\n }\n ],\n "numberOfItems": [],\n "postalCodeGroupNames": [],\n "prices": [\n {}\n ],\n "weights": [\n {\n "unit": "",\n "value": ""\n }\n ]\n },\n "name": "",\n "rowHeaders": {},\n "rows": [\n {\n "cells": [\n {\n "carrierRateName": "",\n "flatRate": {},\n "noShipping": false,\n "pricePercentage": "",\n "subtableName": ""\n }\n ]\n }\n ]\n },\n "name": "",\n "singleValue": {},\n "subtables": [\n {}\n ]\n }\n ],\n "shipmentType": ""\n }\n ],\n "warehouses": [\n {\n "businessDayConfig": {},\n "cutoffTime": {\n "hour": 0,\n "minute": 0\n },\n "handlingDays": "",\n "name": "",\n "shippingAddress": {\n "administrativeArea": "",\n "city": "",\n "country": "",\n "postalCode": "",\n "streetAddress": ""\n }\n }\n ]\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/shippingsettings/batch")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/shippingsettings/batch',
headers: {
'content-type': 'application/json'
}
};
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({
entries: [
{
accountId: '',
batchId: 0,
merchantId: '',
method: '',
shippingSettings: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [{postalCodeRangeBegin: '', postalCodeRangeEnd: ''}]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {hour: 0, minute: 0, timezone: ''},
handlingBusinessDayConfig: {businessDays: []},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [{values: [{maxTransitTimeInDays: 0, minTransitTimeInDays: 0}]}],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {currency: '', value: ''},
minimumOrderValueTable: {storeCodeSetWithMovs: [{storeCodes: [], value: {}}]},
name: '',
pickupService: {carrierName: '', serviceName: ''},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [{locationIds: []}],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [{}],
weights: [{unit: '', value: ''}]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [{}]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {hour: 0, minute: 0},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/shippingsettings/batch',
headers: {'content-type': 'application/json'},
body: {
entries: [
{
accountId: '',
batchId: 0,
merchantId: '',
method: '',
shippingSettings: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [{postalCodeRangeBegin: '', postalCodeRangeEnd: ''}]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {hour: 0, minute: 0, timezone: ''},
handlingBusinessDayConfig: {businessDays: []},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [{values: [{maxTransitTimeInDays: 0, minTransitTimeInDays: 0}]}],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {currency: '', value: ''},
minimumOrderValueTable: {storeCodeSetWithMovs: [{storeCodes: [], value: {}}]},
name: '',
pickupService: {carrierName: '', serviceName: ''},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [{locationIds: []}],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [{}],
weights: [{unit: '', value: ''}]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [{}]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {hour: 0, minute: 0},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}
}
]
},
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}}/shippingsettings/batch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
entries: [
{
accountId: '',
batchId: 0,
merchantId: '',
method: '',
shippingSettings: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [
{
postalCodeRangeBegin: '',
postalCodeRangeEnd: ''
}
]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {
hour: 0,
minute: 0,
timezone: ''
},
handlingBusinessDayConfig: {
businessDays: []
},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [
{
values: [
{
maxTransitTimeInDays: 0,
minTransitTimeInDays: 0
}
]
}
],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {
currency: '',
value: ''
},
minimumOrderValueTable: {
storeCodeSetWithMovs: [
{
storeCodes: [],
value: {}
}
]
},
name: '',
pickupService: {
carrierName: '',
serviceName: ''
},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [
{
locationIds: []
}
],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [
{}
],
weights: [
{
unit: '',
value: ''
}
]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [
{}
]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {
hour: 0,
minute: 0
},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}
}
]
});
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}}/shippingsettings/batch',
headers: {'content-type': 'application/json'},
data: {
entries: [
{
accountId: '',
batchId: 0,
merchantId: '',
method: '',
shippingSettings: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [{postalCodeRangeBegin: '', postalCodeRangeEnd: ''}]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {hour: 0, minute: 0, timezone: ''},
handlingBusinessDayConfig: {businessDays: []},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [{values: [{maxTransitTimeInDays: 0, minTransitTimeInDays: 0}]}],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {currency: '', value: ''},
minimumOrderValueTable: {storeCodeSetWithMovs: [{storeCodes: [], value: {}}]},
name: '',
pickupService: {carrierName: '', serviceName: ''},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [{locationIds: []}],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [{}],
weights: [{unit: '', value: ''}]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [{}]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {hour: 0, minute: 0},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/shippingsettings/batch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"entries":[{"accountId":"","batchId":0,"merchantId":"","method":"","shippingSettings":{"accountId":"","postalCodeGroups":[{"country":"","name":"","postalCodeRanges":[{"postalCodeRangeBegin":"","postalCodeRangeEnd":""}]}],"services":[{"active":false,"currency":"","deliveryCountry":"","deliveryTime":{"cutoffTime":{"hour":0,"minute":0,"timezone":""},"handlingBusinessDayConfig":{"businessDays":[]},"holidayCutoffs":[{"deadlineDate":"","deadlineHour":0,"deadlineTimezone":"","holidayId":"","visibleFromDate":""}],"maxHandlingTimeInDays":0,"maxTransitTimeInDays":0,"minHandlingTimeInDays":0,"minTransitTimeInDays":0,"transitBusinessDayConfig":{},"transitTimeTable":{"postalCodeGroupNames":[],"rows":[{"values":[{"maxTransitTimeInDays":0,"minTransitTimeInDays":0}]}],"transitTimeLabels":[]},"warehouseBasedDeliveryTimes":[{"carrier":"","carrierService":"","originAdministrativeArea":"","originCity":"","originCountry":"","originPostalCode":"","originStreetAddress":"","warehouseName":""}]},"eligibility":"","minimumOrderValue":{"currency":"","value":""},"minimumOrderValueTable":{"storeCodeSetWithMovs":[{"storeCodes":[],"value":{}}]},"name":"","pickupService":{"carrierName":"","serviceName":""},"rateGroups":[{"applicableShippingLabels":[],"carrierRates":[{"carrierName":"","carrierService":"","flatAdjustment":{},"name":"","originPostalCode":"","percentageAdjustment":""}],"mainTable":{"columnHeaders":{"locations":[{"locationIds":[]}],"numberOfItems":[],"postalCodeGroupNames":[],"prices":[{}],"weights":[{"unit":"","value":""}]},"name":"","rowHeaders":{},"rows":[{"cells":[{"carrierRateName":"","flatRate":{},"noShipping":false,"pricePercentage":"","subtableName":""}]}]},"name":"","singleValue":{},"subtables":[{}]}],"shipmentType":""}],"warehouses":[{"businessDayConfig":{},"cutoffTime":{"hour":0,"minute":0},"handlingDays":"","name":"","shippingAddress":{"administrativeArea":"","city":"","country":"","postalCode":"","streetAddress":""}}]}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"entries": @[ @{ @"accountId": @"", @"batchId": @0, @"merchantId": @"", @"method": @"", @"shippingSettings": @{ @"accountId": @"", @"postalCodeGroups": @[ @{ @"country": @"", @"name": @"", @"postalCodeRanges": @[ @{ @"postalCodeRangeBegin": @"", @"postalCodeRangeEnd": @"" } ] } ], @"services": @[ @{ @"active": @NO, @"currency": @"", @"deliveryCountry": @"", @"deliveryTime": @{ @"cutoffTime": @{ @"hour": @0, @"minute": @0, @"timezone": @"" }, @"handlingBusinessDayConfig": @{ @"businessDays": @[ ] }, @"holidayCutoffs": @[ @{ @"deadlineDate": @"", @"deadlineHour": @0, @"deadlineTimezone": @"", @"holidayId": @"", @"visibleFromDate": @"" } ], @"maxHandlingTimeInDays": @0, @"maxTransitTimeInDays": @0, @"minHandlingTimeInDays": @0, @"minTransitTimeInDays": @0, @"transitBusinessDayConfig": @{ }, @"transitTimeTable": @{ @"postalCodeGroupNames": @[ ], @"rows": @[ @{ @"values": @[ @{ @"maxTransitTimeInDays": @0, @"minTransitTimeInDays": @0 } ] } ], @"transitTimeLabels": @[ ] }, @"warehouseBasedDeliveryTimes": @[ @{ @"carrier": @"", @"carrierService": @"", @"originAdministrativeArea": @"", @"originCity": @"", @"originCountry": @"", @"originPostalCode": @"", @"originStreetAddress": @"", @"warehouseName": @"" } ] }, @"eligibility": @"", @"minimumOrderValue": @{ @"currency": @"", @"value": @"" }, @"minimumOrderValueTable": @{ @"storeCodeSetWithMovs": @[ @{ @"storeCodes": @[ ], @"value": @{ } } ] }, @"name": @"", @"pickupService": @{ @"carrierName": @"", @"serviceName": @"" }, @"rateGroups": @[ @{ @"applicableShippingLabels": @[ ], @"carrierRates": @[ @{ @"carrierName": @"", @"carrierService": @"", @"flatAdjustment": @{ }, @"name": @"", @"originPostalCode": @"", @"percentageAdjustment": @"" } ], @"mainTable": @{ @"columnHeaders": @{ @"locations": @[ @{ @"locationIds": @[ ] } ], @"numberOfItems": @[ ], @"postalCodeGroupNames": @[ ], @"prices": @[ @{ } ], @"weights": @[ @{ @"unit": @"", @"value": @"" } ] }, @"name": @"", @"rowHeaders": @{ }, @"rows": @[ @{ @"cells": @[ @{ @"carrierRateName": @"", @"flatRate": @{ }, @"noShipping": @NO, @"pricePercentage": @"", @"subtableName": @"" } ] } ] }, @"name": @"", @"singleValue": @{ }, @"subtables": @[ @{ } ] } ], @"shipmentType": @"" } ], @"warehouses": @[ @{ @"businessDayConfig": @{ }, @"cutoffTime": @{ @"hour": @0, @"minute": @0 }, @"handlingDays": @"", @"name": @"", @"shippingAddress": @{ @"administrativeArea": @"", @"city": @"", @"country": @"", @"postalCode": @"", @"streetAddress": @"" } } ] } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/shippingsettings/batch"]
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}}/shippingsettings/batch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/shippingsettings/batch",
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([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'merchantId' => '',
'method' => '',
'shippingSettings' => [
'accountId' => '',
'postalCodeGroups' => [
[
'country' => '',
'name' => '',
'postalCodeRanges' => [
[
'postalCodeRangeBegin' => '',
'postalCodeRangeEnd' => ''
]
]
]
],
'services' => [
[
'active' => null,
'currency' => '',
'deliveryCountry' => '',
'deliveryTime' => [
'cutoffTime' => [
'hour' => 0,
'minute' => 0,
'timezone' => ''
],
'handlingBusinessDayConfig' => [
'businessDays' => [
]
],
'holidayCutoffs' => [
[
'deadlineDate' => '',
'deadlineHour' => 0,
'deadlineTimezone' => '',
'holidayId' => '',
'visibleFromDate' => ''
]
],
'maxHandlingTimeInDays' => 0,
'maxTransitTimeInDays' => 0,
'minHandlingTimeInDays' => 0,
'minTransitTimeInDays' => 0,
'transitBusinessDayConfig' => [
],
'transitTimeTable' => [
'postalCodeGroupNames' => [
],
'rows' => [
[
'values' => [
[
'maxTransitTimeInDays' => 0,
'minTransitTimeInDays' => 0
]
]
]
],
'transitTimeLabels' => [
]
],
'warehouseBasedDeliveryTimes' => [
[
'carrier' => '',
'carrierService' => '',
'originAdministrativeArea' => '',
'originCity' => '',
'originCountry' => '',
'originPostalCode' => '',
'originStreetAddress' => '',
'warehouseName' => ''
]
]
],
'eligibility' => '',
'minimumOrderValue' => [
'currency' => '',
'value' => ''
],
'minimumOrderValueTable' => [
'storeCodeSetWithMovs' => [
[
'storeCodes' => [
],
'value' => [
]
]
]
],
'name' => '',
'pickupService' => [
'carrierName' => '',
'serviceName' => ''
],
'rateGroups' => [
[
'applicableShippingLabels' => [
],
'carrierRates' => [
[
'carrierName' => '',
'carrierService' => '',
'flatAdjustment' => [
],
'name' => '',
'originPostalCode' => '',
'percentageAdjustment' => ''
]
],
'mainTable' => [
'columnHeaders' => [
'locations' => [
[
'locationIds' => [
]
]
],
'numberOfItems' => [
],
'postalCodeGroupNames' => [
],
'prices' => [
[
]
],
'weights' => [
[
'unit' => '',
'value' => ''
]
]
],
'name' => '',
'rowHeaders' => [
],
'rows' => [
[
'cells' => [
[
'carrierRateName' => '',
'flatRate' => [
],
'noShipping' => null,
'pricePercentage' => '',
'subtableName' => ''
]
]
]
]
],
'name' => '',
'singleValue' => [
],
'subtables' => [
[
]
]
]
],
'shipmentType' => ''
]
],
'warehouses' => [
[
'businessDayConfig' => [
],
'cutoffTime' => [
'hour' => 0,
'minute' => 0
],
'handlingDays' => '',
'name' => '',
'shippingAddress' => [
'administrativeArea' => '',
'city' => '',
'country' => '',
'postalCode' => '',
'streetAddress' => ''
]
]
]
]
]
]
]),
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;
}
request('POST', '{{baseUrl}}/shippingsettings/batch', [
'body' => '{
"entries": [
{
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/shippingsettings/batch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'merchantId' => '',
'method' => '',
'shippingSettings' => [
'accountId' => '',
'postalCodeGroups' => [
[
'country' => '',
'name' => '',
'postalCodeRanges' => [
[
'postalCodeRangeBegin' => '',
'postalCodeRangeEnd' => ''
]
]
]
],
'services' => [
[
'active' => null,
'currency' => '',
'deliveryCountry' => '',
'deliveryTime' => [
'cutoffTime' => [
'hour' => 0,
'minute' => 0,
'timezone' => ''
],
'handlingBusinessDayConfig' => [
'businessDays' => [
]
],
'holidayCutoffs' => [
[
'deadlineDate' => '',
'deadlineHour' => 0,
'deadlineTimezone' => '',
'holidayId' => '',
'visibleFromDate' => ''
]
],
'maxHandlingTimeInDays' => 0,
'maxTransitTimeInDays' => 0,
'minHandlingTimeInDays' => 0,
'minTransitTimeInDays' => 0,
'transitBusinessDayConfig' => [
],
'transitTimeTable' => [
'postalCodeGroupNames' => [
],
'rows' => [
[
'values' => [
[
'maxTransitTimeInDays' => 0,
'minTransitTimeInDays' => 0
]
]
]
],
'transitTimeLabels' => [
]
],
'warehouseBasedDeliveryTimes' => [
[
'carrier' => '',
'carrierService' => '',
'originAdministrativeArea' => '',
'originCity' => '',
'originCountry' => '',
'originPostalCode' => '',
'originStreetAddress' => '',
'warehouseName' => ''
]
]
],
'eligibility' => '',
'minimumOrderValue' => [
'currency' => '',
'value' => ''
],
'minimumOrderValueTable' => [
'storeCodeSetWithMovs' => [
[
'storeCodes' => [
],
'value' => [
]
]
]
],
'name' => '',
'pickupService' => [
'carrierName' => '',
'serviceName' => ''
],
'rateGroups' => [
[
'applicableShippingLabels' => [
],
'carrierRates' => [
[
'carrierName' => '',
'carrierService' => '',
'flatAdjustment' => [
],
'name' => '',
'originPostalCode' => '',
'percentageAdjustment' => ''
]
],
'mainTable' => [
'columnHeaders' => [
'locations' => [
[
'locationIds' => [
]
]
],
'numberOfItems' => [
],
'postalCodeGroupNames' => [
],
'prices' => [
[
]
],
'weights' => [
[
'unit' => '',
'value' => ''
]
]
],
'name' => '',
'rowHeaders' => [
],
'rows' => [
[
'cells' => [
[
'carrierRateName' => '',
'flatRate' => [
],
'noShipping' => null,
'pricePercentage' => '',
'subtableName' => ''
]
]
]
]
],
'name' => '',
'singleValue' => [
],
'subtables' => [
[
]
]
]
],
'shipmentType' => ''
]
],
'warehouses' => [
[
'businessDayConfig' => [
],
'cutoffTime' => [
'hour' => 0,
'minute' => 0
],
'handlingDays' => '',
'name' => '',
'shippingAddress' => [
'administrativeArea' => '',
'city' => '',
'country' => '',
'postalCode' => '',
'streetAddress' => ''
]
]
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'entries' => [
[
'accountId' => '',
'batchId' => 0,
'merchantId' => '',
'method' => '',
'shippingSettings' => [
'accountId' => '',
'postalCodeGroups' => [
[
'country' => '',
'name' => '',
'postalCodeRanges' => [
[
'postalCodeRangeBegin' => '',
'postalCodeRangeEnd' => ''
]
]
]
],
'services' => [
[
'active' => null,
'currency' => '',
'deliveryCountry' => '',
'deliveryTime' => [
'cutoffTime' => [
'hour' => 0,
'minute' => 0,
'timezone' => ''
],
'handlingBusinessDayConfig' => [
'businessDays' => [
]
],
'holidayCutoffs' => [
[
'deadlineDate' => '',
'deadlineHour' => 0,
'deadlineTimezone' => '',
'holidayId' => '',
'visibleFromDate' => ''
]
],
'maxHandlingTimeInDays' => 0,
'maxTransitTimeInDays' => 0,
'minHandlingTimeInDays' => 0,
'minTransitTimeInDays' => 0,
'transitBusinessDayConfig' => [
],
'transitTimeTable' => [
'postalCodeGroupNames' => [
],
'rows' => [
[
'values' => [
[
'maxTransitTimeInDays' => 0,
'minTransitTimeInDays' => 0
]
]
]
],
'transitTimeLabels' => [
]
],
'warehouseBasedDeliveryTimes' => [
[
'carrier' => '',
'carrierService' => '',
'originAdministrativeArea' => '',
'originCity' => '',
'originCountry' => '',
'originPostalCode' => '',
'originStreetAddress' => '',
'warehouseName' => ''
]
]
],
'eligibility' => '',
'minimumOrderValue' => [
'currency' => '',
'value' => ''
],
'minimumOrderValueTable' => [
'storeCodeSetWithMovs' => [
[
'storeCodes' => [
],
'value' => [
]
]
]
],
'name' => '',
'pickupService' => [
'carrierName' => '',
'serviceName' => ''
],
'rateGroups' => [
[
'applicableShippingLabels' => [
],
'carrierRates' => [
[
'carrierName' => '',
'carrierService' => '',
'flatAdjustment' => [
],
'name' => '',
'originPostalCode' => '',
'percentageAdjustment' => ''
]
],
'mainTable' => [
'columnHeaders' => [
'locations' => [
[
'locationIds' => [
]
]
],
'numberOfItems' => [
],
'postalCodeGroupNames' => [
],
'prices' => [
[
]
],
'weights' => [
[
'unit' => '',
'value' => ''
]
]
],
'name' => '',
'rowHeaders' => [
],
'rows' => [
[
'cells' => [
[
'carrierRateName' => '',
'flatRate' => [
],
'noShipping' => null,
'pricePercentage' => '',
'subtableName' => ''
]
]
]
]
],
'name' => '',
'singleValue' => [
],
'subtables' => [
[
]
]
]
],
'shipmentType' => ''
]
],
'warehouses' => [
[
'businessDayConfig' => [
],
'cutoffTime' => [
'hour' => 0,
'minute' => 0
],
'handlingDays' => '',
'name' => '',
'shippingAddress' => [
'administrativeArea' => '',
'city' => '',
'country' => '',
'postalCode' => '',
'streetAddress' => ''
]
]
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/shippingsettings/batch');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/shippingsettings/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/shippingsettings/batch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"entries": [
{
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/shippingsettings/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/shippingsettings/batch"
payload = { "entries": [
{
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": False,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": { "businessDays": [] },
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [{ "values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
] }],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": { "storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
] },
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [{ "locationIds": [] }],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [{}],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [{ "cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": False,
"pricePercentage": "",
"subtableName": ""
}
] }]
},
"name": "",
"singleValue": {},
"subtables": [{}]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/shippingsettings/batch"
payload <- "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/shippingsettings/batch")
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 \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\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.post('/baseUrl/shippingsettings/batch') do |req|
req.body = "{\n \"entries\": [\n {\n \"accountId\": \"\",\n \"batchId\": 0,\n \"merchantId\": \"\",\n \"method\": \"\",\n \"shippingSettings\": {\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n }\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/shippingsettings/batch";
let payload = json!({"entries": (
json!({
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": json!({
"accountId": "",
"postalCodeGroups": (
json!({
"country": "",
"name": "",
"postalCodeRanges": (
json!({
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
})
)
})
),
"services": (
json!({
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": json!({
"cutoffTime": json!({
"hour": 0,
"minute": 0,
"timezone": ""
}),
"handlingBusinessDayConfig": json!({"businessDays": ()}),
"holidayCutoffs": (
json!({
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
})
),
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": json!({}),
"transitTimeTable": json!({
"postalCodeGroupNames": (),
"rows": (json!({"values": (
json!({
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
})
)})),
"transitTimeLabels": ()
}),
"warehouseBasedDeliveryTimes": (
json!({
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
})
)
}),
"eligibility": "",
"minimumOrderValue": json!({
"currency": "",
"value": ""
}),
"minimumOrderValueTable": json!({"storeCodeSetWithMovs": (
json!({
"storeCodes": (),
"value": json!({})
})
)}),
"name": "",
"pickupService": json!({
"carrierName": "",
"serviceName": ""
}),
"rateGroups": (
json!({
"applicableShippingLabels": (),
"carrierRates": (
json!({
"carrierName": "",
"carrierService": "",
"flatAdjustment": json!({}),
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
})
),
"mainTable": json!({
"columnHeaders": json!({
"locations": (json!({"locationIds": ()})),
"numberOfItems": (),
"postalCodeGroupNames": (),
"prices": (json!({})),
"weights": (
json!({
"unit": "",
"value": ""
})
)
}),
"name": "",
"rowHeaders": json!({}),
"rows": (json!({"cells": (
json!({
"carrierRateName": "",
"flatRate": json!({}),
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
})
)}))
}),
"name": "",
"singleValue": json!({}),
"subtables": (json!({}))
})
),
"shipmentType": ""
})
),
"warehouses": (
json!({
"businessDayConfig": json!({}),
"cutoffTime": json!({
"hour": 0,
"minute": 0
}),
"handlingDays": "",
"name": "",
"shippingAddress": json!({
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
})
})
)
})
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/shippingsettings/batch \
--header 'content-type: application/json' \
--data '{
"entries": [
{
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
}
]
}'
echo '{
"entries": [
{
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
}
]
}' | \
http POST {{baseUrl}}/shippingsettings/batch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "entries": [\n {\n "accountId": "",\n "batchId": 0,\n "merchantId": "",\n "method": "",\n "shippingSettings": {\n "accountId": "",\n "postalCodeGroups": [\n {\n "country": "",\n "name": "",\n "postalCodeRanges": [\n {\n "postalCodeRangeBegin": "",\n "postalCodeRangeEnd": ""\n }\n ]\n }\n ],\n "services": [\n {\n "active": false,\n "currency": "",\n "deliveryCountry": "",\n "deliveryTime": {\n "cutoffTime": {\n "hour": 0,\n "minute": 0,\n "timezone": ""\n },\n "handlingBusinessDayConfig": {\n "businessDays": []\n },\n "holidayCutoffs": [\n {\n "deadlineDate": "",\n "deadlineHour": 0,\n "deadlineTimezone": "",\n "holidayId": "",\n "visibleFromDate": ""\n }\n ],\n "maxHandlingTimeInDays": 0,\n "maxTransitTimeInDays": 0,\n "minHandlingTimeInDays": 0,\n "minTransitTimeInDays": 0,\n "transitBusinessDayConfig": {},\n "transitTimeTable": {\n "postalCodeGroupNames": [],\n "rows": [\n {\n "values": [\n {\n "maxTransitTimeInDays": 0,\n "minTransitTimeInDays": 0\n }\n ]\n }\n ],\n "transitTimeLabels": []\n },\n "warehouseBasedDeliveryTimes": [\n {\n "carrier": "",\n "carrierService": "",\n "originAdministrativeArea": "",\n "originCity": "",\n "originCountry": "",\n "originPostalCode": "",\n "originStreetAddress": "",\n "warehouseName": ""\n }\n ]\n },\n "eligibility": "",\n "minimumOrderValue": {\n "currency": "",\n "value": ""\n },\n "minimumOrderValueTable": {\n "storeCodeSetWithMovs": [\n {\n "storeCodes": [],\n "value": {}\n }\n ]\n },\n "name": "",\n "pickupService": {\n "carrierName": "",\n "serviceName": ""\n },\n "rateGroups": [\n {\n "applicableShippingLabels": [],\n "carrierRates": [\n {\n "carrierName": "",\n "carrierService": "",\n "flatAdjustment": {},\n "name": "",\n "originPostalCode": "",\n "percentageAdjustment": ""\n }\n ],\n "mainTable": {\n "columnHeaders": {\n "locations": [\n {\n "locationIds": []\n }\n ],\n "numberOfItems": [],\n "postalCodeGroupNames": [],\n "prices": [\n {}\n ],\n "weights": [\n {\n "unit": "",\n "value": ""\n }\n ]\n },\n "name": "",\n "rowHeaders": {},\n "rows": [\n {\n "cells": [\n {\n "carrierRateName": "",\n "flatRate": {},\n "noShipping": false,\n "pricePercentage": "",\n "subtableName": ""\n }\n ]\n }\n ]\n },\n "name": "",\n "singleValue": {},\n "subtables": [\n {}\n ]\n }\n ],\n "shipmentType": ""\n }\n ],\n "warehouses": [\n {\n "businessDayConfig": {},\n "cutoffTime": {\n "hour": 0,\n "minute": 0\n },\n "handlingDays": "",\n "name": "",\n "shippingAddress": {\n "administrativeArea": "",\n "city": "",\n "country": "",\n "postalCode": "",\n "streetAddress": ""\n }\n }\n ]\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/shippingsettings/batch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["entries": [
[
"accountId": "",
"batchId": 0,
"merchantId": "",
"method": "",
"shippingSettings": [
"accountId": "",
"postalCodeGroups": [
[
"country": "",
"name": "",
"postalCodeRanges": [
[
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
]
]
]
],
"services": [
[
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": [
"cutoffTime": [
"hour": 0,
"minute": 0,
"timezone": ""
],
"handlingBusinessDayConfig": ["businessDays": []],
"holidayCutoffs": [
[
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
]
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": [],
"transitTimeTable": [
"postalCodeGroupNames": [],
"rows": [["values": [
[
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
]
]]],
"transitTimeLabels": []
],
"warehouseBasedDeliveryTimes": [
[
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
]
]
],
"eligibility": "",
"minimumOrderValue": [
"currency": "",
"value": ""
],
"minimumOrderValueTable": ["storeCodeSetWithMovs": [
[
"storeCodes": [],
"value": []
]
]],
"name": "",
"pickupService": [
"carrierName": "",
"serviceName": ""
],
"rateGroups": [
[
"applicableShippingLabels": [],
"carrierRates": [
[
"carrierName": "",
"carrierService": "",
"flatAdjustment": [],
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
]
],
"mainTable": [
"columnHeaders": [
"locations": [["locationIds": []]],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [[]],
"weights": [
[
"unit": "",
"value": ""
]
]
],
"name": "",
"rowHeaders": [],
"rows": [["cells": [
[
"carrierRateName": "",
"flatRate": [],
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
]
]]]
],
"name": "",
"singleValue": [],
"subtables": [[]]
]
],
"shipmentType": ""
]
],
"warehouses": [
[
"businessDayConfig": [],
"cutoffTime": [
"hour": 0,
"minute": 0
],
"handlingDays": "",
"name": "",
"shippingAddress": [
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
]
]
]
]
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/shippingsettings/batch")! 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()
GET
content.shippingsettings.get
{{baseUrl}}/:merchantId/shippingsettings/:accountId
QUERY PARAMS
merchantId
accountId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/shippingsettings/:accountId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/shippingsettings/:accountId")
require "http/client"
url = "{{baseUrl}}/:merchantId/shippingsettings/:accountId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/shippingsettings/:accountId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/shippingsettings/:accountId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/shippingsettings/:accountId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/shippingsettings/:accountId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/shippingsettings/:accountId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/shippingsettings/:accountId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/shippingsettings/:accountId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/shippingsettings/:accountId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/shippingsettings/:accountId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/shippingsettings/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/shippingsettings/:accountId';
const options = {method: 'GET'};
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}}/:merchantId/shippingsettings/:accountId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/shippingsettings/:accountId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/shippingsettings/:accountId',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/shippingsettings/:accountId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/shippingsettings/:accountId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/shippingsettings/:accountId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/shippingsettings/:accountId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/shippingsettings/:accountId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/shippingsettings/:accountId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/shippingsettings/:accountId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/shippingsettings/:accountId');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/shippingsettings/:accountId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/shippingsettings/:accountId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/shippingsettings/:accountId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/shippingsettings/:accountId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/shippingsettings/:accountId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/shippingsettings/:accountId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/shippingsettings/:accountId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/shippingsettings/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/shippingsettings/:accountId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/shippingsettings/:accountId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/shippingsettings/:accountId
http GET {{baseUrl}}/:merchantId/shippingsettings/:accountId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/shippingsettings/:accountId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/shippingsettings/:accountId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.shippingsettings.getsupportedcarriers
{{baseUrl}}/:merchantId/supportedCarriers
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/supportedCarriers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/supportedCarriers")
require "http/client"
url = "{{baseUrl}}/:merchantId/supportedCarriers"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/supportedCarriers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/supportedCarriers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/supportedCarriers"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/supportedCarriers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/supportedCarriers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/supportedCarriers"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/supportedCarriers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/supportedCarriers")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/supportedCarriers');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedCarriers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/supportedCarriers';
const options = {method: 'GET'};
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}}/:merchantId/supportedCarriers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/supportedCarriers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/supportedCarriers',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedCarriers'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/supportedCarriers');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedCarriers'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/supportedCarriers';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/supportedCarriers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/supportedCarriers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/supportedCarriers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/supportedCarriers');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/supportedCarriers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/supportedCarriers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/supportedCarriers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/supportedCarriers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/supportedCarriers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/supportedCarriers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/supportedCarriers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/supportedCarriers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/supportedCarriers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/supportedCarriers";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/supportedCarriers
http GET {{baseUrl}}/:merchantId/supportedCarriers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/supportedCarriers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/supportedCarriers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.shippingsettings.getsupportedholidays
{{baseUrl}}/:merchantId/supportedHolidays
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/supportedHolidays");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/supportedHolidays")
require "http/client"
url = "{{baseUrl}}/:merchantId/supportedHolidays"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/supportedHolidays"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/supportedHolidays");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/supportedHolidays"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/supportedHolidays HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/supportedHolidays")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/supportedHolidays"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/supportedHolidays")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/supportedHolidays")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/supportedHolidays');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedHolidays'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/supportedHolidays';
const options = {method: 'GET'};
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}}/:merchantId/supportedHolidays',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/supportedHolidays")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/supportedHolidays',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedHolidays'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/supportedHolidays');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedHolidays'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/supportedHolidays';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/supportedHolidays"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/supportedHolidays" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/supportedHolidays",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/supportedHolidays');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/supportedHolidays');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/supportedHolidays');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/supportedHolidays' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/supportedHolidays' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/supportedHolidays")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/supportedHolidays"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/supportedHolidays"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/supportedHolidays")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/supportedHolidays') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/supportedHolidays";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/supportedHolidays
http GET {{baseUrl}}/:merchantId/supportedHolidays
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/supportedHolidays
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/supportedHolidays")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.shippingsettings.getsupportedpickupservices
{{baseUrl}}/:merchantId/supportedPickupServices
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/supportedPickupServices");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/supportedPickupServices")
require "http/client"
url = "{{baseUrl}}/:merchantId/supportedPickupServices"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/supportedPickupServices"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/supportedPickupServices");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/supportedPickupServices"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/supportedPickupServices HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/supportedPickupServices")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/supportedPickupServices"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/supportedPickupServices")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/supportedPickupServices")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/supportedPickupServices');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedPickupServices'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/supportedPickupServices';
const options = {method: 'GET'};
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}}/:merchantId/supportedPickupServices',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/supportedPickupServices")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/supportedPickupServices',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedPickupServices'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/supportedPickupServices');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/supportedPickupServices'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/supportedPickupServices';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/supportedPickupServices"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/supportedPickupServices" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/supportedPickupServices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/supportedPickupServices');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/supportedPickupServices');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/supportedPickupServices');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/supportedPickupServices' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/supportedPickupServices' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/supportedPickupServices")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/supportedPickupServices"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/supportedPickupServices"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/supportedPickupServices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/supportedPickupServices') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/supportedPickupServices";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/supportedPickupServices
http GET {{baseUrl}}/:merchantId/supportedPickupServices
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/supportedPickupServices
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/supportedPickupServices")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
GET
content.shippingsettings.list
{{baseUrl}}/:merchantId/shippingsettings
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/shippingsettings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/shippingsettings")
require "http/client"
url = "{{baseUrl}}/:merchantId/shippingsettings"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/shippingsettings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/shippingsettings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/shippingsettings"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/shippingsettings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/shippingsettings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/shippingsettings"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/shippingsettings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/shippingsettings")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/shippingsettings');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/shippingsettings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/shippingsettings';
const options = {method: 'GET'};
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}}/:merchantId/shippingsettings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/shippingsettings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/shippingsettings',
headers: {}
};
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.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/shippingsettings'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/shippingsettings');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/:merchantId/shippingsettings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/shippingsettings';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/shippingsettings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/shippingsettings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/shippingsettings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/shippingsettings');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/shippingsettings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/shippingsettings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/shippingsettings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/shippingsettings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/shippingsettings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/shippingsettings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/shippingsettings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/shippingsettings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/shippingsettings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/shippingsettings";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/shippingsettings
http GET {{baseUrl}}/:merchantId/shippingsettings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/shippingsettings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/shippingsettings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
PUT
content.shippingsettings.update
{{baseUrl}}/:merchantId/shippingsettings/:accountId
QUERY PARAMS
merchantId
accountId
BODY json
{
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/shippingsettings/:accountId");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/:merchantId/shippingsettings/:accountId" {:content-type :json
:form-params {:accountId ""
:postalCodeGroups [{:country ""
:name ""
:postalCodeRanges [{:postalCodeRangeBegin ""
:postalCodeRangeEnd ""}]}]
:services [{:active false
:currency ""
:deliveryCountry ""
:deliveryTime {:cutoffTime {:hour 0
:minute 0
:timezone ""}
:handlingBusinessDayConfig {:businessDays []}
:holidayCutoffs [{:deadlineDate ""
:deadlineHour 0
:deadlineTimezone ""
:holidayId ""
:visibleFromDate ""}]
:maxHandlingTimeInDays 0
:maxTransitTimeInDays 0
:minHandlingTimeInDays 0
:minTransitTimeInDays 0
:transitBusinessDayConfig {}
:transitTimeTable {:postalCodeGroupNames []
:rows [{:values [{:maxTransitTimeInDays 0
:minTransitTimeInDays 0}]}]
:transitTimeLabels []}
:warehouseBasedDeliveryTimes [{:carrier ""
:carrierService ""
:originAdministrativeArea ""
:originCity ""
:originCountry ""
:originPostalCode ""
:originStreetAddress ""
:warehouseName ""}]}
:eligibility ""
:minimumOrderValue {:currency ""
:value ""}
:minimumOrderValueTable {:storeCodeSetWithMovs [{:storeCodes []
:value {}}]}
:name ""
:pickupService {:carrierName ""
:serviceName ""}
:rateGroups [{:applicableShippingLabels []
:carrierRates [{:carrierName ""
:carrierService ""
:flatAdjustment {}
:name ""
:originPostalCode ""
:percentageAdjustment ""}]
:mainTable {:columnHeaders {:locations [{:locationIds []}]
:numberOfItems []
:postalCodeGroupNames []
:prices [{}]
:weights [{:unit ""
:value ""}]}
:name ""
:rowHeaders {}
:rows [{:cells [{:carrierRateName ""
:flatRate {}
:noShipping false
:pricePercentage ""
:subtableName ""}]}]}
:name ""
:singleValue {}
:subtables [{}]}]
:shipmentType ""}]
:warehouses [{:businessDayConfig {}
:cutoffTime {:hour 0
:minute 0}
:handlingDays ""
:name ""
:shippingAddress {:administrativeArea ""
:city ""
:country ""
:postalCode ""
:streetAddress ""}}]}})
require "http/client"
url = "{{baseUrl}}/:merchantId/shippingsettings/:accountId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\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}}/:merchantId/shippingsettings/:accountId"),
Content = new StringContent("{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\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}}/:merchantId/shippingsettings/:accountId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/shippingsettings/:accountId"
payload := strings.NewReader("{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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(res)
fmt.Println(string(body))
}
PUT /baseUrl/:merchantId/shippingsettings/:accountId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 3763
{
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/:merchantId/shippingsettings/:accountId")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/shippingsettings/:accountId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\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 \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/shippingsettings/:accountId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/:merchantId/shippingsettings/:accountId")
.header("content-type", "application/json")
.body("{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [
{
postalCodeRangeBegin: '',
postalCodeRangeEnd: ''
}
]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {
hour: 0,
minute: 0,
timezone: ''
},
handlingBusinessDayConfig: {
businessDays: []
},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [
{
values: [
{
maxTransitTimeInDays: 0,
minTransitTimeInDays: 0
}
]
}
],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {
currency: '',
value: ''
},
minimumOrderValueTable: {
storeCodeSetWithMovs: [
{
storeCodes: [],
value: {}
}
]
},
name: '',
pickupService: {
carrierName: '',
serviceName: ''
},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [
{
locationIds: []
}
],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [
{}
],
weights: [
{
unit: '',
value: ''
}
]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [
{}
]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {
hour: 0,
minute: 0
},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/:merchantId/shippingsettings/:accountId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/shippingsettings/:accountId',
headers: {'content-type': 'application/json'},
data: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [{postalCodeRangeBegin: '', postalCodeRangeEnd: ''}]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {hour: 0, minute: 0, timezone: ''},
handlingBusinessDayConfig: {businessDays: []},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [{values: [{maxTransitTimeInDays: 0, minTransitTimeInDays: 0}]}],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {currency: '', value: ''},
minimumOrderValueTable: {storeCodeSetWithMovs: [{storeCodes: [], value: {}}]},
name: '',
pickupService: {carrierName: '', serviceName: ''},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [{locationIds: []}],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [{}],
weights: [{unit: '', value: ''}]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [{}]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {hour: 0, minute: 0},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/shippingsettings/:accountId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","postalCodeGroups":[{"country":"","name":"","postalCodeRanges":[{"postalCodeRangeBegin":"","postalCodeRangeEnd":""}]}],"services":[{"active":false,"currency":"","deliveryCountry":"","deliveryTime":{"cutoffTime":{"hour":0,"minute":0,"timezone":""},"handlingBusinessDayConfig":{"businessDays":[]},"holidayCutoffs":[{"deadlineDate":"","deadlineHour":0,"deadlineTimezone":"","holidayId":"","visibleFromDate":""}],"maxHandlingTimeInDays":0,"maxTransitTimeInDays":0,"minHandlingTimeInDays":0,"minTransitTimeInDays":0,"transitBusinessDayConfig":{},"transitTimeTable":{"postalCodeGroupNames":[],"rows":[{"values":[{"maxTransitTimeInDays":0,"minTransitTimeInDays":0}]}],"transitTimeLabels":[]},"warehouseBasedDeliveryTimes":[{"carrier":"","carrierService":"","originAdministrativeArea":"","originCity":"","originCountry":"","originPostalCode":"","originStreetAddress":"","warehouseName":""}]},"eligibility":"","minimumOrderValue":{"currency":"","value":""},"minimumOrderValueTable":{"storeCodeSetWithMovs":[{"storeCodes":[],"value":{}}]},"name":"","pickupService":{"carrierName":"","serviceName":""},"rateGroups":[{"applicableShippingLabels":[],"carrierRates":[{"carrierName":"","carrierService":"","flatAdjustment":{},"name":"","originPostalCode":"","percentageAdjustment":""}],"mainTable":{"columnHeaders":{"locations":[{"locationIds":[]}],"numberOfItems":[],"postalCodeGroupNames":[],"prices":[{}],"weights":[{"unit":"","value":""}]},"name":"","rowHeaders":{},"rows":[{"cells":[{"carrierRateName":"","flatRate":{},"noShipping":false,"pricePercentage":"","subtableName":""}]}]},"name":"","singleValue":{},"subtables":[{}]}],"shipmentType":""}],"warehouses":[{"businessDayConfig":{},"cutoffTime":{"hour":0,"minute":0},"handlingDays":"","name":"","shippingAddress":{"administrativeArea":"","city":"","country":"","postalCode":"","streetAddress":""}}]}'
};
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}}/:merchantId/shippingsettings/:accountId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountId": "",\n "postalCodeGroups": [\n {\n "country": "",\n "name": "",\n "postalCodeRanges": [\n {\n "postalCodeRangeBegin": "",\n "postalCodeRangeEnd": ""\n }\n ]\n }\n ],\n "services": [\n {\n "active": false,\n "currency": "",\n "deliveryCountry": "",\n "deliveryTime": {\n "cutoffTime": {\n "hour": 0,\n "minute": 0,\n "timezone": ""\n },\n "handlingBusinessDayConfig": {\n "businessDays": []\n },\n "holidayCutoffs": [\n {\n "deadlineDate": "",\n "deadlineHour": 0,\n "deadlineTimezone": "",\n "holidayId": "",\n "visibleFromDate": ""\n }\n ],\n "maxHandlingTimeInDays": 0,\n "maxTransitTimeInDays": 0,\n "minHandlingTimeInDays": 0,\n "minTransitTimeInDays": 0,\n "transitBusinessDayConfig": {},\n "transitTimeTable": {\n "postalCodeGroupNames": [],\n "rows": [\n {\n "values": [\n {\n "maxTransitTimeInDays": 0,\n "minTransitTimeInDays": 0\n }\n ]\n }\n ],\n "transitTimeLabels": []\n },\n "warehouseBasedDeliveryTimes": [\n {\n "carrier": "",\n "carrierService": "",\n "originAdministrativeArea": "",\n "originCity": "",\n "originCountry": "",\n "originPostalCode": "",\n "originStreetAddress": "",\n "warehouseName": ""\n }\n ]\n },\n "eligibility": "",\n "minimumOrderValue": {\n "currency": "",\n "value": ""\n },\n "minimumOrderValueTable": {\n "storeCodeSetWithMovs": [\n {\n "storeCodes": [],\n "value": {}\n }\n ]\n },\n "name": "",\n "pickupService": {\n "carrierName": "",\n "serviceName": ""\n },\n "rateGroups": [\n {\n "applicableShippingLabels": [],\n "carrierRates": [\n {\n "carrierName": "",\n "carrierService": "",\n "flatAdjustment": {},\n "name": "",\n "originPostalCode": "",\n "percentageAdjustment": ""\n }\n ],\n "mainTable": {\n "columnHeaders": {\n "locations": [\n {\n "locationIds": []\n }\n ],\n "numberOfItems": [],\n "postalCodeGroupNames": [],\n "prices": [\n {}\n ],\n "weights": [\n {\n "unit": "",\n "value": ""\n }\n ]\n },\n "name": "",\n "rowHeaders": {},\n "rows": [\n {\n "cells": [\n {\n "carrierRateName": "",\n "flatRate": {},\n "noShipping": false,\n "pricePercentage": "",\n "subtableName": ""\n }\n ]\n }\n ]\n },\n "name": "",\n "singleValue": {},\n "subtables": [\n {}\n ]\n }\n ],\n "shipmentType": ""\n }\n ],\n "warehouses": [\n {\n "businessDayConfig": {},\n "cutoffTime": {\n "hour": 0,\n "minute": 0\n },\n "handlingDays": "",\n "name": "",\n "shippingAddress": {\n "administrativeArea": "",\n "city": "",\n "country": "",\n "postalCode": "",\n "streetAddress": ""\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/shippingsettings/:accountId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/shippingsettings/:accountId',
headers: {
'content-type': 'application/json'
}
};
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({
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [{postalCodeRangeBegin: '', postalCodeRangeEnd: ''}]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {hour: 0, minute: 0, timezone: ''},
handlingBusinessDayConfig: {businessDays: []},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [{values: [{maxTransitTimeInDays: 0, minTransitTimeInDays: 0}]}],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {currency: '', value: ''},
minimumOrderValueTable: {storeCodeSetWithMovs: [{storeCodes: [], value: {}}]},
name: '',
pickupService: {carrierName: '', serviceName: ''},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [{locationIds: []}],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [{}],
weights: [{unit: '', value: ''}]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [{}]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {hour: 0, minute: 0},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/:merchantId/shippingsettings/:accountId',
headers: {'content-type': 'application/json'},
body: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [{postalCodeRangeBegin: '', postalCodeRangeEnd: ''}]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {hour: 0, minute: 0, timezone: ''},
handlingBusinessDayConfig: {businessDays: []},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [{values: [{maxTransitTimeInDays: 0, minTransitTimeInDays: 0}]}],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {currency: '', value: ''},
minimumOrderValueTable: {storeCodeSetWithMovs: [{storeCodes: [], value: {}}]},
name: '',
pickupService: {carrierName: '', serviceName: ''},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [{locationIds: []}],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [{}],
weights: [{unit: '', value: ''}]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [{}]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {hour: 0, minute: 0},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
},
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}}/:merchantId/shippingsettings/:accountId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [
{
postalCodeRangeBegin: '',
postalCodeRangeEnd: ''
}
]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {
hour: 0,
minute: 0,
timezone: ''
},
handlingBusinessDayConfig: {
businessDays: []
},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [
{
values: [
{
maxTransitTimeInDays: 0,
minTransitTimeInDays: 0
}
]
}
],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {
currency: '',
value: ''
},
minimumOrderValueTable: {
storeCodeSetWithMovs: [
{
storeCodes: [],
value: {}
}
]
},
name: '',
pickupService: {
carrierName: '',
serviceName: ''
},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [
{
locationIds: []
}
],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [
{}
],
weights: [
{
unit: '',
value: ''
}
]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [
{}
]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {
hour: 0,
minute: 0
},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
});
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}}/:merchantId/shippingsettings/:accountId',
headers: {'content-type': 'application/json'},
data: {
accountId: '',
postalCodeGroups: [
{
country: '',
name: '',
postalCodeRanges: [{postalCodeRangeBegin: '', postalCodeRangeEnd: ''}]
}
],
services: [
{
active: false,
currency: '',
deliveryCountry: '',
deliveryTime: {
cutoffTime: {hour: 0, minute: 0, timezone: ''},
handlingBusinessDayConfig: {businessDays: []},
holidayCutoffs: [
{
deadlineDate: '',
deadlineHour: 0,
deadlineTimezone: '',
holidayId: '',
visibleFromDate: ''
}
],
maxHandlingTimeInDays: 0,
maxTransitTimeInDays: 0,
minHandlingTimeInDays: 0,
minTransitTimeInDays: 0,
transitBusinessDayConfig: {},
transitTimeTable: {
postalCodeGroupNames: [],
rows: [{values: [{maxTransitTimeInDays: 0, minTransitTimeInDays: 0}]}],
transitTimeLabels: []
},
warehouseBasedDeliveryTimes: [
{
carrier: '',
carrierService: '',
originAdministrativeArea: '',
originCity: '',
originCountry: '',
originPostalCode: '',
originStreetAddress: '',
warehouseName: ''
}
]
},
eligibility: '',
minimumOrderValue: {currency: '', value: ''},
minimumOrderValueTable: {storeCodeSetWithMovs: [{storeCodes: [], value: {}}]},
name: '',
pickupService: {carrierName: '', serviceName: ''},
rateGroups: [
{
applicableShippingLabels: [],
carrierRates: [
{
carrierName: '',
carrierService: '',
flatAdjustment: {},
name: '',
originPostalCode: '',
percentageAdjustment: ''
}
],
mainTable: {
columnHeaders: {
locations: [{locationIds: []}],
numberOfItems: [],
postalCodeGroupNames: [],
prices: [{}],
weights: [{unit: '', value: ''}]
},
name: '',
rowHeaders: {},
rows: [
{
cells: [
{
carrierRateName: '',
flatRate: {},
noShipping: false,
pricePercentage: '',
subtableName: ''
}
]
}
]
},
name: '',
singleValue: {},
subtables: [{}]
}
],
shipmentType: ''
}
],
warehouses: [
{
businessDayConfig: {},
cutoffTime: {hour: 0, minute: 0},
handlingDays: '',
name: '',
shippingAddress: {
administrativeArea: '',
city: '',
country: '',
postalCode: '',
streetAddress: ''
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/shippingsettings/:accountId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"accountId":"","postalCodeGroups":[{"country":"","name":"","postalCodeRanges":[{"postalCodeRangeBegin":"","postalCodeRangeEnd":""}]}],"services":[{"active":false,"currency":"","deliveryCountry":"","deliveryTime":{"cutoffTime":{"hour":0,"minute":0,"timezone":""},"handlingBusinessDayConfig":{"businessDays":[]},"holidayCutoffs":[{"deadlineDate":"","deadlineHour":0,"deadlineTimezone":"","holidayId":"","visibleFromDate":""}],"maxHandlingTimeInDays":0,"maxTransitTimeInDays":0,"minHandlingTimeInDays":0,"minTransitTimeInDays":0,"transitBusinessDayConfig":{},"transitTimeTable":{"postalCodeGroupNames":[],"rows":[{"values":[{"maxTransitTimeInDays":0,"minTransitTimeInDays":0}]}],"transitTimeLabels":[]},"warehouseBasedDeliveryTimes":[{"carrier":"","carrierService":"","originAdministrativeArea":"","originCity":"","originCountry":"","originPostalCode":"","originStreetAddress":"","warehouseName":""}]},"eligibility":"","minimumOrderValue":{"currency":"","value":""},"minimumOrderValueTable":{"storeCodeSetWithMovs":[{"storeCodes":[],"value":{}}]},"name":"","pickupService":{"carrierName":"","serviceName":""},"rateGroups":[{"applicableShippingLabels":[],"carrierRates":[{"carrierName":"","carrierService":"","flatAdjustment":{},"name":"","originPostalCode":"","percentageAdjustment":""}],"mainTable":{"columnHeaders":{"locations":[{"locationIds":[]}],"numberOfItems":[],"postalCodeGroupNames":[],"prices":[{}],"weights":[{"unit":"","value":""}]},"name":"","rowHeaders":{},"rows":[{"cells":[{"carrierRateName":"","flatRate":{},"noShipping":false,"pricePercentage":"","subtableName":""}]}]},"name":"","singleValue":{},"subtables":[{}]}],"shipmentType":""}],"warehouses":[{"businessDayConfig":{},"cutoffTime":{"hour":0,"minute":0},"handlingDays":"","name":"","shippingAddress":{"administrativeArea":"","city":"","country":"","postalCode":"","streetAddress":""}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accountId": @"",
@"postalCodeGroups": @[ @{ @"country": @"", @"name": @"", @"postalCodeRanges": @[ @{ @"postalCodeRangeBegin": @"", @"postalCodeRangeEnd": @"" } ] } ],
@"services": @[ @{ @"active": @NO, @"currency": @"", @"deliveryCountry": @"", @"deliveryTime": @{ @"cutoffTime": @{ @"hour": @0, @"minute": @0, @"timezone": @"" }, @"handlingBusinessDayConfig": @{ @"businessDays": @[ ] }, @"holidayCutoffs": @[ @{ @"deadlineDate": @"", @"deadlineHour": @0, @"deadlineTimezone": @"", @"holidayId": @"", @"visibleFromDate": @"" } ], @"maxHandlingTimeInDays": @0, @"maxTransitTimeInDays": @0, @"minHandlingTimeInDays": @0, @"minTransitTimeInDays": @0, @"transitBusinessDayConfig": @{ }, @"transitTimeTable": @{ @"postalCodeGroupNames": @[ ], @"rows": @[ @{ @"values": @[ @{ @"maxTransitTimeInDays": @0, @"minTransitTimeInDays": @0 } ] } ], @"transitTimeLabels": @[ ] }, @"warehouseBasedDeliveryTimes": @[ @{ @"carrier": @"", @"carrierService": @"", @"originAdministrativeArea": @"", @"originCity": @"", @"originCountry": @"", @"originPostalCode": @"", @"originStreetAddress": @"", @"warehouseName": @"" } ] }, @"eligibility": @"", @"minimumOrderValue": @{ @"currency": @"", @"value": @"" }, @"minimumOrderValueTable": @{ @"storeCodeSetWithMovs": @[ @{ @"storeCodes": @[ ], @"value": @{ } } ] }, @"name": @"", @"pickupService": @{ @"carrierName": @"", @"serviceName": @"" }, @"rateGroups": @[ @{ @"applicableShippingLabels": @[ ], @"carrierRates": @[ @{ @"carrierName": @"", @"carrierService": @"", @"flatAdjustment": @{ }, @"name": @"", @"originPostalCode": @"", @"percentageAdjustment": @"" } ], @"mainTable": @{ @"columnHeaders": @{ @"locations": @[ @{ @"locationIds": @[ ] } ], @"numberOfItems": @[ ], @"postalCodeGroupNames": @[ ], @"prices": @[ @{ } ], @"weights": @[ @{ @"unit": @"", @"value": @"" } ] }, @"name": @"", @"rowHeaders": @{ }, @"rows": @[ @{ @"cells": @[ @{ @"carrierRateName": @"", @"flatRate": @{ }, @"noShipping": @NO, @"pricePercentage": @"", @"subtableName": @"" } ] } ] }, @"name": @"", @"singleValue": @{ }, @"subtables": @[ @{ } ] } ], @"shipmentType": @"" } ],
@"warehouses": @[ @{ @"businessDayConfig": @{ }, @"cutoffTime": @{ @"hour": @0, @"minute": @0 }, @"handlingDays": @"", @"name": @"", @"shippingAddress": @{ @"administrativeArea": @"", @"city": @"", @"country": @"", @"postalCode": @"", @"streetAddress": @"" } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/shippingsettings/:accountId"]
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}}/:merchantId/shippingsettings/:accountId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/shippingsettings/:accountId",
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([
'accountId' => '',
'postalCodeGroups' => [
[
'country' => '',
'name' => '',
'postalCodeRanges' => [
[
'postalCodeRangeBegin' => '',
'postalCodeRangeEnd' => ''
]
]
]
],
'services' => [
[
'active' => null,
'currency' => '',
'deliveryCountry' => '',
'deliveryTime' => [
'cutoffTime' => [
'hour' => 0,
'minute' => 0,
'timezone' => ''
],
'handlingBusinessDayConfig' => [
'businessDays' => [
]
],
'holidayCutoffs' => [
[
'deadlineDate' => '',
'deadlineHour' => 0,
'deadlineTimezone' => '',
'holidayId' => '',
'visibleFromDate' => ''
]
],
'maxHandlingTimeInDays' => 0,
'maxTransitTimeInDays' => 0,
'minHandlingTimeInDays' => 0,
'minTransitTimeInDays' => 0,
'transitBusinessDayConfig' => [
],
'transitTimeTable' => [
'postalCodeGroupNames' => [
],
'rows' => [
[
'values' => [
[
'maxTransitTimeInDays' => 0,
'minTransitTimeInDays' => 0
]
]
]
],
'transitTimeLabels' => [
]
],
'warehouseBasedDeliveryTimes' => [
[
'carrier' => '',
'carrierService' => '',
'originAdministrativeArea' => '',
'originCity' => '',
'originCountry' => '',
'originPostalCode' => '',
'originStreetAddress' => '',
'warehouseName' => ''
]
]
],
'eligibility' => '',
'minimumOrderValue' => [
'currency' => '',
'value' => ''
],
'minimumOrderValueTable' => [
'storeCodeSetWithMovs' => [
[
'storeCodes' => [
],
'value' => [
]
]
]
],
'name' => '',
'pickupService' => [
'carrierName' => '',
'serviceName' => ''
],
'rateGroups' => [
[
'applicableShippingLabels' => [
],
'carrierRates' => [
[
'carrierName' => '',
'carrierService' => '',
'flatAdjustment' => [
],
'name' => '',
'originPostalCode' => '',
'percentageAdjustment' => ''
]
],
'mainTable' => [
'columnHeaders' => [
'locations' => [
[
'locationIds' => [
]
]
],
'numberOfItems' => [
],
'postalCodeGroupNames' => [
],
'prices' => [
[
]
],
'weights' => [
[
'unit' => '',
'value' => ''
]
]
],
'name' => '',
'rowHeaders' => [
],
'rows' => [
[
'cells' => [
[
'carrierRateName' => '',
'flatRate' => [
],
'noShipping' => null,
'pricePercentage' => '',
'subtableName' => ''
]
]
]
]
],
'name' => '',
'singleValue' => [
],
'subtables' => [
[
]
]
]
],
'shipmentType' => ''
]
],
'warehouses' => [
[
'businessDayConfig' => [
],
'cutoffTime' => [
'hour' => 0,
'minute' => 0
],
'handlingDays' => '',
'name' => '',
'shippingAddress' => [
'administrativeArea' => '',
'city' => '',
'country' => '',
'postalCode' => '',
'streetAddress' => ''
]
]
]
]),
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;
}
request('PUT', '{{baseUrl}}/:merchantId/shippingsettings/:accountId', [
'body' => '{
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/shippingsettings/:accountId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountId' => '',
'postalCodeGroups' => [
[
'country' => '',
'name' => '',
'postalCodeRanges' => [
[
'postalCodeRangeBegin' => '',
'postalCodeRangeEnd' => ''
]
]
]
],
'services' => [
[
'active' => null,
'currency' => '',
'deliveryCountry' => '',
'deliveryTime' => [
'cutoffTime' => [
'hour' => 0,
'minute' => 0,
'timezone' => ''
],
'handlingBusinessDayConfig' => [
'businessDays' => [
]
],
'holidayCutoffs' => [
[
'deadlineDate' => '',
'deadlineHour' => 0,
'deadlineTimezone' => '',
'holidayId' => '',
'visibleFromDate' => ''
]
],
'maxHandlingTimeInDays' => 0,
'maxTransitTimeInDays' => 0,
'minHandlingTimeInDays' => 0,
'minTransitTimeInDays' => 0,
'transitBusinessDayConfig' => [
],
'transitTimeTable' => [
'postalCodeGroupNames' => [
],
'rows' => [
[
'values' => [
[
'maxTransitTimeInDays' => 0,
'minTransitTimeInDays' => 0
]
]
]
],
'transitTimeLabels' => [
]
],
'warehouseBasedDeliveryTimes' => [
[
'carrier' => '',
'carrierService' => '',
'originAdministrativeArea' => '',
'originCity' => '',
'originCountry' => '',
'originPostalCode' => '',
'originStreetAddress' => '',
'warehouseName' => ''
]
]
],
'eligibility' => '',
'minimumOrderValue' => [
'currency' => '',
'value' => ''
],
'minimumOrderValueTable' => [
'storeCodeSetWithMovs' => [
[
'storeCodes' => [
],
'value' => [
]
]
]
],
'name' => '',
'pickupService' => [
'carrierName' => '',
'serviceName' => ''
],
'rateGroups' => [
[
'applicableShippingLabels' => [
],
'carrierRates' => [
[
'carrierName' => '',
'carrierService' => '',
'flatAdjustment' => [
],
'name' => '',
'originPostalCode' => '',
'percentageAdjustment' => ''
]
],
'mainTable' => [
'columnHeaders' => [
'locations' => [
[
'locationIds' => [
]
]
],
'numberOfItems' => [
],
'postalCodeGroupNames' => [
],
'prices' => [
[
]
],
'weights' => [
[
'unit' => '',
'value' => ''
]
]
],
'name' => '',
'rowHeaders' => [
],
'rows' => [
[
'cells' => [
[
'carrierRateName' => '',
'flatRate' => [
],
'noShipping' => null,
'pricePercentage' => '',
'subtableName' => ''
]
]
]
]
],
'name' => '',
'singleValue' => [
],
'subtables' => [
[
]
]
]
],
'shipmentType' => ''
]
],
'warehouses' => [
[
'businessDayConfig' => [
],
'cutoffTime' => [
'hour' => 0,
'minute' => 0
],
'handlingDays' => '',
'name' => '',
'shippingAddress' => [
'administrativeArea' => '',
'city' => '',
'country' => '',
'postalCode' => '',
'streetAddress' => ''
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountId' => '',
'postalCodeGroups' => [
[
'country' => '',
'name' => '',
'postalCodeRanges' => [
[
'postalCodeRangeBegin' => '',
'postalCodeRangeEnd' => ''
]
]
]
],
'services' => [
[
'active' => null,
'currency' => '',
'deliveryCountry' => '',
'deliveryTime' => [
'cutoffTime' => [
'hour' => 0,
'minute' => 0,
'timezone' => ''
],
'handlingBusinessDayConfig' => [
'businessDays' => [
]
],
'holidayCutoffs' => [
[
'deadlineDate' => '',
'deadlineHour' => 0,
'deadlineTimezone' => '',
'holidayId' => '',
'visibleFromDate' => ''
]
],
'maxHandlingTimeInDays' => 0,
'maxTransitTimeInDays' => 0,
'minHandlingTimeInDays' => 0,
'minTransitTimeInDays' => 0,
'transitBusinessDayConfig' => [
],
'transitTimeTable' => [
'postalCodeGroupNames' => [
],
'rows' => [
[
'values' => [
[
'maxTransitTimeInDays' => 0,
'minTransitTimeInDays' => 0
]
]
]
],
'transitTimeLabels' => [
]
],
'warehouseBasedDeliveryTimes' => [
[
'carrier' => '',
'carrierService' => '',
'originAdministrativeArea' => '',
'originCity' => '',
'originCountry' => '',
'originPostalCode' => '',
'originStreetAddress' => '',
'warehouseName' => ''
]
]
],
'eligibility' => '',
'minimumOrderValue' => [
'currency' => '',
'value' => ''
],
'minimumOrderValueTable' => [
'storeCodeSetWithMovs' => [
[
'storeCodes' => [
],
'value' => [
]
]
]
],
'name' => '',
'pickupService' => [
'carrierName' => '',
'serviceName' => ''
],
'rateGroups' => [
[
'applicableShippingLabels' => [
],
'carrierRates' => [
[
'carrierName' => '',
'carrierService' => '',
'flatAdjustment' => [
],
'name' => '',
'originPostalCode' => '',
'percentageAdjustment' => ''
]
],
'mainTable' => [
'columnHeaders' => [
'locations' => [
[
'locationIds' => [
]
]
],
'numberOfItems' => [
],
'postalCodeGroupNames' => [
],
'prices' => [
[
]
],
'weights' => [
[
'unit' => '',
'value' => ''
]
]
],
'name' => '',
'rowHeaders' => [
],
'rows' => [
[
'cells' => [
[
'carrierRateName' => '',
'flatRate' => [
],
'noShipping' => null,
'pricePercentage' => '',
'subtableName' => ''
]
]
]
]
],
'name' => '',
'singleValue' => [
],
'subtables' => [
[
]
]
]
],
'shipmentType' => ''
]
],
'warehouses' => [
[
'businessDayConfig' => [
],
'cutoffTime' => [
'hour' => 0,
'minute' => 0
],
'handlingDays' => '',
'name' => '',
'shippingAddress' => [
'administrativeArea' => '',
'city' => '',
'country' => '',
'postalCode' => '',
'streetAddress' => ''
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/shippingsettings/:accountId');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/shippingsettings/:accountId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/shippingsettings/:accountId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/:merchantId/shippingsettings/:accountId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/shippingsettings/:accountId"
payload = {
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": False,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": { "businessDays": [] },
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [{ "values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
] }],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": { "storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
] },
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [{ "locationIds": [] }],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [{}],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [{ "cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": False,
"pricePercentage": "",
"subtableName": ""
}
] }]
},
"name": "",
"singleValue": {},
"subtables": [{}]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/shippingsettings/:accountId"
payload <- "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/shippingsettings/:accountId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\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/:merchantId/shippingsettings/:accountId') do |req|
req.body = "{\n \"accountId\": \"\",\n \"postalCodeGroups\": [\n {\n \"country\": \"\",\n \"name\": \"\",\n \"postalCodeRanges\": [\n {\n \"postalCodeRangeBegin\": \"\",\n \"postalCodeRangeEnd\": \"\"\n }\n ]\n }\n ],\n \"services\": [\n {\n \"active\": false,\n \"currency\": \"\",\n \"deliveryCountry\": \"\",\n \"deliveryTime\": {\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0,\n \"timezone\": \"\"\n },\n \"handlingBusinessDayConfig\": {\n \"businessDays\": []\n },\n \"holidayCutoffs\": [\n {\n \"deadlineDate\": \"\",\n \"deadlineHour\": 0,\n \"deadlineTimezone\": \"\",\n \"holidayId\": \"\",\n \"visibleFromDate\": \"\"\n }\n ],\n \"maxHandlingTimeInDays\": 0,\n \"maxTransitTimeInDays\": 0,\n \"minHandlingTimeInDays\": 0,\n \"minTransitTimeInDays\": 0,\n \"transitBusinessDayConfig\": {},\n \"transitTimeTable\": {\n \"postalCodeGroupNames\": [],\n \"rows\": [\n {\n \"values\": [\n {\n \"maxTransitTimeInDays\": 0,\n \"minTransitTimeInDays\": 0\n }\n ]\n }\n ],\n \"transitTimeLabels\": []\n },\n \"warehouseBasedDeliveryTimes\": [\n {\n \"carrier\": \"\",\n \"carrierService\": \"\",\n \"originAdministrativeArea\": \"\",\n \"originCity\": \"\",\n \"originCountry\": \"\",\n \"originPostalCode\": \"\",\n \"originStreetAddress\": \"\",\n \"warehouseName\": \"\"\n }\n ]\n },\n \"eligibility\": \"\",\n \"minimumOrderValue\": {\n \"currency\": \"\",\n \"value\": \"\"\n },\n \"minimumOrderValueTable\": {\n \"storeCodeSetWithMovs\": [\n {\n \"storeCodes\": [],\n \"value\": {}\n }\n ]\n },\n \"name\": \"\",\n \"pickupService\": {\n \"carrierName\": \"\",\n \"serviceName\": \"\"\n },\n \"rateGroups\": [\n {\n \"applicableShippingLabels\": [],\n \"carrierRates\": [\n {\n \"carrierName\": \"\",\n \"carrierService\": \"\",\n \"flatAdjustment\": {},\n \"name\": \"\",\n \"originPostalCode\": \"\",\n \"percentageAdjustment\": \"\"\n }\n ],\n \"mainTable\": {\n \"columnHeaders\": {\n \"locations\": [\n {\n \"locationIds\": []\n }\n ],\n \"numberOfItems\": [],\n \"postalCodeGroupNames\": [],\n \"prices\": [\n {}\n ],\n \"weights\": [\n {\n \"unit\": \"\",\n \"value\": \"\"\n }\n ]\n },\n \"name\": \"\",\n \"rowHeaders\": {},\n \"rows\": [\n {\n \"cells\": [\n {\n \"carrierRateName\": \"\",\n \"flatRate\": {},\n \"noShipping\": false,\n \"pricePercentage\": \"\",\n \"subtableName\": \"\"\n }\n ]\n }\n ]\n },\n \"name\": \"\",\n \"singleValue\": {},\n \"subtables\": [\n {}\n ]\n }\n ],\n \"shipmentType\": \"\"\n }\n ],\n \"warehouses\": [\n {\n \"businessDayConfig\": {},\n \"cutoffTime\": {\n \"hour\": 0,\n \"minute\": 0\n },\n \"handlingDays\": \"\",\n \"name\": \"\",\n \"shippingAddress\": {\n \"administrativeArea\": \"\",\n \"city\": \"\",\n \"country\": \"\",\n \"postalCode\": \"\",\n \"streetAddress\": \"\"\n }\n }\n ]\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}}/:merchantId/shippingsettings/:accountId";
let payload = json!({
"accountId": "",
"postalCodeGroups": (
json!({
"country": "",
"name": "",
"postalCodeRanges": (
json!({
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
})
)
})
),
"services": (
json!({
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": json!({
"cutoffTime": json!({
"hour": 0,
"minute": 0,
"timezone": ""
}),
"handlingBusinessDayConfig": json!({"businessDays": ()}),
"holidayCutoffs": (
json!({
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
})
),
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": json!({}),
"transitTimeTable": json!({
"postalCodeGroupNames": (),
"rows": (json!({"values": (
json!({
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
})
)})),
"transitTimeLabels": ()
}),
"warehouseBasedDeliveryTimes": (
json!({
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
})
)
}),
"eligibility": "",
"minimumOrderValue": json!({
"currency": "",
"value": ""
}),
"minimumOrderValueTable": json!({"storeCodeSetWithMovs": (
json!({
"storeCodes": (),
"value": json!({})
})
)}),
"name": "",
"pickupService": json!({
"carrierName": "",
"serviceName": ""
}),
"rateGroups": (
json!({
"applicableShippingLabels": (),
"carrierRates": (
json!({
"carrierName": "",
"carrierService": "",
"flatAdjustment": json!({}),
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
})
),
"mainTable": json!({
"columnHeaders": json!({
"locations": (json!({"locationIds": ()})),
"numberOfItems": (),
"postalCodeGroupNames": (),
"prices": (json!({})),
"weights": (
json!({
"unit": "",
"value": ""
})
)
}),
"name": "",
"rowHeaders": json!({}),
"rows": (json!({"cells": (
json!({
"carrierRateName": "",
"flatRate": json!({}),
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
})
)}))
}),
"name": "",
"singleValue": json!({}),
"subtables": (json!({}))
})
),
"shipmentType": ""
})
),
"warehouses": (
json!({
"businessDayConfig": json!({}),
"cutoffTime": json!({
"hour": 0,
"minute": 0
}),
"handlingDays": "",
"name": "",
"shippingAddress": json!({
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
})
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".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}}/:merchantId/shippingsettings/:accountId \
--header 'content-type: application/json' \
--data '{
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}'
echo '{
"accountId": "",
"postalCodeGroups": [
{
"country": "",
"name": "",
"postalCodeRanges": [
{
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
}
]
}
],
"services": [
{
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": {
"cutoffTime": {
"hour": 0,
"minute": 0,
"timezone": ""
},
"handlingBusinessDayConfig": {
"businessDays": []
},
"holidayCutoffs": [
{
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
}
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": {},
"transitTimeTable": {
"postalCodeGroupNames": [],
"rows": [
{
"values": [
{
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
}
]
}
],
"transitTimeLabels": []
},
"warehouseBasedDeliveryTimes": [
{
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
}
]
},
"eligibility": "",
"minimumOrderValue": {
"currency": "",
"value": ""
},
"minimumOrderValueTable": {
"storeCodeSetWithMovs": [
{
"storeCodes": [],
"value": {}
}
]
},
"name": "",
"pickupService": {
"carrierName": "",
"serviceName": ""
},
"rateGroups": [
{
"applicableShippingLabels": [],
"carrierRates": [
{
"carrierName": "",
"carrierService": "",
"flatAdjustment": {},
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
}
],
"mainTable": {
"columnHeaders": {
"locations": [
{
"locationIds": []
}
],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [
{}
],
"weights": [
{
"unit": "",
"value": ""
}
]
},
"name": "",
"rowHeaders": {},
"rows": [
{
"cells": [
{
"carrierRateName": "",
"flatRate": {},
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
}
]
}
]
},
"name": "",
"singleValue": {},
"subtables": [
{}
]
}
],
"shipmentType": ""
}
],
"warehouses": [
{
"businessDayConfig": {},
"cutoffTime": {
"hour": 0,
"minute": 0
},
"handlingDays": "",
"name": "",
"shippingAddress": {
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
}
}
]
}' | \
http PUT {{baseUrl}}/:merchantId/shippingsettings/:accountId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "accountId": "",\n "postalCodeGroups": [\n {\n "country": "",\n "name": "",\n "postalCodeRanges": [\n {\n "postalCodeRangeBegin": "",\n "postalCodeRangeEnd": ""\n }\n ]\n }\n ],\n "services": [\n {\n "active": false,\n "currency": "",\n "deliveryCountry": "",\n "deliveryTime": {\n "cutoffTime": {\n "hour": 0,\n "minute": 0,\n "timezone": ""\n },\n "handlingBusinessDayConfig": {\n "businessDays": []\n },\n "holidayCutoffs": [\n {\n "deadlineDate": "",\n "deadlineHour": 0,\n "deadlineTimezone": "",\n "holidayId": "",\n "visibleFromDate": ""\n }\n ],\n "maxHandlingTimeInDays": 0,\n "maxTransitTimeInDays": 0,\n "minHandlingTimeInDays": 0,\n "minTransitTimeInDays": 0,\n "transitBusinessDayConfig": {},\n "transitTimeTable": {\n "postalCodeGroupNames": [],\n "rows": [\n {\n "values": [\n {\n "maxTransitTimeInDays": 0,\n "minTransitTimeInDays": 0\n }\n ]\n }\n ],\n "transitTimeLabels": []\n },\n "warehouseBasedDeliveryTimes": [\n {\n "carrier": "",\n "carrierService": "",\n "originAdministrativeArea": "",\n "originCity": "",\n "originCountry": "",\n "originPostalCode": "",\n "originStreetAddress": "",\n "warehouseName": ""\n }\n ]\n },\n "eligibility": "",\n "minimumOrderValue": {\n "currency": "",\n "value": ""\n },\n "minimumOrderValueTable": {\n "storeCodeSetWithMovs": [\n {\n "storeCodes": [],\n "value": {}\n }\n ]\n },\n "name": "",\n "pickupService": {\n "carrierName": "",\n "serviceName": ""\n },\n "rateGroups": [\n {\n "applicableShippingLabels": [],\n "carrierRates": [\n {\n "carrierName": "",\n "carrierService": "",\n "flatAdjustment": {},\n "name": "",\n "originPostalCode": "",\n "percentageAdjustment": ""\n }\n ],\n "mainTable": {\n "columnHeaders": {\n "locations": [\n {\n "locationIds": []\n }\n ],\n "numberOfItems": [],\n "postalCodeGroupNames": [],\n "prices": [\n {}\n ],\n "weights": [\n {\n "unit": "",\n "value": ""\n }\n ]\n },\n "name": "",\n "rowHeaders": {},\n "rows": [\n {\n "cells": [\n {\n "carrierRateName": "",\n "flatRate": {},\n "noShipping": false,\n "pricePercentage": "",\n "subtableName": ""\n }\n ]\n }\n ]\n },\n "name": "",\n "singleValue": {},\n "subtables": [\n {}\n ]\n }\n ],\n "shipmentType": ""\n }\n ],\n "warehouses": [\n {\n "businessDayConfig": {},\n "cutoffTime": {\n "hour": 0,\n "minute": 0\n },\n "handlingDays": "",\n "name": "",\n "shippingAddress": {\n "administrativeArea": "",\n "city": "",\n "country": "",\n "postalCode": "",\n "streetAddress": ""\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/:merchantId/shippingsettings/:accountId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountId": "",
"postalCodeGroups": [
[
"country": "",
"name": "",
"postalCodeRanges": [
[
"postalCodeRangeBegin": "",
"postalCodeRangeEnd": ""
]
]
]
],
"services": [
[
"active": false,
"currency": "",
"deliveryCountry": "",
"deliveryTime": [
"cutoffTime": [
"hour": 0,
"minute": 0,
"timezone": ""
],
"handlingBusinessDayConfig": ["businessDays": []],
"holidayCutoffs": [
[
"deadlineDate": "",
"deadlineHour": 0,
"deadlineTimezone": "",
"holidayId": "",
"visibleFromDate": ""
]
],
"maxHandlingTimeInDays": 0,
"maxTransitTimeInDays": 0,
"minHandlingTimeInDays": 0,
"minTransitTimeInDays": 0,
"transitBusinessDayConfig": [],
"transitTimeTable": [
"postalCodeGroupNames": [],
"rows": [["values": [
[
"maxTransitTimeInDays": 0,
"minTransitTimeInDays": 0
]
]]],
"transitTimeLabels": []
],
"warehouseBasedDeliveryTimes": [
[
"carrier": "",
"carrierService": "",
"originAdministrativeArea": "",
"originCity": "",
"originCountry": "",
"originPostalCode": "",
"originStreetAddress": "",
"warehouseName": ""
]
]
],
"eligibility": "",
"minimumOrderValue": [
"currency": "",
"value": ""
],
"minimumOrderValueTable": ["storeCodeSetWithMovs": [
[
"storeCodes": [],
"value": []
]
]],
"name": "",
"pickupService": [
"carrierName": "",
"serviceName": ""
],
"rateGroups": [
[
"applicableShippingLabels": [],
"carrierRates": [
[
"carrierName": "",
"carrierService": "",
"flatAdjustment": [],
"name": "",
"originPostalCode": "",
"percentageAdjustment": ""
]
],
"mainTable": [
"columnHeaders": [
"locations": [["locationIds": []]],
"numberOfItems": [],
"postalCodeGroupNames": [],
"prices": [[]],
"weights": [
[
"unit": "",
"value": ""
]
]
],
"name": "",
"rowHeaders": [],
"rows": [["cells": [
[
"carrierRateName": "",
"flatRate": [],
"noShipping": false,
"pricePercentage": "",
"subtableName": ""
]
]]]
],
"name": "",
"singleValue": [],
"subtables": [[]]
]
],
"shipmentType": ""
]
],
"warehouses": [
[
"businessDayConfig": [],
"cutoffTime": [
"hour": 0,
"minute": 0
],
"handlingDays": "",
"name": "",
"shippingAddress": [
"administrativeArea": "",
"city": "",
"country": "",
"postalCode": "",
"streetAddress": ""
]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/shippingsettings/:accountId")! 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()
GET
content.shoppingadsprogram.get
{{baseUrl}}/:merchantId/shoppingadsprogram
QUERY PARAMS
merchantId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/shoppingadsprogram");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/:merchantId/shoppingadsprogram")
require "http/client"
url = "{{baseUrl}}/:merchantId/shoppingadsprogram"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/:merchantId/shoppingadsprogram"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/:merchantId/shoppingadsprogram");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/shoppingadsprogram"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/:merchantId/shoppingadsprogram HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/:merchantId/shoppingadsprogram")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/shoppingadsprogram"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/shoppingadsprogram")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/:merchantId/shoppingadsprogram")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/:merchantId/shoppingadsprogram');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/shoppingadsprogram'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/shoppingadsprogram';
const options = {method: 'GET'};
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}}/:merchantId/shoppingadsprogram',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/shoppingadsprogram")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/shoppingadsprogram',
headers: {}
};
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.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/shoppingadsprogram'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/:merchantId/shoppingadsprogram');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/:merchantId/shoppingadsprogram'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/shoppingadsprogram';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/shoppingadsprogram"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
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}}/:merchantId/shoppingadsprogram" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/shoppingadsprogram",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/:merchantId/shoppingadsprogram');
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/shoppingadsprogram');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/:merchantId/shoppingadsprogram');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/shoppingadsprogram' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/shoppingadsprogram' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/:merchantId/shoppingadsprogram")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/shoppingadsprogram"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/shoppingadsprogram"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/shoppingadsprogram")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/:merchantId/shoppingadsprogram') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/shoppingadsprogram";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/:merchantId/shoppingadsprogram
http GET {{baseUrl}}/:merchantId/shoppingadsprogram
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/:merchantId/shoppingadsprogram
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/shoppingadsprogram")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
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
content.shoppingadsprogram.requestreview
{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview
QUERY PARAMS
merchantId
BODY json
{
"regionCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"regionCode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview" {:content-type :json
:form-params {:regionCode ""}})
require "http/client"
url = "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"regionCode\": \"\"\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}}/:merchantId/shoppingadsprogram/requestreview"),
Content = new StringContent("{\n \"regionCode\": \"\"\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}}/:merchantId/shoppingadsprogram/requestreview");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"regionCode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview"
payload := strings.NewReader("{\n \"regionCode\": \"\"\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(res)
fmt.Println(string(body))
}
POST /baseUrl/:merchantId/shoppingadsprogram/requestreview HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 22
{
"regionCode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview")
.setHeader("content-type", "application/json")
.setBody("{\n \"regionCode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"regionCode\": \"\"\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 \"regionCode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview")
.header("content-type", "application/json")
.body("{\n \"regionCode\": \"\"\n}")
.asString();
const data = JSON.stringify({
regionCode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview',
headers: {'content-type': 'application/json'},
data: {regionCode: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"regionCode":""}'
};
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}}/:merchantId/shoppingadsprogram/requestreview',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "regionCode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"regionCode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/:merchantId/shoppingadsprogram/requestreview',
headers: {
'content-type': 'application/json'
}
};
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({regionCode: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview',
headers: {'content-type': 'application/json'},
body: {regionCode: ''},
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}}/:merchantId/shoppingadsprogram/requestreview');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
regionCode: ''
});
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}}/:merchantId/shoppingadsprogram/requestreview',
headers: {'content-type': 'application/json'},
data: {regionCode: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"regionCode":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"regionCode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview"]
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}}/:merchantId/shoppingadsprogram/requestreview" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"regionCode\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview",
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([
'regionCode' => ''
]),
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;
}
request('POST', '{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview', [
'body' => '{
"regionCode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'regionCode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'regionCode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"regionCode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"regionCode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"regionCode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/:merchantId/shoppingadsprogram/requestreview", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview"
payload = { "regionCode": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview"
payload <- "{\n \"regionCode\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview")
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 \"regionCode\": \"\"\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.post('/baseUrl/:merchantId/shoppingadsprogram/requestreview') do |req|
req.body = "{\n \"regionCode\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview";
let payload = json!({"regionCode": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/:merchantId/shoppingadsprogram/requestreview \
--header 'content-type: application/json' \
--data '{
"regionCode": ""
}'
echo '{
"regionCode": ""
}' | \
http POST {{baseUrl}}/:merchantId/shoppingadsprogram/requestreview \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "regionCode": ""\n}' \
--output-document \
- {{baseUrl}}/:merchantId/shoppingadsprogram/requestreview
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["regionCode": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/:merchantId/shoppingadsprogram/requestreview")! 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()